Makeshift67 Posted September 30, 2008 Share Posted September 30, 2008 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 More sharing options...
redarrow Posted September 30, 2008 Share Posted September 30, 2008 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> Link to comment https://forums.phpfreaks.com/topic/126402-control-option-type-form-with-php/#findComment-653656 Share on other sites More sharing options...
Makeshift67 Posted September 30, 2008 Author Share Posted September 30, 2008 i was looking for something where the form action is a link instead of a PHP code Link to comment https://forums.phpfreaks.com/topic/126402-control-option-type-form-with-php/#findComment-653664 Share on other sites More sharing options...
Makeshift67 Posted September 30, 2008 Author Share Posted September 30, 2008 nevermind, i took all those PHP codes, and put all of them into one php file, then set the value to the file, thanks. Link to comment https://forums.phpfreaks.com/topic/126402-control-option-type-form-with-php/#findComment-653684 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.