Jump to content

innerhtml


justpee

Recommended Posts

anyone can help?

i wanted to do something like e.g. when the user click on radio button, id =RadioGroup2_0 it will set the session variable $_SESSION['SELFPOST'] to shopping.php.

but the problem is, it didnt works as what i have thought..

 

<input name="RadioGroup2" type="radio" id="RadioGroup2_0" value="5" checked="checked" />

 

<input type="radio" name="RadioGroup2" value="10" id="RadioGroup2_1" />

 

 

 

<script type="text/javascript">

{

 

document.getElementById('RadioGroup2_1').innerHTML = '<?php session_start(); $_SESSION['SELFPOST'] = "shipping.php"; ?>';

 

}

Link to comment
https://forums.phpfreaks.com/topic/273615-innerhtml/
Share on other sites

you can't process php code by adding it to current - already parsed - page with javascript. PHP - Hypertext "PRE"processor - that means php is already done doing its job when the page has loaded. If you want to process more php code without refreshing the page you will have to make an AJAX request.

Link to comment
https://forums.phpfreaks.com/topic/273615-innerhtml/#findComment-1408323
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.