PDA

View Full Version : Quote (single and double) syntax in array


dsdemmin
06-08-2005, 04:01 AM
I am tryint to do something like this:

Button[1] = '<input class="btn2" type="Button" name="Submit" value="Purchase" onclick="document.location='https://www.somewhere.com/nextlevel/herephp?myCost=59.90'>';

Obvisouly the single quotes (red) are messing up the array single quotes.

How can I do this?

Thanks for any help.

gsoft
06-08-2005, 04:13 AM
Try this

Button[1] = '<input class="btn2" type="Button" name="Submit" value="Purchase" onclick="document.location=\'https://www.somewhere.com/nextlevel/herephp?myCost=59.90\'>';

dsdemmin
06-08-2005, 04:20 AM
I had tried that and it did not work... but then I noticed my typo (the last double quote was missing):

Button[1] = '<input class="btn2" type="Button" name="Submit" value="Purchase" onclick="document.location=\'https://www.somewhere.com/nextlevel/herephp?myCost=59.90\'">';

Thanks gsoft!