|
||||||
| HTML Programming Forum discussion covering HTML, XHTML, DHTML and all flavors of HTML. Hypertext Markup Language is used to create websites. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hey all,
I want to have code that will take a user to a site that they specify. For example: John puts 'google' in the input box. The form will then send him to Google. So whatever SITENAME is it goes to www.<whatever it is>.com Any help please? Will I need JavaScript? Code:
<form name="input" action="http://www.SITENAME.com" method="get"> <input type="text" name="SITENAME" value="" size="20"> <input type="submit" value="Submit"> </form> -Beastilio |
| Sponsored Links |
|
|
|
|||||
|
untested:
PHP Code:
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||||
|
You would need to rename the index.html file to index.php - then assuming your host supports PHP, all you will need to do is copy/paste. I should note, this is also possible to do with JavaScript - but I'm not a huge fan of server side scripting.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||
|
Thanks again
![]() just ONE last question :P I changed the code to Code:
<?php
if(isset($_GET['SITENAME'])) {
header("Location: http://www.{$_GET['SITENAME']}.com");
}
?>
<form name="input" action="index.php" method="get">
<input type="text" name="SITENAME" value="" size="20">
<input type="submit" value="Submit">
</form>
Quote:
-Beastilio |
| Sponsored Links |
|
|
|
|||||
|
Indeed
![]()
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Goal: 100,000 Posts
Complete: 68%