Jump to content

Mace

Members
  • Posts

    36
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Mace

  1. if you dont want people to be able to edit their username do not make it an input element in your form.

     

    if $_SESSION['username'] gives you an error it means that there is no username key in your session.

    Check with var_dump($_SESSION) what your session contains.

     

    Also, place an exit; right after you set your header(Location .......)  to prevent your code from continuing after setting the header.

    header('Location: ../error.php?err=Registration failure: INSERT');
    exit;
    }
    }
    header('Location: ../success.html');
    exit;
  2. Your $_POST keys you're checking aren't the same as the input name's

    <input type="text" name="name" id="name" value="<?php echo htmlentities($_SESSION['username']);?>" disabled>
    <input type="text" name="name" id="name"/>
    <input type="text" name="name" id="name"/>
    <input type="text" name="email" id="email" />
    <input type="text" name="password" id="password" />
    <select id="select1" name="select1">

    if you submit this the $_POST will be filled with these inputs.

    The keys of the $_POST array will be formed by the name propperty from your input fields.

     

    Example:

    $_POST['name'] = 'Lorem';
    $_POST['email'] = 'Lorem';
    $_POST['password'] = 'Lorem';
    $_POST['select1'] = 'Lorem';

    However, your check starts with:

    if (isset($_POST['username'], $_POST['fname'], $_POST['lname'], $_POST['msisdn'], $_POST['email'], $_POST['query1'])) 

    Change your <input> name propperties to username, fname, lname, msisdn, email and query1

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