Which characters to escape?
| From: | Nik Gare | Date: | Sun, 07 Jan 2001 14:29:58 +0000 |
| Subject: | Which characters to escape? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-33093@lists.php.net to get a copy of this message | ||
Hi,
I would like to use php to input a php/html mixture into a MySQL table,
but I am totally confused by which characters I have to escape.
If I do something like:
mysql_db_query('maidenheadms',SELE"INPUT templates SET name = "header",
details = "$details");
and $details is something like:
$item = split("/",$file_name,1024);
$i = 1;
while($item[$i] != ""){
$page_file_name = $item[$i];
$i++;
}
$result = mysql_db_query("maidenheadms","SELECT name FROM menu_items
WHERE details = \"$page_file_name\";", $db_link);
while($row = mysql_fetch_array($result)){
$page_title = $row[0];
}
echo "<html><head><title>Maidenead Multiple Sclerosis : ";
echo $page_title;
echo "</title><meta http-equiv=\"build\" content=\"October
2000\"><meta
http-equiv=\"author\" content=\"cheddarcheese.de web design
(info@cheddarcheese.de)\"><meta name=\"description\" content=\"Maidenhead
Multiple Sclerosis, Maidenhead MS, Multiple Sclerosis, MS\"></head><body
bgcolor=\"#eFd2b7\" text=\"#000000\" link=\"#f68033\"
alink=\"#F50000\"
vlink=\"#C95306\">";
which bits in $details do I have to escape, or 'double' escape?
Thanks in advance,
Nik