Welcome to WebmasterWorld Guest from 220.127.116.11 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Inserting special characters in MySql with PHP Inserting special characters in MySql with PHP bsaric
I got problem with inserting following code in mysql:
Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: [ ...] ); new-url.com" ?>
<%@ Language=VBScript %>
<% Response.Status="301 Moved Permanently" Response.AddHeader "Location", " [ ...] new-url.com" >
i want that this code is shown like this on page, any suggestion?
Welcome to WebmasterWorld [ webmasterworld.com], bsaric!
What problem are you experiencing?
Don't forget that you can't send a
header [ php.net] if you've already sent any output. In other words, header() must come BEFORE any echo or print statements. FalseDawn
I think they are referring to storing special characters in mysql - look up the "mysql_real_escape_string" function dmmh
yes, im talking about inserting special characters in mysql, and im trying to pull it out in my tutorials as example code, without code execution whoisgregg
Ahhh, now I understand. The different header code confused me into thinking it was a header problem. dmmh has the answer then, html_entities(). (Although I think that bsaric plans on displaying the actual code on the page, like in a PHP tutorial, in which case he will not need html_entity_decode().) bsaric
yes, im trying to do that, and i just can't find solution for this code above whoisgregg
html_entities() [ php.net] will turn all the <,>,and every other bit of special code into it's respective html entities: <, >, etc.
Then you just echo the actual data you inserted into the database.
thanks i will try :)