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>
Calling a Procedure with IN & OUT Parameters
Hello,
weird problem
last time, i did post a topic concerning why my page sometime will load as blank page when using IE. someone has told me that it might be my hosting server problem, too slow...but, now after testing
need to add "sizes" to shopping cart
Hey guys, I am trying to figure out a way to add a "size" selector on to this bit of code. I added a way to view it in the "zoom.php" page and also to select a size from the sizes
Help with Password Encoding/Decoding?
Trying to design a "change password" tool. On my signup code I'm using base64_encode, now I am trying to decode it on the change password screen and having issues. Yes I am very new to this.
Production Order Enterprise Service to Manufacturing Exctn Sys (MES) ???
Hello Experts,
Notice Undefined index: reset/ Attempting to redirect, works, but get a notice
Full Header.php is:Code: [Select]<?php$reset= false;$reset= strip_tags($_GET["reset"]); //THIS IS LINE 3if(empty($reset)) $reset = false;if($reset==NULL)
AutoChoosing a CSS file based on URL
Hey everyone,I have a site that has multiple URLs and CSS files.Based on the URL that the user goes to I want that CSS file to load.This is what I have thus far in the <head> of my
Extracting Long text from message class with parameters
Hi,
PHP page loading in Firefox but not in IE
hello,i am currently doing a project in PHP and i have a problem. If I view the project in Mozilla Firefox it works fine but if i open using IE i am having problem with the design which is not getting
Parse Error with doctype
I'm getting a parse error with this simple code. I don't get it. It worked one time then when I reloaded the page in FF the code throws this parse error. Parse error: parse error in