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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:47:17+00:00 2026-06-13T05:47:17+00:00

Parse error: parse error in C:\wamp\www\Discussion Forums\login.php on line 70 Here is my code.

  • 0

Parse error: parse error in C:\wamp\www\Discussion Forums\login.php on line 70

Here is my code. By the way, I’m making a login page which has functions config (for database connectivity), header and footer page , and I use WampServer and Dreamweaver.

<?php
session_start();
require("config.php");
require("functions.php");
$db = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($dbdatabase, $db);
$db = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($dbdatabase, $db);
if($_POST['submit']) 
{
    $sql = "SELECT * FROM users WHERE username = '"
    . $_POST['username'] . "' AND password = '"
    . $_POST['password'] . "';";
    $result = mysql_query($sql);
    $numrows = mysql_num_rows($result);
    $result = mysql_query($sql);
    $numrows = mysql_num_rows($result);
    if($numrows == 1) 
        {
            $row = mysql_fetch_assoc($result);
            if($row['active'] == 1) 
                {
                    session_register("USERNAME");
                    session_register("USERID");
                    switch($_GET['ref']) 
                    {
                        case "newpost":
                        if(isset($_GET['id']) == FALSE) 
                            {
                                header("Location: " . $config_basedir .
                                "/newtopic.php");
                            }
                        else 
                            {
                                header("Location: " . $config_basedir .
                                "/newtopic.php?id=" . $_GET['id']);
                            }
                        break;
                        case "reply":
                        if(isset($_GET['id']) == FALSE) 
                            {
                                header("Location: " . $config_basedir .
                                "/newtopic.php");
                            }
                        else 
                            {
                                header("Location: " . $config_basedir .
                                "/newtopic.php?id=" . $_GET['id']);
                            }
                        break;
                        default:
                        header("Location: " . $config_basedir);
                        break;
                    }
                }
                else {
                require("header.php");
                echo "This account is not verified yet. You were emailed a link
                to verify the account. Please  click on the link in the email to
                                                        continue.";
                }
            echo "This account is not verified yet. You were emailed a link
          to verify the account. Please click on the link in the email to
          continue.";
        }
}
else {
header("Location: " . $config_basedir . "/login.php?error=1");
}
else {
require("header.php");
if($_GET['error']) {
echo "Incorrect login, please try again!";
}
}
?>
<form action="<?php echo pf_script_with_get($SCRIPT_NAME); ?>"
  method="post">
<table>
    <tr>
        <td>Username</td>
        <td><input type="text" name="username"></td>
    </tr>
    <tr>
        <td>Password</td>
        <td><input type="password" name="password"></td>
    </tr>
    <tr>
        <td></td>
        <td><input type="submit" name="submit" value="Login!"></td>
    </tr>
</table>
</form>
Don't have an account? Go and <a href="register.php">Register</a>!

<?php
 }
  require("footer.php");
?>
  • 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-13T05:47:18+00:00Added an answer on June 13, 2026 at 5:47 am

    On line number 67 use else if($somecondition) instead because in if-elseif-else can have only one else block. Also there is errors in your logic I am putting the new code it may help you.

          <?php
    session_start();
    require("config.php");
    require("functions.php");
    $db = mysql_connect($dbhost, $dbuser, $dbpassword);
    mysql_select_db($dbdatabase, $db);
    $db = mysql_connect($dbhost, $dbuser, $dbpassword);
    mysql_select_db($dbdatabase, $db);
    if($_POST['submit']) 
    {
        $sql = "SELECT * FROM users WHERE username = '"
        . $_POST['username'] . "' AND password = '"
        . $_POST['password'] . "';";
        $result = mysql_query($sql);
        $numrows = mysql_num_rows($result);
        $result = mysql_query($sql);
        $numrows = mysql_num_rows($result);
        if($numrows == 1) 
            {
                $row = mysql_fetch_assoc($result);
                if($row['active'] == 1) 
                    {
                        session_register("USERNAME");
                        session_register("USERID");
                        switch($_GET['ref']) 
                        {
                            case "newpost":
                            if(isset($_GET['id']) == FALSE) 
                                {
                                    header("Location: " . $config_basedir .
                                    "/newtopic.php");exit;
                                }
                            else 
                                {
                                    header("Location: " . $config_basedir .
                                    "/newtopic.php?id=" . $_GET['id']);exit;
                                }
                            break;
                            case "reply":
                            if(isset($_GET['id']) == FALSE) 
                                {
                                    header("Location: " . $config_basedir .
                                    "/newtopic.php");exit;
                                }
                            else 
                                {
                                    header("Location: " . $config_basedir .
                                    "/newtopic.php?id=" . $_GET['id']);exit;
                                }
                            break;
                            default:
                            header("Location: " . $config_basedir);
                            break;
                        }
                    }
                    else {
                        //require("header.php");
                            $msg = base64_encode("This account is not verified yet. You were emailed a link
                          to verify the account. Please click on the link in the email to
                          continue.");
                          header("Location: " . $config_basedir . "/login.php?msg=".$msg);exit;
                    }
                        $msg = base64_encode("This account is not verified yet. You were emailed a link
                      to verify the account. Please click on the link in the email to
                      continue.");
                      header("Location: " . $config_basedir . "/login.php?msg=".$msg);exit;
    
            }else{
                 $msg = base64_encode("You have incorrect username or password");
                      header("Location: " . $config_basedir . "/login.php?msg=".$msg);exit;
            }
    }
    
    require("header.php");
    if($_GET['msg']) {
        echo base64_decod($msg);
    }
    
    ?>
    <form action="<?php echo pf_script_with_get($SCRIPT_NAME); ?>"
      method="post">
    <table>
        <tr>
            <td>Username</td>
            <td><input type="text" name="username"></td>
        </tr>
        <tr>
            <td>Password</td>
            <td><input type="password" name="password"></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" name="submit" value="Login!"></td>
        </tr>
    </table>
    </form>
    Don't have an account? Go and <a href="register.php">Register</a>!
    
    <?php
    
      require("footer.php");
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm getting the following syntax error: Parse error: parse error in C:\wamp\www\merry_flowers\controllers\merry_parents_controller.php on line
Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in C:\wamp\www\Exam Creator\cls_FillInTheBlank.php on line 31
PHP Parse error: syntax error, unexpected ',' in /home/xxx/public_html/xxxx/index.php on line 20 Code: <?php
I am getting Parse error: syntax error, unexpected ',' in /xxx/login.php on line 28
This is the error: Parse error: syntax error, unexpected '}' in /home/idghosti/public_html/testground/mma/include/footer.php on line
Parse error: syntax error, unexpected '{', expecting '(' in /home/a7237281/public_html/include/session.php on line 313 this
I get this PHP error: Parse error: syntax error, unexpected T_VARIABLE From this line:
Parse error: syntax error, unexpected ';' in /home/realcas/public_html/eshop/ecms/system/classes/database.php on line 29 This is the
Parse error: syntax error, unexpected T_IF in view.php on line 27 I really dont
I am receiving a parse error which is this: Parse error: syntax error, unexpected

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.