Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8819315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:19:35+00:00 2026-06-14T05:19:35+00:00

i am trying to sort out my validation, below is my code, i have

  • 0

i am trying to sort out my validation, below is my code, i have tried loads of things including turning it into an if else structure, however whatever i test with it always returns the error for no email, and i am not sure why. I have even tried removing the exit; from the first if, but still just shows no email.

if(!$reg_username){

     $reg_error = "You have not entered a Username.";
      $_SESSION['error'] = $reg_error;
      header("Location: register.php");
      exit;
 }

 if (!$reg_email){

     $reg_error = "You have not entered an Email.";
      $_SESSION['error'] = $reg_error;
      header("Location: register.php");
      exit;

 }
 if (!$reg_password){

     $reg_error = "You have not entered a Password.";
      $_SESSION['error'] = $reg_error;
      header("Location: register.php");
      exit;
 }
 if (!$reg_password_1){

     $reg_error = "You have not entered your Verification Password.";
      $_SESSION['error'] = $reg_error;
      header("Location: register.php");
      exit;
 }

Any Ideas?

Thanks

EDIT: Here is the rest of the code

$reg_username = $_POST['reg_username'];
     $reg_email = $_POST['reg_email'];
     $reg_password = $_POST['reg_password'];
     $reg_password_1 = $_POST['reg_password_1'];
     $reg_dob_day = $_POST['reg_dob_day'];
     $reg_dob_month = $_POST['reg_dob_month'];
     $reg_dob_year = $_POST['reg_dob_year'];


     include_once "connect_to_mysql.php";
     $reg_username_length = "";
     $reg_password_length = "";
     $reg_dob_day_length = "";
     $reg_dob_year_length = "";


     $reg_email = stripslashes($reg_email); 
     $reg_password = stripslashes($reg_password); 
     $reg_password_1 = stripslashes($reg_password_1); 
     $reg_dob_day = stripslashes($reg_dob_day); 
     $reg_dob_month = stripslashes($reg_dob_month); 
     $reg_dob_year = stripslashes($reg_dob_year); 

     $reg_email = strip_tags($email);
     $reg_password = strip_tags($password);
     $reg_password_1 = strip_tags($reg_password_1);
     $reg_dob_day = strip_tags($reg_dob_day); 
     $reg_dob_month = strip_tags($reg_dob_month); 
     $reg_dob_year = strip_tags($reg_dob_year);



     $reg_username = mysql_real_escape_string($reg_username);
     $reg_email = mysql_real_escape_string($reg_email);
     $reg_password = mysql_real_escape_string($reg_password);
     $reg_password_1 = mysql_real_escape_string($reg_password_1);
     $reg_dob_day = mysql_real_escape_string($reg_dob_day);
     $reg_dob_month = mysql_real_escape_string($reg_dob_month);
     $reg_dob_year = mysql_real_escape_string($reg_dob_year);


     if(!$reg_username){

         $reg_error = "You have not entered a Username.";
          $_SESSION['error'] = $reg_error;
          header("Location: register.php");
          exit;
     }

     if (!$reg_email){

         $reg_error = "You have not entered an Email.";
          $_SESSION['error'] = $reg_error;
          header("Location: register.php");
          exit;
     }
     if (!$reg_password){

         $reg_error = "You have not entered a Password.";
          $_SESSION['error'] = $reg_error;
          header("Location: register.php");
          exit;
     }
     if (!$reg_password_1){

         $reg_error = "You have not entered your Verification Password.";
          $_SESSION['error'] = $reg_error;
          header("Location: register.php");
          exit;
     }
     if ($reg_password != $reg_password_1){

         $reg_error = "Your Verification Passwords do no match.";
          $_SESSION['error'] = $reg_error;
          header("Location: register.php");
          exit;
     }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:19:36+00:00Added an answer on June 14, 2026 at 5:19 am

    Your following line:

    $reg_email = strip_tags($email);
    

    should be like this:

    $reg_email = strip_tags($reg_email);
    

    It seems you just mistype the variable name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we're trying to sort out some conventions for handling dependencies with code checked into
I have a bit of a problem i am trying to sort out. I
Just need help as I have been trying sort this out for ages now.
Trying to sort out some general things considering usage of js and jquery particularly.
I've been trying to sort out some of our code using Dispose properly in
I have a perplexing problem in trying to sort out different behavior of the
Ive been trying to sort out output using AWK, and have been pretty successful
I have been trying to sort this problem out for the last few days.
I have been trying to sort this problem out for days now and I
Spent a solid hour trying to sort out why on earth this (coffeescript) $.ajax

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.