Jump to content

plz fix the error


lipun4u

Recommended Posts

What is the error in the below code ???

<?php
		if(array_key_exists_r('email|password', $_POST)) {
			include_once('database.php');
			$sql = "SELECT user_id FROM login WHERE user_name = '" . trim($_POST['email']) . 
				"' AND password='" . trim($_POST['password']) . "')";
		 	$result = mysql_query($sql);  
			print_r($result);
		 	if (mysql_num_rows($result)>0){  
		 		$row = mysql_fetch_row($result);  
				session_start();    
				$_SESSION['user_id']=$row[0];  
				$_SESSION['user_name']=trim($_POST['email']);
			}
		}
?>

Link to comment
https://forums.phpfreaks.com/topic/178600-plz-fix-the-error/
Share on other sites

A parse error often referrs to a previous line to the one indicated in the php warning (simply because it doesn't *know* there is an error until it gets to that line)

 

I can't see a "<" in the code that you posted so it is probably happening somewhere else on the page or even in database.php

 

Chris

Link to comment
https://forums.phpfreaks.com/topic/178600-plz-fix-the-error/#findComment-941955
Share on other sites

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.