We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,586 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

error in include statment

<?php
    //if user hit sumbit
    //check if field are not empty
    if(isset($_POST["username"]) && isset($_POST["password"]))
    {
        $manager = preg_replace(#[^A-Za-z0-9#i',",$_SESSION["username"]]);  
        $password = preg_replace(#[^A-Za-z0-9#i',",$_SESSION["password"]]);

        include "../storescript/connect_to_mysql.php";

        $sql = mysql_query("SELECT id FROM admin WHERE username='$manger' AND password='$password' LIMIT 1");

        //make sure person exists in database---
        $existCount = mysql_num_rows($sql); //count the row num
        if($existCount == 1) //make sure name is only one in database
        {
            while($row = mysql_fetch_array($sql))
            {
                $id = $row["id"];
            }
        }....?>

Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\E-COMMERCE\admin\admin_login.php on line 20
line 20 is include "../storescript/co.....";

2
Contributors
2
Replies
9 Hours
Discussion Span
7 Months Ago
Last Updated
3
Views
Question
Answered
hwoarang69
Posting Pro
569 posts since Feb 2012
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 8

$manager = preg_replace(#[^A-Za-z0-9#i',",$_SESSION["username"]]); // Single Quotes are closed but not opened. CHECK!
$password = preg_replace(#[^A-Za-z0-9#i',",$_SESSION["password"]]);// Same thing as per previous line. Single Quotes Closed but not Opened

SagarSe7en
Junior Poster
141 posts since Jul 2011
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0

got it thanks

hwoarang69
Posting Pro
569 posts since Feb 2012
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 8
Question Answered as of 7 Months Ago by SagarSe7en

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0598 seconds using 2.66MB