I've used PHP for a while for small projects, but I am now working on my first more ambitious project and I am hopelessly stuck. Perhaps somebody could help me out.
In my code, I have this function:
Code: Select all
function readvar($name) {
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS;
$temp=$_COOKIE[$name];
if ($_POST[$name]) $temp=$_POST[$name];
if ($_GET[$name]) $temp=$_GET[$name];
$temp=str_replace("\\","\\\\",$temp);
$temp=str_replace("'","\\'",$temp);
return $temp;
}Code: Select all
$new['definition'] = readvar('definition');Code: Select all
<input name = word7 value = "e;dog"e;>
<input name = word185 value = "e;cat"e;>SOOOO... What is common practice in situations like this? Is there a regex way to handle this? How do I get something like:
Code: Select all
$new['wordX'] = readvar('wordX');Code: Select all
q = mysql_query("e;update word set word = '$newї'wordX'] where wordID = 'X'"e;);All best,
Tench