Jump to content

PHP cookies :S


dh526

Recommended Posts

Sorry for starting another thread but I still was a bit confused :S

 

Here is the problem, I just want to create a (very) simple login system.

 

Any help would be much appreciated :)

 

I have login.html

 

 
<html>
<head>
</head>
<body>


Please login
<br>



<form method="post" action="login1.php">

username:<input type="text" name= "username"/>


<br>

<input type="submit" />
</form>

</body>

</html>

 

and login1.php

 

<html>
<head>
</head>

<body>

<?


$username = $_POST ['username'];
setcookie('username', $username);
echo "<a href="login2.php">LINK</a>"; 

?>


</body>
</html>

and then i want to show the username in another page, called login2.php

 


<?

echo $_COOKIE['username'];


?>

 

again, I don't know why this isn't working :S I feel like it makes sense :S

 

Sorry, I feel such a plonker while doing this sometimes ...

 

Link to comment
https://forums.phpfreaks.com/topic/158829-php-cookies-s/
Share on other sites

hey dh526. I do not know a lot about code, but i managed to get my login system to work XD

 

i was thinking... since were both kinda new to code, and learning.. maybe we could be friends and work together to learn if u wanted lol

 

uh.

 

possible pedophile?

 

sorry if that offends, just my first reaction when reading this on an online forum.

 

Link to comment
https://forums.phpfreaks.com/topic/158829-php-cookies-s/#findComment-838589
Share on other sites

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.