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

2006-04-11 Thread Chrome
ttinger 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: var $errorMsg = <?php echo addslashes($phpError) ?>; alert('error found: ' + $errorMsg); On 4/11/0

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

2006-04-11 Thread Anthony Ettinger
; Dan > > --- > http://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 > Subj

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

2006-04-11 Thread Chrome
-- 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() On 4/11/06, Chrome <[EMAIL PROTECTED]> wrote: > Does $errorMessage have an

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

2006-04-11 Thread Anthony Ettinger
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 > > --- > http://ch

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 [mailto:[E

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 > > echo"alert('$errorMessage');"; > > } At 11:19 AM

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

2006-04-11 Thread Anthony Ettinger
actually... alert(''); 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 $err

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 > echo"alert('$errorMessage');"; >

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 echo"alert('$errorMessage');"; } [/snip] What does $error contain? Echo it's output to the screen too, for testing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.