Mace
-
Posts
36 -
Joined
-
Last visited
-
Days Won
3
Posts posted by Mace
-
-
If your <form action=""> goes to a different php page you need te require those inlcude files again yes.
-
Did you include all the right files in your process\submit_walkin.php file?
You need to start in that php file your session aswell, since your error is appearing in that file.
-
try echo $sql;exit; right after setting your statement.
Then copy paste the query that is outputted in your phpMyAdmin or any other database program you're using.
See if your query event works.
-
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;
-
Try to var_dump($count) right before your if($count==1) statement. See what the result of your count is.
Also, it's better to use an exit; right after your header(Location) te prevent the code to continue after setting the header.
-
if it's in your session, use this:
$username = $_SESSION['username']
and:
$insert_stmt->bind_param($username, $fname, $lname, $msisdn, $email, $query1, $creation_time);
-
Your username field has the propperty disabled, so it wont appear in your $_POST values.
But you're checking in your isset isset($_POST['username'].
That's why it returns false.
-
That means that the if statement return a false.
Try a var_dump($_POST);exit; before the if statement and check if all the keys you require are in the $_POST.
-
have you tried to var_dump($_POST);exit; right after your if(isset) statement?
Just to be sure it enters your if statement.
-
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
Submit Form Not Processing
in PHP Coding Help
Posted
remove this line: