Answer the question
In order to leave comments, you need to log in
A person has registered on the site and needs to be redirected to his profile, how to do this?
Here I have, for example, such a link: mysite.com/profile.php?id= <== This is where the user id should be. In the index.php file I wrote this + profile.php?id="$id_user" but it didn't work. What to do?
Answer the question
In order to leave comments, you need to log in
header("Location: /profile.php?user_id=" . mysql_insert_id());
mysql_insert_id
= id of the last registered user. If you have an id column with a primary key, of course
When registering, find out the ID created for him to rederick:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question