开发者

Parse error: syntax error, unexpected T_STRING on line 26 [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago.

Hello im having an issue with my code:

<?php

s开发者_StackOverflowession_start();

$host="localhost"; 
$username="root"; 
$password="power1"; 
$db_name="members"; 
$tbl_name="users";

$link  = mysql_connect($host, $username, $password)or die("cannot connect. Please contact us");
mysql_select_db($db_name)or die("cannot select DB. Please contact us");

$queryString = $_SERVER['QUERY_STRING'];

$uemail = $_SESSION['$queryString'];

$query = "SELECT * FROM users WHERE email='$uemail'";

$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result)){

if ($queryString == $row[activationkey]){

   echo "Congratulations! You have succesfully activated you account. You may now login.";

   $sql=("UPDATE users SET activationkey='' AND status='activated' WHERE username=".$row['username']);

   if (!mysql_query($sql))

{

    die('Error: ' . mysql_error());

}

    }

        }
?>

What do you think the issue is? Thanks


You are not closing a quote here:

$query = "SELECT * FROM users WHERE email=$uemail;

Replace it with:

$query = "SELECT * FROM users WHERE email='$uemail'";


$query = "SELECT * FROM users WHERE email=$uemail;

There is a double quote missing

$query = "SELECT * FROM users WHERE email='$uemail'";

Remember to escape all your parameters used in your sql statements!


You forgot to terminate this line with a quote

$query = "SELECT * FROM users WHERE email=$uemail;


$query = "SELECT * FROM users WHERE email='".$uemail."'";
$sql = ("UPDATE users SET activationkey='' AND status='activated' WHERE username='".$row['username']."'");

Remember to put single ' or double " quotes at start and end of the val where datatype is varchar

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜