Jump to content

Control Option Type Form with PHP


Makeshift67

Recommended Posts

I need help making an Option type Form controlled with PHP, so when i choose my option and click the submit button, it will take me to the predefined link in the PHP script.

 

 

thanks.

 

also, i have no previous skills with PHP.

 

----------------

Now playing: Common Rider - Classics Of Love

via FoxyTunes

Link to comment
https://forums.phpfreaks.com/topic/126402-control-option-type-form-with-php/
Share on other sites

not tested

 

<?php

if(isset($_POST['submit'])){

$urls=$_POST['urls'];

header("location: $urls");
}

?>

<form method="POST" action=<?php echo $_SERVER['PHP_SELF']; ?> >

<select name="urls">

<option value="http://www.google.com">Google</option>
<option value="http://www.msn.com">Msn</option>
<option value="http://www.yahoo.com">yahoo</option>

</select>

<br><br>

<input type="submit" name="submit" value="Take me there!">

</form>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.