Transfer/Import Cookie Infomation from one MySQL Table to Another using a Form in PHP

Discussion in 'Programming' started by SalientAnimal, Jun 10, 2010.

  1. #1
    Hi Everyone,

    I am hoping that someone can help me here, I have looked all over for solutions but I haven't come up with a solution that works.

    I have a PHP website that uses a login feature (Users are Authenticated against a MySQL Database named userinfo) and then forms are submitted and the information is written to a MySQL databse using PHP.

    Here is a basic structure of my Userinfo table in my database(attached)

    I would like to have the ID field from the attached table populated into the table of the form that is being submitted so as to be able to track user activity.

    A friend of mine supplied me with the following piece of ode to use at the top of each of my pages, but I am not able to get it to work correctly. PLEASE CAN SOMEONE HELP ME

    <?php
          if (isset($_COOKIE["user"]))
          {
                      setcookie("user",$_COOKIE["user"],time()+3600);
                      $admin = 1;
          } else {
          $_COOKIE["user"];
          }
          
          $user = $_COOKIE["user"];
    ?>
    
    PHP:
    Please let me know if I need to supply additional information, or what information you need from me.
     

    Attached Files:

    Last edited: Jun 10, 2010
    SalientAnimal, Jun 10, 2010 IP