Tell me, here is the login field code that redirects to the user page
echo "{status:1,txt:'profile?id=$_SESSION[id]'}";
Here is the code that is on the page that redirects to
<?php session_start(); include ("bd.php"); if (isset($_GET['id'])) {$id =$_GET['id']; } else { exit("er1!");} if (!preg_match("|^[\d]+$|", $id)) { exit("<p>bad URL</p>"); } if (!empty($_SESSION['email']) and !empty($_SESSION['password'])) { $email = $_SESSION['email']; $password = $_SESSION['password']; $result2 = mysql_query("SELECT id FROM users WHERE email='$email' AND password='$password'",$db); $myrow2 = mysql_fetch_array($result2); if (empty($myrow2['id'])) { exit("bad id!"); } } else { exit("1223!"); } $result = mysql_query("SELECT * FROM users WHERE id='$id'",$db); $myrow = mysql_fetch_array($result); if (empty($myrow['email'])) { exit("123.");} ?>
Under this condition, everything goes fine. Tell me what you need to change in the code. Here is the new code to go to the page:
echo "{status:1,txt:'id$_SESSION[id]'}";
But at the entrance to the page gives an error, and does not receive data from bd. Tell me what needs to be fixed in the code that is on the page so that it works as well as with profile? Id = 1? Thank you in advance!