Re: Error in code - Seems simple enough

From: Date: Mon, 04 Nov 2002 03:24:10 +0000
Subject: Re: Error in code - Seems simple enough
Groups: php.general 
Request: Send a blank email to php-general+get-122608@lists.php.net to get a copy of this message
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 "<td class='mainmenu' align='center' width='12.5%' style='cursor:hand' onMouseover=\"this.style.backgroundColor='#C0E0FF'\" onMouseout=\"this.style.backgroundColor=''\" onClick=\"window.location.href='login.php'\"><a href='login.php'>Login</a></td>"; } else { echo "<td class='mainmenu' align='center' width='12.5%' style='cursor:hand' onMouseover=\"this.style.backgroundColor='#C0E0FF'\" onMouseout=\"this.style.backgroundColor=''\" onClick=\"window.location.href='logout.php'\"><a href='login.php'>Logout</a></td>"; 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 "<td class='mainmenu' align='center' width='12.5%' > style='cursor:hand' > onMouseover='this.style.backgroundColor='#C0E0FF'' > onMouseout='this.style.backgroundColor=''' > onClick='window.location.href='login.php''><a > href='login.php'>Login</a></td>"; > } else { > echo "<td class='mainmenu' align='center' width='12.5%' > style='cursor:hand' > onMouseover='this.style.backgroundColor='#C0E0FF'' > onMouseout='this.style.backgroundColor=''' > onClick='window.location.href='logout.php''><a > href='login.php'>Logout</a></td>"; > } > ?> > > Thanks > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#122608) next »