Code used for wrapping code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
srirams
Forum Commoner
Posts: 36
Joined: Wed May 25, 2005 8:57 am
Location: India
Contact:

Code used for wrapping code

Post by srirams »

Hi

I have a KB page where I paste samples codes.
In this forum the tags "code" are used to wrap around code and upon submission the code is neatly wrapped.
I believe we need to use CSS for this. I would really appreciate if someone can paste the code for that.
Can I have the code used behind the "code" tag that will make my sample code in a page look like this.

Code: Select all

<?php
if ($cookiestatus <> 'loggedin') 
  { 
      $url = 'error.php'; 
      header("Location: $url"); 
  } 
$name = $_COOKIE['name'];
?>

Thanks
srirams
Forum Commoner
Posts: 36
Joined: Wed May 25, 2005 8:57 am
Location: India
Contact:

Re: Code used for wrapping code

Post by srirams »

Hi guys,

I am still waiting for a reply to this request.

Thanks
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Code used for wrapping code

Post by John Cartwright »

Asking us to do the work for you is not going to fly.

Considering this has been implemented many times, I would suggest you search for one of the many existing solutions.

Hint: It's called bbcode
Post Reply