Jump to content


This topic is now archived and is closed to further replies.


please help

Recommended Posts

it was not the echo but rather that I forgot a } at the end. Change the end of the script to this

    echo 'There has been an error creating your account. Please contact the webmaster.';
    echo " Your account has now been created. You may login with the following information:<br>
<b>Login Id :</b> $loginid <br>
<b>Password</b> $password <br>";

Here is a login script

include ('includes/db.php');
if ( get_magic_quotes_gpc() ) {
    $_POST= array_map('stripslashes', $_POST);
$loginid= mysql_real_escape_string(trim($_POST['loginid']));
$password= mysql_real_escape_string(trim($_POST['password']));
$mdpwd= md5($password);

$sql= sprintf("SELECT COUNT(*) AS login_match FROM `login_tbl` WHERE `loginid` = '%s' AND `password`= '%s'", $loginid, $mdpwd);
$res= mysql_query($sql) or die(mysql_error());
$login_match= mysql_result($res, 0, 'login_match');

if ( $login_match == 1 ) {
    $_SESSION['loginid']= "$loginid";
    $login_id = $_SESSION['loginid'];
    echo " Welcome $login_id, you are now loged in. <a href=\"http://www.yoursite.com/yourpage.php\">Click here</a> to proceed";
} else {
    echo "Your password and username do not match. Please try again.";
include('your_login_form.html');//change this to your login form
// not logged in

Share this post

Link to post
Share on other sites


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.