Computer Hope

Internet & Networking => Web design => Topic started by: Bannana97 on December 07, 2008, 11:05:03 AM

Title: Need Help: HTML Sign Up forms (carrying information to other url)
Post by: Bannana97 on December 07, 2008, 11:05:03 AM
For example:
I type:

Username: Bannana97
Password: XXXXXXXX
Email: [email protected]
SUBMIT

How do I make the submit button go to another link WHILE carrying the information to another spot.

Another example:
I type for my new website:

Name: ClubBannana97
URL: http://www.clubbannana97.com/
SUBMIT

How do I make it go to a page where it says this:

You have just created a website!</br>

website information:

Name: The Name I entered

 URL: the URL I entered

???????????????????
?
Title: Re: Need Help: HTML Sign Up forms (carrying information to other url)
Post by: kpac on December 07, 2008, 12:23:22 PM
You would need to use PHP or ASP for that.

Try the following:

Page 1, where you enter the information:
Code: [Select]
<?php

echo "
<html>

<head>
  <title>My Website</title>
</head>

<body>
  <form action='page2.php' method='post'>
    Name: <input type='text' name='name' id='name' />
    URL: <input type='text' name='url' id='url' />
    <input type='submit' value='Submit' />
  </form>
</body>

</html>"
;

?>


And for "page2.php":
Code: [Select]
<?php

$name 
$_REQUEST['name'];
$url $_REQUEST['url'];

echo 
"<html>

<head>
  <title>Page 2</title>
</head>

<body>
<b>You have just created a website!</b><br />
Website information:<br />
Name: " 
$name "<br /> 
URL: " 
$url "
</body>

</html>"
;

?>


That should work.... ;)
Title: Re: Need Help: HTML Sign Up forms (carrying information to other url)
Post by: fffreak on December 29, 2008, 03:46:16 PM
You don't exactly need a server side scripting language for this, if the server the user is using doesn't provide that functionality, they could always use HTML and Javascript...

Take a look > Here < (http://www.computerhope.com/forum/index.php/topic,33607.msg202969.html), that should help.
Title: Re: Need Help: HTML Sign Up forms (carrying information to other url)
Post by: kpac on December 30, 2008, 06:16:48 AM
Yes, but nearly all servers now support PHP or ASP so that won't be a problem.
Title: Re: Need Help: HTML Sign Up forms (carrying information to other url)
Post by: fffreak on December 30, 2008, 02:20:09 PM
You are right about that, I was just merely saying that if the user's web server did not support any server side scripting languages, than it would still be possible. And you can also use ASP.NET, CFM, JSP, Tcl, Perl, or Python as well, if the web server supports them...
Title: Re: Need Help: HTML Sign Up forms (carrying information to other url)
Post by: kpac on December 30, 2008, 03:30:19 PM
Take a look > Here < (http://www.computerhope.com/forum/index.php/topic,33607.msg202969.html), that should help.

I missed that. Very interesting. :)