Jump to content

linuxdream

Members
  • Posts

    124
  • Joined

  • Last visited

    Never

Posts posted by linuxdream

  1. Sorry for the dumb question but I normally don't do CSS much. If you have div block and apply two classes to it, one containing a width and the other containing auto left and right margins, why won't it center the block?

     

    .width150{
        width: 150px;
    }
    
    .blockCenter{
        margin-left: auto;
        margin-right: auto;
    }
    
    <div class="width150 blockCenter">
        content here
    </div>
    

     

    It centers the block fine when I put the width and margins in one CSS class. But shouldn't it work fine separated like the above code since the width should be seen for the margins to center properly? Any help is appreciated. 

  2. Well, as long as you have some sort of header file that is included at the of each page (using the idea of one template for many looks, this is a given) then you can just parseurl() out the host portion and set it in each script. Or pass it around as a cookie or session data. This is how we use a single template for 30+ clients at my work. We actually have a function that is called automatically at the beginning of every page that automatically gets the host portion and keys everything off that. For the database side, I suppose you can have a separate DB for every "team" but you could also just as easily combine them into one big table (like data...meaning account info in one table, settings in another, etc.) and index the proper fields. Performance is good and you only have to manage a few tables in one DB instead of duplicate DB's or tables for each "team." Key them off the unique host and use that host for managing everything for that specific "team."

  3. Looks like they are simply using a standard template for the layout and custom style sheets for each "team." Something like:

     

    <?php
    $host = parse_url($_SERVER['HTTP_HOST'], PHP_URL_HOST);
    require_once('/cssdepot/' . $host . '.css');
    ?>
    

     

    placed at the beginning of the template would work to include each custom css file based on the host. You would just have each custom css file stored in /cssdepot/ named after each "team."

  4. Looks like you are simply running the same query over and over since you want the result of mysql_fetch_array in the $events, not the the method getEvents(). That will simply keep running the same query and not iterate through the result like you want. You could simply assign mysql_fetch_array($results) to a class variable and call it in place of getEvents(). That way you will have a constant value there and not a new method/SQL query each iteration...which is what you need.

  5. Push is used to "push" an element onto the end of an array.

     

    I would break up the return info.

     

    <?php
    ....
    $text = "";
    foreach($menu as $item){
        $text .= "jsmenu.push($item)\n";
    }
    return $text; //$text will have all the js push items to be echo'd out later
    ?>
    

     

    Adding whatever tags you need before or after the foreach results in $text. That would work better (and is more readable) than your previous return.

  6. By default, I believe PHP passes the session id as a cookie (your problem) but then tries to pass the session id in the URL if cookies are not enabled. Not sure why it wouldn't work, but you might want to check your server's php.ini config file to see if for some reason only cookie based session handling is being supported. Maybe you can enable session handling through the URL.

  7. PHP only processes on the server side so you can't expect it to process through javascript unless you submit the form again or use AJAX. Your rand_pass() must be javascript to be used in this case...or else it only gets used once (as is the problem you are experiencing). Otherwise, you will have to submit the form and reload the page...or use AJAX.

  8. It is but you have to be a bit more precise in the definition...

     

    <?php
    $menu = array('apple', 'banana', 'peach');
    echo "<script>\n";
    echo "var jsmenu = new Array();\n";
    foreach($menu as $item){
        echo "jsmenu.push($item)\n";
    }
    echo "</script>";
    ?>

     

    Should work...

  9. SSL in Apache is different from SSL in PHP. Did you read the page that you posted??

     

    Note to Win32 Users:  In order for this extension to work, there are DLL files that must be available to the Windows system PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying DLL files from the PHP folder into the Windows system directory also works (because the system directory is by default in the systems PATH), it is not recommended. This extension requires the following files to be in the PATH: libeay32.dll 

     

    So, you need to install SSL under Windows and be sure the DLL's are in your path. No clue how to do this since I work in Linux.

  10. try a print_r($reason); above the <select> to be sure the variable is getting there and what the contents are. If that doesn't work, then start with the print_r in the require page...then keep moving it farther away (closer to your <select>)until you discover where the problem is.

  11. You don't need to know the structure...you can jump directly to VALUES if each value corresponds to your table structure. Try enclosing the $table in '{$table}' instead. You don't really need the 's there unless you have a weird table name. So try {$table} too..

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