Jump to content

Help with simple PHP


Thaikhan

Recommended Posts

Hey guys,

 

I'm new to the whole programming scene and am trying to setup a website. The domain is aerithea.com and I'm trying to link the logo on the top left to this php file below but it's not coming up. The anchor seems to be correct but I can't seem to figure out why it's not working. Any help would be greatly appreciated :)

 

<?php
session_start();
?>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Member System - Login</title>
</head>
<body>
 
<?php
 
$form = "<form action='./login.php' method='post'>
<table>
<tr>
<td>Username:</td>
<td><input type='text' name='user' /></td>
</tr>
 
<tr>
<td>Password:</td>
<td><input type='password' name='password' /></td>
</tr>
 
<tr>
<td></td>
<td><input type='submit' name='loginbtn' value='Login' /></td>
</tr>
</table>
</form>";
 
if ($_POST['loginbtn']) {
$user = $_POST['user']
$password = $_POST['password']
 
if ($user) {
if ($password) {
echo "$user - $password <hr/> $form";
 
}
else
echo "You must enter your password. $form";
}
else
echo "You must enter your username. $form";
 
}
else
echo $form;
 
 
 
?>
 
</body>
</html>
Link to comment
https://forums.phpfreaks.com/topic/281095-help-with-simple-php/
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.