Jump to content

How can i use [] tags instead of <> tags for profiles??


DarrenReeder

Recommended Posts

On my site im making ive made it so u can register, login and u have a profile which u can update..

 

http://90.202.46.253

 

thats the site, if u go on there, regsiter and login u will see that u can then 'edit my profile' then u update it and view ur page and its updated..but i was playing around with it earlier and found a few bugs with it and i think the HTML tags to use in profile mess about with things (when u originaly regsiter Tags are removed from ur inputed text before its entered to the database)

 

I need to know how i can make it so, were u wuld originally use <b>test</b> u cna use test so then it wont mess about with ur script...

 

ALSO

------

id like to know how i can make it so wen u register, u HAVE to put a real email ([email protected]) because at the moment u can just put '123' as email adress

Look into BBcode parsing.

 

how can i use this on my Site? ive got a textfield input box and a profile page and i want BBcode to work for this profile page but i cant find out how i install the BBcode stuff to my site.. (Atm it just displays it as [ b ]

When pulling the data from the database to display you would parse the BBcode.

 

What you mean by parse?

 

so, lets say in the Database field for my record it says

 

[b]Test[/b]

 

what do i do to display that as Bold? if u know wat i mean?

Ex:

 

$text = '[b]Test[/b]';
$text = preg_replace('~\[b\](.*?)\[\/b\]~i', "<b>$1</b>", $text);
echo $text; // <b>Test</b>

 

Woudlnt this leave me with the same problem..because before i think the main problem was with the fact that the " " was desturbing the script and it caused some problems....

 

hmmm, this BBcode seems a bit confusing, i cant find any tutorials on it anywre

Woudlnt this leave me with the same problem..because before i think the main problem was with the fact that the " " was desturbing the script and it caused some problems....

 

You might want to describe to us what that actual problem is. Sounds like your not escaping your data properly before trying to place it within your database. Take a look at mysql_real_escape_string to see how easily this issue is solved.

well, ill explain the process im going through...

 

I have a field in my database table called 'profile' and this is the info in ur profile page..

 

On the update profile page u have a from with a TextField and when u enter the data then press update, you go to the action page and then it puts whatever u had in the textfield into ur profile field on ur record..

 

now wen u go to ur profile it just displays all the info from your profile field onto the page with the Echo command like this:

 

echo "".  $profileinfo . ""

 

 

I want to make it so u use BB codes for this..That wuld be great if anyone can help me out

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.