Hello i'm trying to keep the state off my radio buttons so it shows which ones where clicked after the submit button is clicked im new to this so bare with me.
heres my code
<?php
foreach($_POST as $key => $value){
$clicked[$key] = $value;
}
var_dump($clicked);
$block1 = $_POST['q1']+$_POST['q2']+$_POST['q3']+$_POST['q4'];
echo $block1*100/16;
?>
this is the result of the vardump.
array(5) { ["q1"]=> string(1) "1" ["q2"]=> string(1) "2" ["q3"]=> string(1) "3" ["q4"]=> string(1) "2" ["signup"]=> string(6) "submit" } 50
How can i take the value that is outputted from the relevant radio button and retain it after submit.
Here's the form code.
<FORM METHOD="post" ACTION="" id="check">
<table width="830" height="auto" border="0" cellpadding="1" cellspacing="1" style="">
<!----- SECTION ----->
<tr>
<h2>Marketing</h2>
</tr>
<tr>
<td width="25" align="center" valign="top" style="color: #D54D12"> </td>
<td width="622" class="none"><p> </p></td>
<td width="17" align="center" valign="middle" class="borderbutton">1</td>
<td width="17" align="center" valign="middle" class="borderbutton">2</td>
<td width="17" align="center" valign="middle" class="borderbutton">3</td>
<td width="17" align="center" valign="middle" class="borderbutton">4</td>
<td width="92"></td>
</tr>
<tr>
<td colspan="6" align="center" valign="top" class="none" style="color: #D54D12"><hr /></td>
<td></td>
</tr>
<tr>
<td width="25" align="center" valign="top" class="borderbutton" style="color: #D54D12">1.</td>
<td width="622" class="borderbutton"><p>I know where I want my business to go and have a clear vision how to get there.</p></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q1" value="1" validate="required:true" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q1" value="2" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q1" value="3" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q1" value="4" /></td>
<td width="92"><label for="q1" class="error">* Required.</label></td>
</tr>
<tr>
<td width="25" align="center" valign="top" class="borderbutton" style="color: #D54D12">2.</td>
<td width="622" class="borderbutton">I have a written marketing plan that I follow to ensure I market my brand on a regular basis.</td>
<td width="17" align="center" valign="middle" class="borderbutton">
<input type="radio" name="q2" value="1" validate="required:true" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q2" value="2" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q2" value="3" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q2" value="4" /></td>
<td width="92"><label for="q2" class="error">* Required.</label></td>
</tr>
<tr>
<td width="25" align="center" valign="top" class="borderbutton" style="color: #D54D12">3.</td>
<td width="622" class="borderbutton">I understand the role my brand (value delivered by my products and services ) plays in achieving my business goals.</td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q3" value="1" validate="required:true" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q3" value="2" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q3" value="3" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q3" value="4" /></td>
<td width="92"><label for="q3" class="error">* Required.</label></td>
</tr>
<tr>
<td width="25" align="center" valign="top" class="borderbutton" style="color: #D54D12">4.</td>
<td width="622" height="22" class="borderbutton">Our current prices are a true reflection of the value my brand brings our clients.</td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q4" value="1" validate="required:true" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q4" value="2" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q4" value="3" /></td>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="radio" name="q4" value="4" />
<!----- SECTION END ----->
</table>
<table>
<td width="17" align="center" valign="middle" class="borderbutton"><input type="submit"
name="signup" value="submit"></td>
</table>
</FORM>
C++ API to Oracle dB
I need to perform a select command to the Oracle dB to obtain information from a table.What libraries can I link into my project to make this work?I read about the OCI - but I cannot find any
php libs/ browsercap.in
ok i have a host that refuses to stay current. they control my php settings and libs. is there a way to put the browsercap.ini in my root directory and point to it so that i may use the get_browser
captcha error
I have been trying to implement a captcha in php...here is the code..Code: (php) [Select]<?php// Set the content-typeheader('Content-type: image/png');// Create the image$im =
timed header image rotation
I have a joomla site and I was trying to setup a rotating image based on timing NOT just refreshing the page.I found this code (i didn't write it) which works to load images but does not switch them
Display Database
I need to create a shopping cart. I found this code online: http://conceptlogic.com/jcart/Unfortunately, I dont know how to display my product from MYSQL rather than hardcoding as shown in the script
FPDF Help
I've been playing with the FPDF module. I was building a form and rolling right along and then suddenly I started getting the "FPDF error: Some data has already been output, can't send PDF
Aris, Netweaver BPM, Visual composer and X'app
Dear Experts,
Do something every fifth time?
I'm trying to write a loop, but I want it to do something different after every fifth instance. Like, I want it do something like this:Quoteecho $a1;echo $a2;echo $a3;echo $a4;echo $a5.$b;echo $a6;And
PHP form authentication
Hi guys,what am trying to achieve is this: Whenever a user tries to login to my website, an error should be displayed for the first time notifying them to try again. Every time they open the website,
why preg_match_all does not return the number of matches
My regex looks likeX[^\x{4e00}-\x{9fa5}]*Y(where X and Y are two Chinese characters)and my expression looks likepreg_match_all("/".$regex."/iu", $content, $out,