Forum Moderators: coopster
Here is the setup:
1) I use PHP
2) I have a MySQL database setup.
Here is the issue:
Currently, I have a drop down menu that assigns a nme to a selection. This name is then passed to a new page via the following:
<?php print $_POST[ABC];?>
I am looking to implement a user registration process that would do one of the following:
1) either replace the <?php print $_POST[ABC];?> entirely with the user id, or
2) append the userID to the <?php print $_POST[ABC];?> command in the page that is opened.
My goal is to be able to identify a particular user when applicable, and if they have not/do not want to register, still allow them to utilize the site.
I am thinking the best way would be to have the php look for a cookie and if one does not exist (or is created via a login) then to default to the single POST[ABC] command.
Suggestions?
If you are going to get into user registration and tracking, I would encourage you to dig into session management. Sooner or later you are proabably going to want to use this type of feature and now is as good a time as any to learn about PHP's Session Handling Functions [us4.php.net].
If sessions are too much for this particular project, at least you will have a better understanding how cookies function in PHP.