Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.