Cheap Loan | Loans | Mobile Phone | Bollywood | Advertising
HTML Form [Archive] - PCMech Forums

PDA

View Full Version : HTML Form


rcx21000
04-18-2004, 05:07 AM
I have a login html form:

< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
< html >
< head >
< title >< /title >
< /head >
< body >
< div align="center" >< h1 >GP Download< /h1 >< /div >< br >< br >
You aren't logged in. Please login.< br >
< form action="logingin.php" method=get >
Username: < input type="text" name="username" >< b r>
Password: < input type="password" name="password" >< br >< br >
< input type="submit" name="submit" value="Login" >
< /form >
< /body >
< /htm l>

(yes, I know get isn't good for logins, but this is just for testing)

logingin.php:

< ?php setcookie("login", $_GET[username] . " " . $_GET[password]); ? >
< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
< html >
< head >
< title>< /title >
< meta HTTP-EQUIV="REFRESH" content="2; url=search.php" >
< /head >
< body >
Loging in... Please wait.
< /body >
< /html >

The cookie is only saved if I goto logingin.php?username=rcx21000&password=password_here, but if I use the login form, it doesn't work. Also, when I use the login from, the URL only shows logingin.php (w/o the get info).

EIDT: Grrrr... It was actually doing the HTML, and redirecting to search.php ;) I put spaces...

DrZaius
04-18-2004, 11:57 AM
Hi rcx21000,

Try using:<?php setcookie("login", $_GET[$username] . " " . $_GET[$password]); ?>Also, you can post code here by using the PHP tag. Hope this helps.