DarrenReeder Posted November 28, 2009 Share Posted November 28, 2009 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 (sumin@sumin.sumin) because at the moment u can just put '123' as email adress Quote Link to comment Share on other sites More sharing options...
Alex Posted November 28, 2009 Share Posted November 28, 2009 Look into BBcode parsing. Quote Link to comment Share on other sites More sharing options...
Mchl Posted November 28, 2009 Share Posted November 28, 2009 Or more genrally into regular expressions Quote Link to comment Share on other sites More sharing options...
DarrenReeder Posted November 28, 2009 Author Share Posted November 28, 2009 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 ] Quote Link to comment Share on other sites More sharing options...
Alex Posted November 28, 2009 Share Posted November 28, 2009 When pulling the data from the database to display you would parse the BBcode. Quote Link to comment Share on other sites More sharing options...
DarrenReeder Posted November 28, 2009 Author Share Posted November 28, 2009 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? Quote Link to comment Share on other sites More sharing options...
Alex Posted November 28, 2009 Share Posted November 28, 2009 Ex: $text = '[b]Test[/b]'; $text = preg_replace('~\[b\](.*?)\[\/b\]~i', "<b>$1</b>", $text); echo $text; // <b>Test</b> Quote Link to comment Share on other sites More sharing options...
DarrenReeder Posted November 28, 2009 Author Share Posted November 28, 2009 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 Quote Link to comment Share on other sites More sharing options...
trq Posted November 28, 2009 Share Posted November 28, 2009 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. Quote Link to comment Share on other sites More sharing options...
DarrenReeder Posted November 29, 2009 Author Share Posted November 29, 2009 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 Quote Link to comment Share on other sites More sharing options...
trq Posted November 29, 2009 Share Posted November 29, 2009 I do believe AlexWD posted a perfectly good example of this. Quote Link to comment Share on other sites More sharing options...
Mchl Posted November 29, 2009 Share Posted November 29, 2009 echo "". $profileinfo . "" This code is equivalent to this: echo $profileinfo; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.