Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by PFMaBiSmAd

  1. Both of these are just recommendations.

    For question #1 - having multiple mail servers, in the context of your DNS setup, refers to receiving mail servers and their MX records. Each MX record has a priority number. Sending mail servers get all the MX records and attempt to make contact with the receiving mail servers in the order of their priority (I think the lower the number, the higher the priority.) The MX record is not used when connecting using a mail client (you enter the mail server host name/IP address directly in the settings in the client.) If you did have more than one mail server (primary/backup), the backup would typically only cache mail and forward it to the primary whenever the primary is online. If you needed to connect to the second mail server using a client program, you would need to setup a second account in the client with the settings for that mail server.

    For question #2 - this is just a recommendation from a reliability/single-point failure standpoint.
  2. Sessions can be configured to persist when a browser is closed (session.cookie_lifetime and the gc parameters) but to remember if someone is logged in, just use a cookie.

    However, the cookie must contain a unique value for each user that is encrypted/hashed to avoid reverse engineering. It sounds like your previous attempt just stored the username and editing the name in the cookie file allowed someone to appear to be that user?
  3. Windows cannot create or rename a file that starts with a dot, but you can edit an existing file by that name. Either find an existing .htaccess file and edit it with your desired contents, or you can create a file with some other name/extension and use PHP to rename the file -
    [code]<?php
    $source = "htaccess.txt";
    $dest = ".htaccess";

    rename( $source, $dest) or die("could not rename");

    ?>[/code]
  4. Your form produces -
    [code]<input type = "checkbox" name = "option_select0" value="1">Air Conditioning
    <input type = "checkbox" name = "option_select1" value="2">Automatic Transmission
    <input type = "checkbox" name = "option_select2" value="5">Navigation System[/code]
    For this to work -
    $_SESSION['OptionID0'] would need to be 1
    $_SESSION['OptionID1'] would need to be 2
    $_SESSION['OptionID2'] would need to be 5

    Either the values don't match or the $_SESSION variables are not getting set. In the form code, you can use the following to display all the session variables -
    [code]<?php
    echo "<pre>";
    print_r($_SESSION);
    echo "</pre>";
    ?>[/code]
    Beyond this, you would need to post your form processing code that sets the $_SESSSION variables for the option checkboxes.
  5. The following code works for me -
    [code]<?php
    session_start();
    $_SESSION['OptionID0'] = 1;
    echo "direct: {$_SESSION['OptionID0']}<br />";
    $index = 'OptionID0';
    echo "var index: {$_SESSION[$index]}<br />";

    $OptionID = 1;
    if($OptionID == $_SESSION[$index])
    {
    echo '$OptionID is = to $_SESSION[$index]<br />';
    }
    ?>[/code]thorpe beat me to it, but post the actual code you are using that gives a blank output.
×
×
  • 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.