Php isset POST issue

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Mon Aug 04, 2014 11:55 am

Php isset POST issue

Postby wapachii » Mon Aug 04, 2014 12:04 pm

Hi, first off here is the code:

Code: Select all

require '';

         echo "Okay";
         echo "All fields are required";
      echo "error in isset somehwere";

   <form name="register" method="POST" action="Register.php">
<div id="licenseID">License code: <br><input type="text" name="licenseIDRegister"></div>
<div id="forgottenLicense">Forgotten your license code? click <a href="recoverLicense.php">here</a></div>
<div id="firstname">Firstname: <br><input type="text" name="firstnameRegister"></div>
<div id="lastname">Lastname: <br><input type="text" name="lastnameRegister"></div>
<div id="email">Email: <br><input type ="text" name="emailRegister"></div>
<div id="password"> Password: <br><input type="password" name="passwordRegister"></div>
<div id="confirmPassword">Confirm Password: <br><input type="password" name="confirmpasswordRegister"></div>
<div id="securityq">Security Question: <br><input type="text" name="securityqRegister"></div>
<div id="securitya">Secuirty Answer: <br><input type="text" name="securityaRegister"></div>
<div id="captcha">Captcha will be done shortly</div>
<div id="tandc"><input type="checkbox" name="tandc"> I have read and
accept the <a href="tandc.php">terms and conditions</a></div>
<input id="submitRegistration" type="submit" value="Submit" name="RegisterButton">
}else if(loggedIn()){
   echo "you are already logged in";

So what i'm trying to make is a registration page however for there is a problem with the line 5. I've looked over the code several times and it looks perfectly fine however always returns the result "error in isset somewhere" (refer to line 21) when I try to run it. i am completely stumped with this one, I hope someone can help :)

User avatar
New php-forum User
New php-forum User
Posts: 232
Joined: Sat Mar 23, 2013 8:24 am

Re: Php isset POST issue

Postby Strider64 » Tue Aug 05, 2014 5:59 am

Why don't you just do this on top:

Code: Select all

if ( isset($_POST['RegisterButton']) && $_POST['RegisterButton'] == 'Submit' ) {
   // Your processing registration script goes here....

and I don't know why you are checking to see if a user's is login in or not on a registration page, for it seems like a waste of time? I mean that is why they are registering in the first place? Unless I'm missing something? :oops:

You can always validate the user's input inside the registration script, if that was what you were trying to do? Though I would do that in JavaScript as the main way of validating and also have it done in PHP if you want graceful degradation (for those people who disable JavaScript).

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests