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 8626285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:59:19+00:00 2026-06-12T07:59:19+00:00

<?php include_once(scripts/global.php); if(isset($_POST[username])){ $username = $_POST[username]; $fname = $_POST[fname]; $lname = $_POST[lname]; $email =

  • 0
<?php include_once("scripts/global.php");
if(isset($_POST["username"])){

    $username = $_POST["username"];
    $fname = $_POST["fname"];
    $lname = $_POST["lname"];
    $email = $_POST["email"];
    $pass1 = $_POST["pass1"];
    $pass2 = $_POST["pass2"];

    //error handling
    if((!$username)||(!$fname)||(!$lname)||(!$email)||(!$pass1)||(!$pass2)){
        $message ="Please insert all the fields!!"; 
    }else {
        if($pass1!=$pass2){
            $message="Your password fields do not match!!";
        }else{
            //securing the data
            $username = preg_replace("#[^0-9a-z]#i","",$username);
            $fname = preg_replace("#[^0-9a-z]#i","",$fname);
            $lname = preg_replace("#[^0-9a-z]#i","",$lname);
            $pass1 = sha1($pass1);

            $email = mysql_real_escape_string($email);
            //check the duplicates
            $user_query = mysql_query("SELECT username FROM members WHERE username='$username' LIMIT 1") or die("Could Not check username");
            $count_username = mysql_num_rows($user_query);

            $email_query = mysql_query("SELECT email FROM members WHERE email='$email' LIMIT 1") or die("Could Not check email");
            $count_email = mysql_num_rows($email_query);
            if($count_username>0){
                $message = "your username is already in use!!";
            }else if($count_email>0){
                $message = "Your email is already in use!!";
            }else{
                //insert the members
                $ip_address = $_SERVER['REMOTE_ADDR'];
                $query =mysql_query("INSERT INTO members(username,firstname,lastname,email,password,ip_address,sign_up_date) VALUES('$username','$firstname','$lastname','$email','$pass1','$ip_iddress',now())") or die(mysql_error());

                $member_id = mysql_insert_id();
                mkdir("users/$member_id",0755);
                $message="You Have been registered";
            }
        }
    }

?>

I get a syntax error in DW a I run the file in localhost..as when i include the message variable in the paragraph tags in my HTML code:

<p><?php print("$message");?></p>
  • 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-12T07:59:20+00:00Added an answer on June 12, 2026 at 7:59 am

    You forgot the bracket } at the end of your script

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

Sidebar

Related Questions

<?php include_once('db.php'); $location = $_POST['location']; $doctor = $_POST['doctor']; $patient_id = $_POST['patient_id']; if(($location != )
I have two PHP scripts which both have an include_once('authentication.inc'); script near the top.
Is it more efficient to use PHP's include_once or require_once instead of using a
I have the following code: if (include_once(dirname(__FILE__).'/file.php') || include_once(dirname(__FILE__).'/local/file.php') ) { This causes an
When I try to include a file using include_once in php which shows warning
Php novice. 1.Is there anything wrong with this PHP & MySQL code? include_once db_login.php
I have a page with a list of items initially loaded from a include_once('show_calendarV2.php');
<?php ini_set('display_errors',1); error_reporting(E_ALL); require_once('/include/adLDAP.php'); $adldap = new adLDAP(); $username = user123; $password = pass123;
I have a global.php file that I call from the top of every script.
I have two scripts that I call with two PHP include() calls. The first

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.