No idea about those unless you can show the lines that they relate to, and a few lines before them.
the main problem is after verify password fetch first name based on email and password
Is this anything to do with the filename? Perhaps your local system deals with %20- in a different way to your live system, or perhaps the live is case-sensitive and the local is not?
As before, though, it looks like youâre trying to use the results of a query without checking whether the query (or something before it) worked. Youâre passing a results object into something, and the results object is null, hence the error.
Iâm confused by this code. You seem to set $first_name twice, once via trim() and then, on the next line, without the trim(). Then you re-assign it back into the $row array for some reason. All of this is after youâve redirected to another page.
Then on the second page, you are accessing the $_POST array. Is this because itâs a form submission from somewhere else? If itâs from your redirect in the first page code, then $_POST wonât exist (which you should check for) because youâve just done a redirect, not a HTTP POST.
On the second page again, you set a session variable to $first_name, but you havenât defined that anywhere, unless you have missed that out for the post. You also didnât include it in the query.
put in code that so i can try
<?php
$mysqli = new mysqli("");
/* check connection */
if ($mysqli->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error);
exit();
}
$query = "SELECT first_name FROM users where email = '".$email."'";
if ($result = $mysqli->query($query)) {
/* fetch associative array */
while ($row = $result->fetch_assoc()) {
echo $row["first_name"];
$_SESSION['reply'] = $row['from'];
$username2 = $_SESSION['reply'];`
}
/* free result set */
$result->free();
}
/* close connection */
$mysqli->close();
?>
I have an error here where is $mysqli->close(); any help
Do you want to give us a clue as to what the error actually says?
i fixed maybe will be another problem how if someone click paypal button send on email confirmation.
This bit wonât be right, surely?
$_SESSION['reply'] = $row['from'];
You donât retrieve that column in your query.
echo $_SESSION[âfirst_nameâ] = $row[first_name];
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.