Jump to content

marcus

Members
  • Posts

    1,842
  • Joined

  • Last visited

Posts posted by marcus

  1. I have recently started a new website and a lot of the content is based off subdomains.

     

    How would I use session_set_cookie_params to make it so it basically makes the session valid throughout all the subdomains.

     

    I have:

     

    session_set_cookie_params(10800,'/','.mysite.com/',true);
    session_start();
    

     

    On every page.

  2. $sql = "SELECT * FROM `table` WHERE `this`='that'";
    $res = mysql_query($sql) or die(mysql_error());
    
    if(mysql_num_rows($res) == 0){ $bounce = 1; }
    
    if($bounce === 1){
    header("Location: thisorthat.php");
    }else {
    $row = mysql_fetch_assoc($res);
    //etc...
    }
    

  3. When posting the form check to see if the value of the selection is one of the valid ones.

     

    So if you're using a SQL query:

     

    $sel = $_POST['sel'];
    
    if($sel){
    $sql = "SELECT * FROM `table` WHERE `this`='$sel'";
    $res = mysql_query($sql) or die(mysql_error());
       if(mysql_num_rows($res) == 0){
       echo "Doesn't exist";
       }else {
       echo "Exists";
       }
    }
    

×
×
  • 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.