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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:01:37+00:00 2026-05-11T17:01:37+00:00

Parse error: syntax error, unexpected $end in blah/blah/blah.php line 1 This is the error

  • 0

Parse error: syntax error, unexpected $end in blah/blah/blah.php line 1

This is the error that I receive, with this code

<?php 
include("db.php");

if (isset($_POST['username']) && 
    isset($_POST['password']) && 
    isset($_POST['email']))
{
  //Prevent SQL injections
  $username = mysql_real_escape_string($_POST['username']);
  $email = mysql_real_escape_string($_POST['email']);

  //Get MD5 hash of password
  $password = md5($_POST['password']);

  //Check to see if username exists
  $sql = mysql_query("SELECT username FROM usersystem WHERE username = 'username'");

  if (mysql_num_rows($s > 0))
  {
    die ("Username taken.");
  }

  mysql_query("INSERT INTO usersystem (username, password, email) VALUES ( '$username', '$password', '$email')") 
    or die (mysql_error()); echo "Account created.";
}
?>

I’ve already checked for unclosed brackets, that’s not the problem. Also by troubleshooting with it, I’ve discovered that the include(“db.php”); is causing the problem. When I comment it out, It loads the page just fine. However even when db.php is completely blank, just an empty .php file it still gives me the same error. I’m perplexed. Anyone have any ideas?

here is my db.php file, but honestly when I make db.php completely blank I get the same error. And I am saving it correctly.

<?php
session_start();
mysql_connect("localhost", "mydatabase", "mypassword");
mysql_select_db("ratherda_jetpackfandango");

function user_login ($username, $password)
{
  //take the username and prevent SQL injections
  //$username = mysql_real_escape_string($username);

  //begin the query
  $sql = mysql_query("SELECT * FROM user WHERE username = 'username' AND password = 'password' LIMIT 1");

  //check to see how many rows were returned
  $rows = mysql_num_rows($sql);

  if ($rows<=0 )
  {
    echo "Incorrect username/password";
  }
  else
  {
    //have them logged in
    $_SESSION['username'] = $username;
  }    
}
?>
  • 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-05-11T17:01:37+00:00Added an answer on May 11, 2026 at 5:01 pm

    You have a session_start in db.php thats not allowed there. It should be the first line in blah.php.

    <?php
    
    session_start();
     
    require_once("db.php");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 182k
  • Answers 182k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The point is that Grid in WPF is defined to… May 12, 2026 at 4:29 pm
  • Editorial Team
    Editorial Team added an answer The answer to this is platform-specific; what happens on Linux… May 12, 2026 at 4:29 pm
  • Editorial Team
    Editorial Team added an answer You could do it two different ways : In your… May 12, 2026 at 4:29 pm

Related Questions

The following code: <?php if ($_SERVER['REQUEST_METHOD'] != 'POST'){ $self = $_SERVER['PHP_SELF']; ?> Generates this
This is the error: Parse error: syntax error, unexpected '}' in /home/idghosti/public_html/testground/mma/include/footer.php on line
I am getting the following error: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION
A friend of mine is getting this error on ALL of her websites. They

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.