For testing purposes, how can I display a variable in a popup window to see if the value is correct?
i.e. in javascript I can do it with this line:
alert("Value: " + var_name);
Is there a similar command in PHP to help debug?
Nope. No popup from PhP directly: PhP is serverside scripting. You can of course echo this variables value to your browser...
J.
I'd do it how leatherback said... just use a PHP echo statement to echo your value to the javascript alert code.
er.. and how is this done?
echo popup_alert('javascript rules!.');
function popup_alert($text){
$field= '<script language="JavaScript">'; $field.='alert('.$text.');'; $field.='</script>';
return $field;
}
My appologies... got called away from my desk, and when I came back, hit "Submit", thinking I'd written you some code before I left. Erkilite has it right for you though.