Jump to content

J.Daniels

Members
  • Posts

    143
  • Joined

  • Last visited

    Never

Posts posted by J.Daniels

  1. You can also just send a no cache header on your login page.  This will cause the page to refresh every time it is visited.

     

    <?php
        header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
        header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    ?>

     

    Taken from the PHP Manual

     

  2. If each url is followed by a <br>, you can explode by the <br>, then loop through the array to add it back in with the number:

     

    $linksArray = explode('<br>', $links);
    $counter = 1;
    $result = '';
    
    foreach ($linksArray as $l) {
        $result .= $l . '<br> ' . $counter . ' ';
        $counter++;
    }

  3. What version of MySQL are you using?  Version 5 is picker about the default int definitions.

     

    Try changing tables.sql to this:

     

    #
    # Table structure for table `groups`
    #
    
    CREATE TABLE `groups` (
      `groupid` varchar(10) NOT NULL default '',
      `gid` int(10) unsigned NOT NULL auto_increment,
      `members` varchar(255) NOT NULL default '',
      PRIMARY KEY  (`gid`)
    ) TYPE=InnoDB ;
    
    #
    # Table structure for table `users`
    #
    
    CREATE TABLE `users` (
      `id` smallint(2) NOT NULL auto_increment,
      `userid` varchar(10) NOT NULL default '',
      `uid` int(10) unsigned NOT NULL default 0,
      `gid` int(10) unsigned NOT NULL default 0,
      `passwd` varchar(255) NOT NULL default '',
      `homedir` varchar(255) NOT NULL default '',
      `comment` varchar(255) NOT NULL default '',
      `disabled` int(10) unsigned NOT NULL default '0',
      `shell` varchar(20) NOT NULL default '/sbin/nologin',
      `email` varchar(255) NOT NULL default '',
      `name` varchar(255) NOT NULL default '',
      `ul_bytes` bigint(20) NOT NULL default 0,
      `dl_bytes` bigint(20) NOT NULL default 0,
      `login_count` bigint(20) NOT NULL default 0,
      `dl_count` bigint(20) NOT NULL default 0,
      `ul_count` bigint(20) NOT NULL default 0,
      `last_login` datetime default NULL,
      PRIMARY KEY  (`id`)
    ) TYPE=InnoDB ;

  4. This may be the start of your problem.

     

    <div id="bkOpt">
    <table width="720" cellpadding="0" cellspacing="0" border="0">
    <tr>
       <td colspan="2"><h3>Tom/Bass/Kick Drum Options</h3></td>
    </tr>
    <tr>
       <td valign="top" colspan="2" align="left" width="100%" class="r3">Tom/Bass Upgrades</td>
    </tr>
    <tr>
       <td>No Upgrades Chosen</td>
    </tr>
    </table>
    
    </tr>

     

    You have an opening div, a full table, then a closing </tr>.  If I change it to:

     

    <div id="bkOpt">
    <table width="720" cellpadding="0" cellspacing="0" border="0">
    <tr>
       <td colspan="2"><h3>Tom/Bass/Kick Drum Options</h3></td>
    </tr>
    <tr>
       <td valign="top" colspan="2" align="left" width="100%" class="r3">Tom/Bass Upgrades</td>
    </tr>
    <tr>
       <td>No Upgrades Chosen</td>
    </tr>
    </table>
    
    <table>

     

    then it works as expected.

     

    Try validating your code through the W3C validator

  5. The problem with your switch statement is that if complexfunction() is false, do y; won't execute.

     

       if ($a && complexandtimeconsumingfunction()) {
          do x;
       } else {
          do y;
       }

     

    This will work because if $a is false, it will not continue with the second part of the conditional.

  6. +randomize the name of the field, store it in the session so that it's harder to scrape (source code)

     

    This is similar to what xtopolis said, You can create a generated token from the form page, and pass it in a hidden field to the processing page.  This will at least disable any outside form from submitting.  If the page is loaded then scraped, it's difficult to determine whether it was loaded by a human or script without some type of captcha.

  7. If you don't want to search the product description, I believe you just need to take it out of the MATCH function:

     

    if ($indcount == 0) {
        $sql = "SELECT *, ( (1.3 * (MATCH(prodName) AGAINST (".quote_smart($pluspieces)." IN BOOLEAN MODE))) + (0.6 * (MATCH(merchant,prodCategory,prodBrand) AGAINST (".quote_smart($pluspieces)." IN BOOLEAN MODE))) ) AS relevance FROM affiliSt_products1 WHERE ( MATCH(prodName,merchant,prodCategory,prodBrand) AGAINST (".quote_smart($pluspieces)." IN BOOLEAN MODE) ) HAVING relevance > 0 AND dbProdID != '".$pDetails['dbProdID']."' ORDER BY relevance DESC LIMIT 0, ".$maxRows_product."";
    } else {
        $sql = "SELECT * FROM affiliSt_products1 WHERE MATCH (prodName,prodBrand,prodCategory) AGAINST (".quote_smart($pluspieces).") AND dbProdID != '".$pDetails['dbProdID']."' LIMIT 0, ".$maxRows_product."";
    }

  8. It may be because of the parent nav container, since the width is set to 125px.

     

    When I moved the "salad" container above:

     

    <div id="wrapper">
        <div id="salad">
            <div id="lettuce"> </div>
            <div class="content">Tip of the day: This will not contain tips of the day.</div>
        </div>
        <div id="nav">
            <div id="logo"></div>
        ...

     

    it appears to render the way you want.

     

  9. The directories would have to be owned by the apache process to lower the permissions.  If you can't change the owner, a more secure way would be to store the directory outside of the DocumentRoot tree, and use PHP to read in the images.

     

    If you only have access through FTP, a quick google search for recursive chmod ftp client shows that FileZilla supports it.  I don't have any experience with how well it works though.

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