Jump to content

sanmagician

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Posts posted by sanmagician

  1. replace it with

     

    header("location:http://www.google.com");

     

    if it redirects to google, maybe you had spelling error, wrong page or folder or something

     

    Will not redirect :S  maybe u want to see the login.php

     

    <html>
    <body>
    <div>
    <p>You must login to view this page. Enter your username and password below and hit submit:</p>
    <form method="post" action="../login_process.php">
    <p>Username:<br>
    <input name="username" type="text" Cid="username">
    
    <p>Password:<br>
    <input name="password" type="password" id="password">
    </p>
    <p>
    <input name="login" type="submit" id="login" value="Submit">
    </p>
    </form>
    <p>Didn't get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p>
    <p>Need an account? <a href="/register.php">Click here</a> to register, it's completely free! </p>
    </div>
    
    </div>
    
    </body>
    </html>

  2. not sure what you mean but this will redirect a page

     

    <script language="javascript" type="text/javascript">

        window.location.href = "http://programming.top54u.com";

    </script>

     

     

    we should start at the beginning,

    the page with the faulty code, have you typed that URL into the browser, are there any errors or nothing?

     

    Just getting sytax error in dw cs5

     

    header("Location: user/member.php");

    <- it shud redirect but does not

     

  3. so the white page is not the page with the code, or the page it is supposed to redirect to? is one of your links wrong?

     

    i was writing this but you posted before if finished writing --->>

     

    at the top of the page add

     

    print_r($_Request)

     

    then you will see if you are getting the $_POST['login']

    I would over type the user name with valid text, the same for the password and just see if it branches in the correct direction

     

    -->

     

     

    But when i was thinking over it can i use a html redirect can u show me in the code?

  4. The php code won`t redirect to user/member.php need some help ;)

     

    <?php
    session_start();
    include 'includes/database.php';
    
    if(isset($_POST['login']))
    {
    
    $username = trim(addslashes($_POST['username']));
    $password = md5(trim($_POST['password']));
    
    $query = mysql_query("SELECT * FROM Users WHERE Username = '$username' AND Password = '$password' LIMIT 1") or
    die(mysql_error());
    
    $row = mysql_fetch_array($query);
    
    if(mysql_num_rows($query) > 0)
    {
    
    if($row['Activated'] > 0)
    {
    
    $_SESSION['s_logged_n'] = 'true';
    $_SESSION['s_username'] = $username;
    $_SESSION['s_name'] = $row['Name'];
    
    header("Location: user/member.php");
    
    
    } else {
    
    echo "You have to activate your account!";
    }
    
    }
    
    }
    
    else
    {
    echo "You have to fill out the login form!";
    }
    
    ?>
    

  5. Updated code nothing to do whit the unexpected end

     

    <?php
    
    include 'includes/database.php';
    
    if(isset($_POST['submit']))
    {
    
    $username = addslashes(trim($_POST['username']));
    $email = addslashes(trim($_POST['email']));
    $pass = addslashes(trim($_POST['password']));
    $conf = addslashes(trim($_POST['confirm']));
    
    $ip = $_SERVER['REMOTE_ADDR'];
    $date = date("d, m y");
    
    if ( $_POST['password'] == $_POST['confirm'] )
    {}else{
    
    echo '<script>alert("Your passwords were not the same, please enter the same password in each field.");</script>';
    echo '<script>history.back(1);</script>';
    exit;
    
    }
    
    $password = md5($pass);
    
    if ((((( empty($username) ) || ( empty($email) ) || ( empty($password) )))))
    {
    
    echo '<script>alert("One or more fields was left empty, please try again.");</script>';
    echo '<script>history.back(1);</script>';
    exit;
    
    }
    
    if((!strstr($email , "@")) || (!strstr($email , ".")))
    {
    
    
    echo '<script>alert("The email you have entred is an invalid email address.")';</script>;
    echo '<script>history.back(1);</script>';
    exit;
    
    }
    
    $actkey = mt_rand(1, 500).'f78dj899dd';
    $act = sha1($actkey);
    
    $query = mysql_query("INSERT INTO Users (Username, Password, Email, Date, IP, Actkey) VALUES
    ('$username','$email','$date','@ip','$act')") or die(mysql_error());
    $send = mail($email , "Registration Confirmation","Thank you for registrering with EthicGamer.com\n\nYour username and
    password is below, along with details on how to activate your account.n\nUser:".$username."\nPass:".$pass."\n\nClick the link
    below to activate your account:\nhttp://ethicgamers.com/activate.php?id=".$act."\n\nPlease do not reply, this is an automated
    mailer.\n\nThanks","FROM: activate@ethicgamers.com");
    
    if(($query)&&($send))
    {
    
    echo ' <html>
    <head>
    </head>
    
    <body>
    
    <div>
    <p>Thank you for registering, you will recieve an email soon with your login details and your activation link so that you can activate your account.</p>
    <p><a href="login.php">Click here</a> to login once you have activated.</p>
    </div>
    
    </body>
    </html>
    ';
    
    } else {
    
    echo '
    <html>
    
    <body>
    
    <div>
    <p>We are sorry, there appears to be a problem with our script at the moment.</p>
    <p>Your data was not lost. Username: '.$username.' | Password: '.$pass.' | Email: '.$email.'</p>
    <p>Please try again later.</p>
    </div>
    
    </body>
    </html>
    ';
    
    }
    
    } else {
    ?>

     

    [attachment deleted by admin]

  6. Parse error: syntax error, unexpected $end in C:\xampp\htdocs\register_process.php on line 97

     

    Here is the script hope fully someone can help me :D

     

     

    i attached the script too

     

    Shud not be a hard job

     

    <?php
    
    include 'includes/database.php';
    
    if(isset($_POST['submit']))
    {
    
    $username = addslashes(trim($_POST['username']));
    $email = addslashes(trim($_POST['email']));
    $pass = addslashes(trim($_POST['password']));
    $conf = addslashes(trim($_POST['confirm']));
    
    $ip = $_SERVER['REMOTE_ADDR'];
    $date = date("d, m y");
    
    if ( $_POST['password'] == $_POST['confirm'] )
    {}else{
    
    echo '<script>alert("Your passwords were not the same, please enter the same password in each field.");</script>';
    echo '<script>history.back(1);</script>';
    exit;
    
    }
    
    $password = md5($pass);
    
    if ((((( empty($first) ) || ( empty($surname) ) || ( empty($username) ) || ( empty($email) ) || ( empty($password) )))))
    {
    
    echo '<script>alert("One or more fields was left empty, please try again.");</script>';
    echo '<script>history.back(1);</script>';
    exit;
    
    }
    
    if((!strstr($email , "@")) || (!strstr($email , ".")))
    {
    
    
    echo '<script>alert("The email you have entred is an invalid email address.")';</script>;
    echo '<script>history.back(1);</script>';
    exit;
    
    }
    
    $actkey = mt_rand(1, 500).'f78dj899dd';
    $act = sha1($actkey);
    
    $query = mysql_query("INSERT INTO Users (Username, Password, Email, Date, IP, Actkey) VALUES
    ('$username','$email','$date','@ip','$act')") or die(mysql_error());
    $send = mail($email , "Registration Confirmation","Thank you for registrering with EthicGamer.com\n\nYour username and
    password is below, along with details on how to activate your account.n\nUser:".$username."\nPass:".$pass."\n\nClick the link
    below to activate your account:\nhttp://ethicgamers.com/activate.php?id=".$act."\n\nPlease do not reply, this is an automated
    mailer.\n\nThanks","FROM: activate@ethicgamers.com");
    
    if(($query)&&($send))
    {
    
    echo ' <html>
    <head>
    </head>
    
    <body>
    
    <div>
    <p>Thank you for registering, you will recieve an email soon with your login details and your activation link so that you can activate your account.</p>
    <p><a href="login.php">Click here</a> to login once you have activated.</p>
    </div>
    
    </body>
    </html>
    ';
    
    } else {
    
    echo '
    <html>
    
    <body>
    
    <div>
    <p>We are sorry, there appears to be a problem with our script at the moment.</p>
    <p>Your data was not lost. Username: '.$username.' | Password: '.$pass.' | Email: '.$email.'</p>
    <p>Please try again later.</p>
    </div>
    
    </body>
    </html>
    ';
    
    }
    
    } else {
    ?>

     

    [attachment deleted by admin]

  7. Parse error: syntax error, unexpected $end in C:\xampp\htdocs\register_process.php on line 97

     

    Here is the script hope fully someone can help me :D

     

     

    i attached the script too

     

    <?php
    
    include 'includes/database.php';
    
    if(isset($_POST['submit']))
    {
    
    $username = addslashes(trim($_POST['username']));
    $email = addslashes(trim($_POST['email']));
    $pass = addslashes(trim($_POST['password']));
    $conf = addslashes(trim($_POST['confirm']));
    
    $ip = $_SERVER['REMOTE_ADDR'];
    $date = date("d, m y");
    
    if ( $_POST['password'] == $_POST['confirm'] )
    {}else{
    
    echo '<script>alert("Your passwords were not the same, please enter the same password in each field.");</script>';
    echo '<script>history.back(1);</script>';
    exit;
    
    }
    
    $password = md5($pass);
    
    if ((((( empty($first) ) || ( empty($surname) ) || ( empty($username) ) || ( empty($email) ) || ( empty($password) )))))
    {
    
    echo '<script>alert("One or more fields was left empty, please try again.");</script>';
    echo '<script>history.back(1);</script>';
    exit;
    
    }
    
    if((!strstr($email , "@")) || (!strstr($email , ".")))
    {
    
    
    echo '<script>alert("The email you have entred is an invalid email address.")';</script>;
    echo '<script>history.back(1);</script>';
    exit;
    
    }
    
    $actkey = mt_rand(1, 500).'f78dj899dd';
    $act = sha1($actkey);
    
    $query = mysql_query("INSERT INTO Users (Username, Password, Email, Date, IP, Actkey) VALUES
    ('$username','$email','$date','@ip','$act')") or die(mysql_error());
    $send = mail($email , "Registration Confirmation","Thank you for registrering with EthicGamer.com\n\nYour username and
    password is below, along with details on how to activate your account.n\nUser:".$username."\nPass:".$pass."\n\nClick the link
    below to activate your account:\nhttp://ethicgamers.com/activate.php?id=".$act."\n\nPlease do not reply, this is an automated
    mailer.\n\nThanks","FROM: activate@ethicgamers.com");
    
    if(($query)&&($send))
    {
    
    echo ' <html>
    <head>
    </head>
    
    <body>
    
    <div>
    <p>Thank you for registering, you will recieve an email soon with your login details and your activation link so that you can activate your account.</p>
    <p><a href="login.php">Click here</a> to login once you have activated.</p>
    </div>
    
    </body>
    </html>
    ';
    
    } else {
    
    echo '
    <html>
    
    <body>
    
    <div>
    <p>We are sorry, there appears to be a problem with our script at the moment.</p>
    <p>Your data was not lost. Username: '.$username.' | Password: '.$pass.' | Email: '.$email.'</p>
    <p>Please try again later.</p>
    </div>
    
    </body>
    </html>
    ';
    
    }
    
    } else {
    echo "You have to fill out the form first!";
    }
    
    ?>

     

    [attachment deleted by admin]

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