Click here to Skip to main content
15,879,535 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Javascript resizing code Pin
Sam Heller13-Apr-07 1:32
Sam Heller13-Apr-07 1:32 
GeneralRe: Javascript resizing code Pin
badgrs15-Apr-07 22:32
badgrs15-Apr-07 22:32 
AnswerRe: Javascript resizing code Pin
Shog913-Apr-07 8:08
sitebuilderShog913-Apr-07 8:08 
GeneralRe: Javascript resizing code Pin
Sam Heller13-Apr-07 9:23
Sam Heller13-Apr-07 9:23 
GeneralRe: Javascript resizing code Pin
Shog913-Apr-07 10:05
sitebuilderShog913-Apr-07 10:05 
QuestionPHP - select box Pin
john3411-Apr-07 20:46
john3411-Apr-07 20:46 
AnswerRe: PHP - select box Pin
hiral_shah11-Apr-07 23:33
hiral_shah11-Apr-07 23:33 
AnswerRe: PHP - select box Pin
Bradml12-Apr-07 1:39
Bradml12-Apr-07 1:39 
Here is what I would do:

<code><?php
session_start();

$options = array("Option1", "Option2", "Option3");

if ($_POST['submit']) {
	//The form has been submited
	if (in_array($_POST['option'], $options)) {
		//The option is valid.
		$_SESSION['selected'] = $_POST['option'];
		header("Location: secoundpage.php");
		exit();
		
	}else {
		$error = "That was an incorrect selection";
	}
}

?></code>

<html>
	
	<head>
		<title>Welcome</title>
	</head>
	
	<body>
		<form action="" enctype="multipart/form-data" method="post">
		<code><?php echo $error; ?></code><br />
			<select name="option">
				<code><?php 
					foreach ($options as $value)
					{
						
						$sel = '';
						if ($value == $_POST['option']) {
							$sel = "selected=\"selected\" ";
						}
						//Create the list box
						echo "<option {$sel}value=\"{$value}\">{$value}</option>\n";
					}
				?></code>
			</select>
			<br />
			<br />
			<input type="submit" name="submit" value="Submit" />
		</form>
	</body>
</html>










Brad
Australian

- Me on "Public interest"

If you actually read this let me know.


QuestionHow to set browser to full screen on loading ? Pin
Anthony Yeap11-Apr-07 6:48
Anthony Yeap11-Apr-07 6:48 
AnswerRe: How to set browser to full screen on loading ? Pin
Guffa11-Apr-07 7:01
Guffa11-Apr-07 7:01 
AnswerRe: How to set browser to full screen on loading ? Pin
Bradml11-Apr-07 14:56
Bradml11-Apr-07 14:56 
GeneralRe: How to set browser to full screen on loading ? Pin
Anthony Yeap12-Apr-07 6:44
Anthony Yeap12-Apr-07 6:44 
AnswerRe: How to set browser to full screen on loading ? Pin
RichardGrimmer13-Apr-07 6:03
RichardGrimmer13-Apr-07 6:03 
AnswerRe: How to set browser to full screen on loading ? Pin
Vasudevan Deepak Kumar13-Apr-07 7:02
Vasudevan Deepak Kumar13-Apr-07 7:02 
QuestionJava Code Pin
calumogg11-Apr-07 6:32
calumogg11-Apr-07 6:32 
AnswerRe: Java Code Pin
Bradml11-Apr-07 14:55
Bradml11-Apr-07 14:55 
AnswerRe: Java Code Pin
Christian Graus11-Apr-07 15:56
protectorChristian Graus11-Apr-07 15:56 
QuestionJ2EE/Java Integration with Sharepoint. Pin
Vikram.....11-Apr-07 2:58
Vikram.....11-Apr-07 2:58 
AnswerRe: J2EE/Java Integration with Sharepoint. Pin
Magnus Salgo12-Apr-07 0:13
Magnus Salgo12-Apr-07 0:13 
AnswerRe: J2EE/Java Integration with Sharepoint. Pin
abcdpqr1019-Jan-10 12:51
abcdpqr1019-Jan-10 12:51 
QuestionISAPI Rewrite Pin
L Viljoen11-Apr-07 2:53
professionalL Viljoen11-Apr-07 2:53 
AnswerRe: ISAPI Rewrite Pin
L Viljoen11-Apr-07 4:26
professionalL Viljoen11-Apr-07 4:26 
QuestionFirefox Javascript Nightmare Pin
L Viljoen11-Apr-07 1:41
professionalL Viljoen11-Apr-07 1:41 
AnswerRe: Firefox Javascript Nightmare Pin
Guffa11-Apr-07 2:06
Guffa11-Apr-07 2:06 
AnswerRe: Firefox Javascript Nightmare Pin
Paddy Boyd11-Apr-07 2:54
Paddy Boyd11-Apr-07 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.