Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Posts posted by fugix

  1. As fugix says,

     

     

    Store the values in a database, after inserting, set a COOKIE with the ID of the entry or create your own Id's. Using sessions is not recommended as they are destroyed on session closure (browser closure).. Cookies can also be removed so it may not be possible to store it for 2 weeks for everyone.

     

     

    It is dependant on the users preferences, but the method explained will work.

     

     

    George.

    right, and upon the destruction of the cookie after 2 weeks...simply set a delete clause to delete the row where the information is stored

  2. Apologies.

     

     

    Always use long tags..

     

     

    My team of developers work on our servers with short tags enabled.

     

     

    George.

    not a problem at all...most people dont have them enabled, so just to avoid further errors...anyway jmahdi what do you receive when you try to echo $_SESSION['valid_user']; in your footer?

  3. Set the session at the top of the webpage before the <html> tag.

     

     

    For example

     

     

    <?
    //Start Sessions
    session_start();
    
    
    //Set Session
    $_SESSION['valid_user'] = "john.doe";
    
    
    //Assign Session to Variable
    $username = $_SESSION['valid_user'];
    ?>
    <html>
    
    
    <head>
    </head>
    
    
    <body>
    
    
    <!-- RUN CHECKS HERE, for example -->
    <? mysql_query("SELECT * FROM credit WHERE username='$username'");  ?>
    <!-- END -->
    
    
    <!-- FOOTER HERE -->
    <? echo "You are logged in as $username"; ?>
    
    
    </body>
    
    
    </html>
    

     

     

    That is how I do it most of the time. But set the sessions in an external document and call that into the current HTML page above the HTML tag to stop you having to change each individual file where a change is needed.

     

     

    Like this :

     

     

    
    
    <? include_once "./includes/scripts/sessions.inc.php"; ?> 
    <html>
    <head></head>
    <body></body>
    </html>
    
    
    

     

     

    Did this help?

     

     

    George.

    exept get into the habit of using long tags...<?php

  4. it's impossabe to tell from the information given if the sequencing is off on entry or return.  MySQL does not automaticly return information in a set order, you need to use the "order by" clause for that - Try appending ORDER BY id at the end of the SELECT query and see what happens.

    if that is what his table looks like then the data is being inserted that way...I had a similar problem before but it was due to the fact that i thought that I had auto-increment on when in fact i didnt..this has me confused

  5. if($var = null)  ?

     

    No matter what the value of $var is, that will return TRUE.

     

    Correction: no matter what the value of $var is, that will return FALSE. *stalks*

    Lol. Salathe you're a funny guy. In my original post I was simply trying to correct his if statement.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.