Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<form action="[URL unfurl="true"]http://www.yourdomain.com/functions/loginfunction.php"[/URL] method="POST" name="LogIn">
<label>Fullname:
<input name="fullname" type="text" id="fullname" tabindex="1" size="10"></label><br>
<label>Password:
<input name="password" type="password" id="password" tabindex="2" size="10"></label>
<br>
<input name="Submit" value="Submit">
</form>
<?php
//select database and connect - you will need your own conn //script here, or put in the values in like("databasename"," ")
mysql_select_db($database_name, $connection);
//check fullname and password against the db
//if yes return true
//else return false
//check if the fullname exists
$result = mysql_query("select uid, password from users where fullname='$fullname' ");
//IF THERE IS RECORDS RETURNED THEN
if ($row = mysql_fetch_array($result)) {
// IF THERE PASSWORD MATCHES THE DB PASSWORD THEN
if (trim($row["password"]) == $password) {
//START A SESSION
session_start();
$HTTP_SESSION_VARS['userid'] = $row["id"];
//TAKE THEM TO THE LOGGED IN PAGE
header("Location: [URL unfurl="true"]http://www.yourdomain.com/members/index.php");[/URL]
}
//if the password is wrong take them back to the index page
else {
header("Location: [URL unfurl="true"]http://www.yourdomain.com/index.php?errormessage=2");[/URL]
}
}
//if the fullname is wrong or the password is not filled in take them back to index page
else {
header("Location: [URL unfurl="true"]http://www.yourdomain.com/index.php?errormessage=1");[/URL]
}
?>
<?php
include('protector.php');
?>
<?php
session_start();
if($_SESSION['userid'] == "") {
header("Location: [URL unfurl="true"]http://www.icesplice.co.nz/test-webzings/index.php?errormessage=3");[/URL]
}
?>
<?php $errortext = "";
if ($errormessage == "1") {
$errortext = "Invalid Fullname or Not Registered";
}
if ($errormessage == "2") {
$errortext = "Invalid Password";
}
if ($errormessage == "3") {
$errortext = "You are not Logged in";
}
?>
<strong><font color="#FF0000"><?php echo $errortext ?></font></strong>