Jump to content

[SOLVED] Unexpected T_STRING


elite_prodigy

Recommended Posts

Parse error: syntax error, unexpected T_STRING in /home/expose/public_html/exposeyourschool.co.cc/acp_design_proj/login.php on line 2

<?php
session_start();
if(isset($_SESSION[username]) && isset($_SESSION[id])){

echo $null_var1;

}
else{
header("location:login.php");

}

?>

 

Link to comment
https://forums.phpfreaks.com/topic/100373-solved-unexpected-t_string/
Share on other sites

<?php
mysql_connect('localhost, '******', '******')or die(mysql_error()."<br /><br /><h3>An error occurred whille attempting to log you in</h3>"); 
mysql_select_db('expose_expose') or die("cannot select DB");

// username and password sent from form 
$username=$_POST['user']; 
$password=$_POST['pass']; 

$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);

There it is:

 

<?php
mysql_connect('localhost', '******', '******')or die(mysql_error()."<br /><br /><h3>An error occurred whille attempting to log you in</h3>"); 
mysql_select_db('expose_expose') or die("cannot select DB");

// username and password sent from form 
$username=$_POST['user']; 
$password=$_POST['pass']; 

$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);

 

Need the single quote after localhost

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.