Jump to content

Help with simple PHP


Go to solution Solved by kicken,

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>
Edited by Thaikhan
Link to comment
https://forums.phpfreaks.com/topic/281095-help-with-simple-php/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.