Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    1
    Thanked 1 Time in 1 Post

    Parse Error in the "return header" line

    I keep getting a parse error in the "return header" line. I can not see it. Maybe you can.

    Parse error: syntax error, unexpected T_STRING in /path/file.php on line 15
    Code:
    function securityid() {
    	$urlsec = $_GET['sec'];
    	$conn = mysql_connect('localhost', 'rubeum', 'electrical0248');
        	mysql_select_db('rubeum_astronomy');
        	$sqli = "SELECT `index` FROM `security`;
        	$resulti = mysql_query($sqli, $conn);
        	$indexi  = mysql_fetch_array($resulti, MYSQL_ASSOC);
        	$indexurl = FALSE;
        	foreach ($indexi as $urlsec) {
        		$indexurl = TRUE;
        	}
        	if ($indexurl == FALSE){
        		return header("Location: http://www.site.com/index.htm");
           	}
        	mysql_close($conn);
    }

  • #2
    Regular Coder
    Join Date
    May 2007
    Posts
    100
    Thanks
    16
    Thanked 12 Times in 12 Posts
    It's the $sqli = "SELECT `index` FROM `security`; line that is probably causing the problem. No " at the end.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •