Hi there,
I am trying to run some HTML in PHP. When I use it without PHP, it works fine. But when I try to put it in PHP, then it won't work. I'm pretty sure that it has to do with my use of quotes and the printf function in PHP. From what I can tell, there needs to be double quotes (see the HMTL section that works), but I don't know how the syntaxt to write those double quotes in the printf function (in PHP).
I think that it's something very small, but I can't figure it out.
Thank you!
PHP (fails, but I want it to work like the HTML below):
printf("<input type='button' value='Go'");
printf("onClick=");
printf("window.location.href = 'Event_update_form.php?' +
this.form.selectName.options[this.form.selectName.selectedIndex].text "");
printf(">");
HTML (does work, want the PHP to work like this one):
<input type='button' value='Go' onClick="window.location.href = 'Event_update_form.php?' +
this.form.selectName.options[this.form.selectName.selectedIndex].text"
onsubmit='return pDoSomething()'>