Are you calling session_start anywhere?
dcdruck
Junior Poster in Training
89 posts since Jul 2009
Reputation Points: 21
Solved Threads: 20
Skill Endorsements: 0
I had a similar problem but it was due to something like not adding: ifisset
$user = if(isset($_POST['username']))
$pass = if(isset($_POST['password']))
have you tried turning on all errors to see what may be causing the problem.
error_reporting(E_ALL);
mbhanley
Junior Poster in Training
51 posts since Nov 2010
Reputation Points: 10
Solved Threads: 3
Skill Endorsements: 0
Please mark as solved, it still shows as open thread in forum, thanx.
AndreRet
Industrious Poster
4,706 posts since Jan 2008
Reputation Points: 391
Solved Threads: 481
Skill Endorsements: 20
SQL injection is indeed a problem, however, as opposed to using mysql_* functions, you should give serious thought to moving across to mysqli_* or PDO. mysql_* has an uncertain future. The benefits of PDO for example is that you can apply parameterized queries:
$st = $db->prepare("SELECT field3, field4 FROM table WHERE field1 = :f1 AND field2 = :f2");
$st->execute(array(':f1'=>$var1, ':f2'=>var2));
That does away with all the escaping routines.
diafol
Keep Smiling
10,848 posts since Oct 2006
Reputation Points: 1,675
Solved Threads: 1,539
Skill Endorsements: 61
To expand upon what diafol said, PDO also provides a layer of abstraction to the database so that you can change DBMSs in the future without having to rewrite all of your querying code.
dcdruck
Junior Poster in Training
89 posts since Jul 2009
Reputation Points: 21
Solved Threads: 20
Skill Endorsements: 0
Question Answered as of 7 Months Ago by
dcdruck,
AndreRet,
Zagga
and 3 others
@tesha29
Please start a new thread - do not hijack this solved thread.
Better still, search this site as I remember this coming up many times in the past.
diafol
Keep Smiling
10,848 posts since Oct 2006
Reputation Points: 1,675
Solved Threads: 1,539
Skill Endorsements: 61