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

  • Home
  • SEARCH
  • 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 7952877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:59:37+00:00 2026-06-04T02:59:37+00:00

Ok help..my registration page worked on the local server but its now saying that

  • 0

Ok help..my registration page worked on the local server but its now saying that the two mysql lines are not valid when its online..why does it change when it goes online? the code pasted is all thats relevant. for some reason it doesnt like the transaction..and the email check mysql bit

include 'Connect.php'; //Connects to database
//When form is submit:-
if(isset($_POST['submit']))
{         
                        // On submit, retrieve table values for php.                 
                        $Firstname = mysql_real_escape_string($_POST['firstname']);
                        $Surname = mysql_real_escape_string($_POST['surname']);
                        $Password = mysql_real_escape_string($_POST['password']); 
                        $PasswordCheck = mysql_real_escape_string($_POST['passwordcheck']); 
                        $Email = mysql_real_escape_string($_POST['email']); 
                        $EmailCheck = mysql_real_escape_string($_POST['emailcheck']); 

                    //CHECKS. 
                    //Check username is available by retrieving any same values from the DB table.          
                    $CheckEmailAvailable = mysql_query("SELECT * FROM 'user_details' WHERE Email = '$Email'");
                    echo $CheckEmailAvailable;
                    // $result = mysql_query("SELECT * FROM $tbl WHERE Email='$email' and LoginPassword='$password'");
                    $Results = mysql_fetch_array($CheckEmailAvailable);

                    //If Username field is blank.
                    if($Email == null )
                    {               
                        echo "You must enter an email address.";
                        $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
                        echo "<br/><br/>";
                        echo "<a href='$url'>Click Here To Return</a>";
                        die();                      
                    }

                    //If RESULTS is any value other than NULL, die.
                    if($Results != null )
                    {               
                        echo "Email already taken. Please try another.";
                        $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
                        echo "<br/><br/>";
                        echo "<a href='$url'>Click Here To Return</a>";
                        die();                  
                    }

                    //If Password and PasswordCheck fields in reg do not match, die.
                    if($Password != $PasswordCheck) 
                    {
                        echo "The passwords you have entered do not match. Please try again.";
                        $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
                        echo "<br/><br/>";
                        echo "<a href='$url'>Click Here To Return</a>";
                        die();
                    }

                    //If Password field is NULL (i.e. blank) die.
                    if($Password == Null)
                    {
                        echo "Your password must not be blank.";
                        $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
                        echo "<br/><br/>";
                        echo "<a href='$url'>Click Here To Return</a>";
                        die();
                    }

                    //If Email and EmailCheck are not equal, die.
                    if($Email != $EmailCheck)
                    {                                                                        
                        echo "The email addresses you have entered do not match. Please try again.";
                        $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
                        echo "<br/><br/>";
                        echo "<a href='$url'>Click Here To Return</a>";
                        die();

                    }


                    //ELSE add data to DB.
                    else
                    {
                    //BEGIN TRANS
                    mysql_query("BEGIN TRAN");

                    //TABLE ADD.
                    $sql=mysql_query("INSERT INTO `user_details` (`Firstname`, `Surname`, `Email`, `Password`) VALUES ('$Firstname', '$Surname', '$Email', '$Password')")
                    or mysql_query("ROLLBACK TRAN") . die(mysql_error("Error registering, the database may be down, please try again later."));


                    //COMMIT transaction, to ensure data is added properly.
                    mysql_query("COMMIT TRAN");
                    header( 'Location: RegSucc.php' ) ;
                    }   
                } ?>
              <html> 
            <!--Registration Form-->
            <form name="form1" method="post" style="margin-left: 28%" action="Register.php">
                <table width="100%" border="0" cellpadding="3" cellspacing="1">
                <tr>
                    <td colspan="3"><strong>Register Account</strong></td>
                </tr>
                <tr>
                    <td style="width: 83px">First Name:</td>
                    <td>:</td>
                    <td><input name="firstname" type="text"/></td>
                </tr>
                <tr>
                    <td style="width: 83px">Surname:</td>
                    <td>:</td>
                    <td><input name="surname" type="text"/></td>
                </tr>
                <tr>
                    <td style="width: 83px">Email Address:</td>
                    <td>:</td>
                    <td><input name="email" type="text"/></td>
                </tr>
                <tr>
                    <td style="width: 83px">Email Address Confirmation:</td>
                    <td>:</td>
                    <td><input name="emailcheck" type="text"/></td>
                </tr>
                <tr>
                    <td style="width: 83px">Password:</td>
                    <td>:</td>
                    <td><input name="password" type="password"/></td>
                </tr>
                <tr>
                    <td style="width: 83px">Verify Password:</td>
                    <td>:</td>
                    <td><input name="passwordcheck" type="password"/></td>
                </tr>
                <tr>
                    <td style="width: 83px">&nbsp;</td>
                    <td>&nbsp;</td>
                    <td><input type="submit" name="submit" value="Register"/></td>
                </tr>
                </table>
            </form>
  • 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-04T02:59:39+00:00Added an answer on June 4, 2026 at 2:59 am
    $sql=mysql_query("INSERT INTO `user_details` (`Firstname`, `Surname`, `Email`, `Password`) VALUES ('$Firstname', '$Surname', '$Email', '$Password')")
    

    should be

    $sql=mysql_query("INSERT INTO user_details (Firstname, Surname, Email, Password) VALUES ('$Firstname', '$Surname', '$Email', '$Password')")
    

    Also

    SELECT * FROM 'user_details' WHERE Email = '$Email'
    

    should be

    SELECT * FROM user_details WHERE Email = '$Email'
    

    that’s it…

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

Sidebar

Related Questions

I have a simple user registration page in my rails app that has two
Help! I'm using the ASP.Net Login control on a Login page, but the Login
I am using php 5+,Windows, Apache server. I have a registration page createaccount.php on
I needed to create a custom select list for the user registration page that
all. I have a registration page that, well, registers users' inputted data into the
I have a standard html registration page that targets an external .asp page on
I've made a two-tab app in Appcelerator. There is a registration page within the
I am trying to find a good example that can help me to understand
I have a registration page in Dotnetnuke. I want to have a confirm email
I am running Joomla! version 1.7. I've set up a registration page in the

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.