Hi
I'm trying to get a small script working I need to get the user to
input some info from a prompt and then use that info in
a PHP script, but I can't seem to assign the JavaScript var
to a PHP var
<?PHP
if ($do == 'ban') {
print "<SCRIPT language=JavaSc ript>";
print "var reason; ";
print 'reason=prompt( "Please enter the reason for banning this
user:","");';
print "document.write (\"Banning ID $id - \"+reason+\"<br >\");";
/// problem here none of these work
print "document.write (\"$banreason =\"+reason+\"\" );";
print "$banreason = reason";
////
print "</SCRIPT>";
print "outside javascrpt the reason = $banreason<br>" ;
// do PHP SQL here
}
?>
I'm trying to get a small script working I need to get the user to
input some info from a prompt and then use that info in
a PHP script, but I can't seem to assign the JavaScript var
to a PHP var
<?PHP
if ($do == 'ban') {
print "<SCRIPT language=JavaSc ript>";
print "var reason; ";
print 'reason=prompt( "Please enter the reason for banning this
user:","");';
print "document.write (\"Banning ID $id - \"+reason+\"<br >\");";
/// problem here none of these work
print "document.write (\"$banreason =\"+reason+\"\" );";
print "$banreason = reason";
////
print "</SCRIPT>";
print "outside javascrpt the reason = $banreason<br>" ;
// do PHP SQL here
}
?>
Comment