PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
My register script is not working it echo's You could not be registered due to a system error. We apologize for any inconvenience. I think it's around the query
Aside from that, your error checking looks pretty bad... if you used indenting you'd have a better grasp on where the problems are. It's hard to keep track of all that when you're pasting in code, but indenting will help - I promise!
Some Assumptions I made, tell me if these are right I guessed the code you posted is of register.php
If that is so, it always displays on the top of the line saying the
if (isset($_POST['submit'])) {
....
...
}else{
...
echo "You could not be registered due to a system error. We apologize for any inconvenience.
";
}
<form>...........
</form>
When anybody opens normally that register.php page by default it is in else loop and shows that message normally
if (isset($_POST['submit'])) { // THERE IS NO $_POST['submit'] VARIABLE SET.....
....
...
}else{ // ....SO THE SCRIPT WILL EXECUTE THIS BLOCK:
...
echo "You could not be registered due to a system error. We apologize for any inconvenience.
";
}
if (isset($_POST['submit'])) { // THERE IS NO $_POST['submit'] VARIABLE SET.....
....
...
}else{ // ....SO THE SCRIPT WILL EXECUTE THIS BLOCK:
...
echo "You could not be registered due to a system error. We apologize for any inconvenience.
";
}
This is great. It's all one code also. the $_POST['submit'] is defining it there and then ... because to define a field box you do
$feildbox = $_POST['name']; so I thought if you do it in the script it will work? How do I define it then. Also
Your form is in the same file as your form handling code? I just assumed you posted them here together.
No thats just the register.php script when the reason why I put it as handling is because it has the query in and then echo's the thank you page. This is all one script. Hope you understand this, thanks for the help