d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > How To Pass Php Variable In A Radio Button In Html > Tx
Add Reply New Topic New Poll
Member
Posts: 3,965
Joined: Jul 10 2011
Gold: 5,200.00
Nov 2 2015 05:24am
what i got :

Code
<p class="Text"><font face="Arial"><font face="Arial"><font size="3"
face="Arial">Question 187&nbsp;: Je suis sûr de n'avoir passé aucune question ni d'avoir omis d'y répondre de façon appropriée.</font></font></font></p>
<p class="Text"><font face="Arial"><font face="Arial"><font face="Arial"><font size="2"><input type="radio"
value="<?php echo $timestart = microtime(true);>"
name="choix187" />Oui
<br /></font></font></font></font></p>
<p class="Text"><font face="Arial"><font face="Arial"><font face="Arial"><font size="2"><input type="radio"
value="<?php echo $timestart = microtime(true);>"
name="choix187" />Incertain
<br /></font></font></font></font></p>
<p class="Text"><font face="Arial"><font face="Arial"><font face="Arial"><font size="2"><input type="radio"
value="<?php echo $timestart = microtime(true);>"
name="choix187" />Non
<br /></font></font></font></font></p>
<p class="Text">&nbsp;</p><font face="Arial"><font face="Arial">
<p><input type="submit" name="envoi" value="Envoyer" /></p>

this is in my php file its called when the user click on the submit button :

Code
$timestop = microtime(true);
$time = $timestop - $timestart;
Member
Posts: 3,965
Joined: Jul 10 2011
Gold: 5,200.00
Nov 2 2015 07:21am
i'll try to give more details because i feel like it can be confusing. i want an actual HTML form (not php) to receive a PHP variable that would be also defined in the HTML file. this variable will contain microtime(true); and will be used in a php file that im calling with a method on a submit button
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Nov 2 2015 06:39pm
wtf is this shit?
Code
<font face="Arial"><font face="Arial"><font size="3" face="Arial">


anyway, to your question:
Quote
i want an actual HTML form (not php) to receive a PHP variable that would be also defined in the HTML file


i'm still not clear what you want. are you saying you don't want the file you listed to have any <?php> tags? if so, you have a few options.
1) use javascript/jquery to make a web service call on the page to your php code
2) pass the value as a param to the page (post/get/etc)

are you trying to see how long it takes the user after loading the page to submit the form? i'm sure there are better ways of handling it. keep in mind the user can spoof that value as well.

This post was edited by carteblanche on Nov 2 2015 06:40pm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll