RE: [PHP] php varible in Javascript alert()

2006-04-11 Thread Jay Blanchard
[snip] if($error) { echo $errorMessage; // for testing error message is displayed to screen echoscript language=\JavaScript\alert('$errorMessage');/script; } [/snip] What does $error contain? Echo it's output to the screen too, for testing. -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] php varible in Javascript alert()

2006-04-11 Thread Anthony Ettinger
alert('echo $errorMessage'); On 4/11/06, Mace Eliason [EMAIL PROTECTED] wrote: Hi, I am not sure why this won't work I am pretty sure I have done it before; if($error) { echo $errorMessage; // for testing error message is displayed to screen echoscript

Re: [PHP] php varible in Javascript alert()

2006-04-11 Thread Anthony Ettinger
actually... alert('? echo $errorMessage; ?'); On 4/11/06, Anthony Ettinger [EMAIL PROTECTED] wrote: alert('echo $errorMessage'); On 4/11/06, Mace Eliason [EMAIL PROTECTED] wrote: Hi, I am not sure why this won't work I am pretty sure I have done it before; if($error) { echo

Re: [PHP] php varible in Javascript alert()

2006-04-11 Thread Paul Novitski
On 4/11/06, Mace Eliason [EMAIL PROTECTED] wrote: I am not sure why this won't work I am pretty sure I have done it before; if($error) { echo $errorMessage; // for testing error message is displayed to screen echoscript language=\JavaScript\alert('$errorMessage');/script;

RE: [PHP] php varible in Javascript alert()

2006-04-11 Thread Chrome
Does $errorMessage have any single quotes in it? Eg: Can't connect to DB Because if it does it will cause a Javascript error: alert('Can't connect to DB'); Just another thing to look for :) Dan --- http://chrome.me.uk -Original Message- From: Mace Eliason

Re: [PHP] php varible in Javascript alert()

2006-04-11 Thread Anthony Ettinger
?php alert('echo addslashes($errorMsg);'); ? On 4/11/06, Chrome [EMAIL PROTECTED] wrote: Does $errorMessage have any single quotes in it? Eg: Can't connect to DB Because if it does it will cause a Javascript error: alert('Can't connect to DB'); Just another thing to look for :) Dan

RE: [PHP] php varible in Javascript alert()

2006-04-11 Thread Chrome
: [PHP] php varible in Javascript alert() ?php alert('echo addslashes($errorMsg);'); ? On 4/11/06, Chrome [EMAIL PROTECTED] wrote: Does $errorMessage have any single quotes in it? Eg: Can't connect to DB Because if it does it will cause a Javascript error: alert('Can't connect to DB'); Just

Re: [PHP] php varible in Javascript alert()

2006-04-11 Thread Anthony Ettinger
://chrome.me.uk -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony Ettinger Sent: 12 April 2006 00:58 To: Chrome Cc: Mace Eliason; php-general@lists.php.net Subject: Re: [PHP] php varible in Javascript alert() ?php alert('echo addslashes

RE: [PHP] php varible in Javascript alert()

2006-04-11 Thread Chrome
] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony Ettinger Sent: 12 April 2006 01:32 To: Chrome Cc: Mace Eliason; php-general@lists.php.net Subject: Re: [PHP] php varible in Javascript alert() Yes, alert() as in the javascript: script language=javascript var $errorMsg = ?php echo addslashes($phpError