HI
I want to assign data coming from a form to a variable. I want if $your_code exist in data coming from form then value assign to $new variable otherwise assign to $old variable but the function ereg does not recognizing the $ as a normal text, and always assign the text value to $old even $your_code exist. It works when I remove the $ from $your_code, what is worng with code, can some1 help?
############
if ($_REQUEST['title'] == "start") {
$template = $_REQUEST['text'];
if(ereg('$your_code', $template)) $new = $template;
else $old = $template . "\n" . '$your_code';
}
else error_function();
##########
Thanks in advance