p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

beginning_php thread: Buttons in PHP3

Message #1 by "Dave Brown" <dave@m...> on Tue, 15 Oct 2002 23:02:51
I've been trying to create buttons in my PHP code using the JavaScript:

<a id="updateButton" class="CommandButton" href="javascript:
{window.location ='http://www.yahoo.com';} " style="background-

Problem is, PHP doesn't like the double-quotes and the JavaScript doesn't 
like the single-quotes. Arghhh...

Is there a good/better way to create buttons in PHP?


Message #2 by "Nikolai Devereaux" <yomama@u...> on Tue, 15 Oct 2002 15:29:54 -0700
How does PHP not like the double quotes?  What's your PHP code?

Before you send it, you should know that you can escape quotes in PHP.

echo "window.location=\"http://www.yahoo.com/\"";

will send the following text to the client:


take care,


  Return to Index