|
Posted by paul814 on 11/21/07 16:26
On Nov 20, 7:21 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Tue, 20 Nov 2007 22:32:45 +0100, <paul...@excite.com> wrote:
> > OK well the page write-editorial.php opens now but it opens if radio
> > selected = 0 or 1. it should only do it if == 0. Am I missing
> > something?
>
> > <?PHP
> > if($selected_radio == 0){
> > header('Location:
> >http://localhost/production/write-editorial.php');
> > exit;
> > }
> > ?>
>
> > do I first have to tell it what radio button is called, ex:
> > radReadWrite ?
>
> Well, how do you get this magic '$selected_radio' variable? (Hint:
> register_globals is probably off, so $selected_radio is not set. Loose
> comparison of 0 against NULL equals true)
> --
> Rik Wasmus
OK I see what I was doing wrong again, I was not assigning a value to
the variable first.
.........
Right now I have a simple IF to take me to a page based on selected
radio button:
Code:
<?PHP
$selected_radio = $_POST['radReadWrite'];
if($selected_radio == 0){
header('Location: http://localhost/production/write-editorial.php');
exit;
}
?>
How would I make this multi-dimensional, meaning I also have a option
group pull down, like a pull down you would see on the web for
selecting your State.
I want to do something like this:
If $selected_radio ==0 and lstdepartment == lsteditorial then goto
page write-editorial.php
or if $selected_radio ==0 and lstdepartment == lstpress then goto page
write-press.php
something like that?
How do I get the value of my lstbox? like I did for radio...
$selected_radio = $_POST['radReadWrite'];
Here is my code with the actual radio buttons and lst boxes:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Production Report</title><style type="text/css">
<!--
.style2 {font-size: 24px}
.style5 {font-size: 18px}
-->
</style></head>
<body>
<center>
<p><img src="http://info/test/etnlogored2.gif" width="199"
height="30" /></p>
<script type="text/javascript">
document.write(Date())
</script>
<p><em><strong><span class="style2 style5">What would you like
to do?:</span></strong></em></p>
<form id="form1" name="form1" method="post" action="select.php">
<p>
<label>
<input type="radio" name="radReadWrite" value="0"
id="radReadWrite_0" />
<span class="style5">Write Report</span></label>
<br />
<label>
<input type="radio" name="radReadWrite" value="1"
id="radReadWrite_1" />
<span class="style5">View Report</span></label>
</p>
<p><em><strong><span class="style5">Please also select the
department:</span></strong></em></p>
<p>
<select name="lstdepartment" id="lstdepartment">
<option value="lstEditorial">Editorial</option>
<option value="lstPrepress">Pre Press</option>
<option value="lstInformationTechnology">Information
Technology</option>
<option value="lstPres">Press</option>
<option value="lstMailroom">Mail Room</option>
<option value="lstCirculation">Circulation</option>
</select>
</p>
<p>
<input type="submit" name="btnSubmit" id="btnSubmit"
value="Continue" />
<br />
</p>
</form>
</center>
</body>
</html>
Thanks for any help..
[Back to original message]
|