justpee Posted January 25, 2013 Share Posted January 25, 2013 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 More sharing options...
The Letter E Posted January 26, 2013 Share Posted January 26, 2013 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.