Re: [PHP] Error in code - Seems simple enough
This is rather problem about javascript than PHP - But I think that you need to use double quotes (escaped) to distinguish query and variables in your javascript query: Try out this, It work fine for me: if(!isset($HTTP_SESSION_VARS['svUserAccess'])){ echo "Login"; } else { echo "Logout"; wrote in message news:20021104022815.4043.qmail@;pb1.pair.com... > I'm having trouble with the following code dispalying an error, which I > don't understand because the code actually works (other than the error). Any > ideas? > > if(!isset($HTTP_SESSION_VARS['svUserAccess'])){ > echo " style='cursor:hand' onMouseover='this.style.backgroundColor='#C0E0FF'' > onMouseout='this.style.backgroundColor=''' > onClick='window.location.href='login.php''> href='login.php'>Login"; > } else { > echo " style='cursor:hand' onMouseover='this.style.backgroundColor='#C0E0FF'' > onMouseout='this.style.backgroundColor=''' > onClick='window.location.href='logout.php''> href='login.php'>Logout"; > } > ?> > > Thanks > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Error in code - Seems simple enough
That's the thing, everything works but the error message keeps coming up? Runtime Error: Syntax Error -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Error in code - Seems simple enough
And the error is?? > -Original Message- > From: vernon [mailto:vernon@;comp-wiz.com] > Sent: Sunday, November 03, 2002 9:28 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Error in code - Seems simple enough > > I'm having trouble with the following code dispalying an error, which I > don't understand because the code actually works (other than the error). > Any > ideas? > > if(!isset($HTTP_SESSION_VARS['svUserAccess'])){ > echo " style='cursor:hand' onMouseover='this.style.backgroundColor='#C0E0FF'' > onMouseout='this.style.backgroundColor=''' > onClick='window.location.href='login.php''> href='login.php'>Login"; > } else { > echo " style='cursor:hand' onMouseover='this.style.backgroundColor='#C0E0FF'' > onMouseout='this.style.backgroundColor=''' > onClick='window.location.href='logout.php''> href='login.php'>Logout"; > } > ?> > > Thanks > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php