PHPMine
<? if(PHP > $Expectations) echo $Results ?>
by Angel S. Moreno
UNDER SOME SERIOUS CONSTRUCTION LINKS MAY NOT WORK
Asked 2008-05-20 07:29:40 by sandydessert
SendRedirect("page.jsp");
Also plz tell me what php script to write for the following:-
There should be options to enter a username and password (i know how to do this i.e. by using form ) and to click on a login button (just like how we enter into yahoo mail). Now, after clicking the login button it has to be checked whether the username and password entered are valid or not (they are stored in a MySQL table) and if valid then control should navigate to a new page say list.php
Anwered 2008-05-20 07:36:16 by mhnd_79
use the 'header' function
Anwered 2008-05-20 07:39:43 by Colanth
1) Header location.
2) Select the username and password from the database. If there's a record, it's valid. If there's no record with that username and password, it's not a valid login. The rest is html. (You might want to make use of PHP's MD5 function, storing passwords as MD5 hashes, and selecting for the username and the MD5 hash of the password the user enters.)
Anwered 2008-05-21 22:25:19 by PHPMine.com
if(password_is_good($username, $password))
header("Location: member_page.php");
else
header("Location: login.php");
function password_is_good($username, $password){
$sql = "select count(*) from members
where username = '$username' and
password = '$password' limit 1";
$is_good = (bool) mysql_query($sql);
return $is_good;
}
if you need further assist just email me.
Anwered 2008-05-23 00:28:37 by Rangacharyulu G
$conn=mysql_connect('host','user','passw...
mysql_select_db('database',$conn);
$sql1="select user_id from users where user_id='".$_POST['uid']."' and password=PASSWORD('".$_POST['pwd']."')";
$rs=mysql_query($sql1,$conn) or die("Can not execute: ".mysql_error($conn));
if(mysql_num_rows($rs)==0)
{
$msg="Invalid User ID / Password";
header("Location:login.php");
}
else
{
session_start();
$row=mysql_fetch_array($rs);
$_SESSION['uid']=$_POST['uid'];
header("Location:page.php");
}
Questions and answers provided by the Yahoo Answers Community.