Jump to content

Caesar

Members
  • Posts

    1,025
  • Joined

  • Last visited

    Never

Posts posted by Caesar

  1. Front Page may make it so that you don't have to put much thought into what you're doing...but it generates invalid code that does not adhere to web standards and does not display the same across the different browsers.

     

    And to answer your question....PHP and Frontpage are not friends.

  2. <?php
    
    while($infoc = mysql_fetch_assoc( $resultc ))
    {
    
      if(($infob['amount'] != '') && ($infoc['name'] != '')) {
        echo "<tr>"; 
        echo "<td>".$infob['amount'] . " ".$infoc['name'] . " </td> ";
      }
    
    } 
    echo "</font>";
    echo "</table>";
    
    ?>

  3. Yeash...I havent looked at it in detail but as far as the extra parantheses goes...highlighted it for you...

     

    if(preg_match('/\A(?:[a-zA-Z0-9]!#$%&\'*+\/=?^_`{|}~-])+(?:\.[a-zA-Z0-9]!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?\.))+(?:[a-zA-Z]{2}|com|org|net\b)\Z/i',$email))

     

     

  4. Yeah...this is more of a PHP troubleshooting forum. Though I commend you on looking into CSS. As it is much much better to use CSS/DIVs (Some occasional use of tables..properly structured using correct syntax isn't a bad thing) with clean designs.

     

    Firstly, there's nothing wrong with Tables...

     

    I wrote a paper about it.

     

    JAWS is one of the most popular screen readers and their website uses tables, so it's really not a problem provided that you use them properly.

     

    Their site also fails validation :P

     

    http://validator.w3.org/check?uri=http%3A%2F%2Fwww.freedomscientific.com%2Ffs_products%2Fsoftware_jaws.asp

    http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.freedomscientific.com%2Ffs_products%2Fsoftware_jaws.asp&warning=1&profile=css21&usermedium=all

     

    May work...but for any commercial entity, it looks pretty unprofessional to not write clean code that validates. It also looks like it was designed in 1997. LOL. No offense. Continue...

  5. Does this yield different results.....

     

    <?php
    
    
      if ($row[health_safety] == 'Yes' || $row[investigator] == 'Yes')
      {
      echo "hello";
      }
    
        else
        {
         echo "I hate your face. Die.";
         exit;
         }
    
    ?>

     

    Also...you did print out the values to see if they were outputting 'Yes' or 'No', right?

  6. A simplification...

     

    <?php
    
      $usrip = $_SERVER['REMOTE_ADDR'];
      $usrname = $_SESSION['username'];
    
      $banlist = file_get_contents('banlist.txt');
    
        if((preg_match('/'.$usrip.'/i', $banlist)) || (preg_match('/'.$usrname.'/i', $banlist)) || ($_COOKIE['banned'] == '1')) 
        {
          header("Location: index.php?notice=banned");
          exit;
        }
    
    ?>

     

    And in index.php you set your cookie.

     

    And sure...they can clear their cookies. But every time they get banned...they have to take extra steps to get to your site. At that point, they have to start wondering what the hell they're doing with their spare time. They've got issues. :-P

  7. But in some cases...it helps as a deterrent. I say do both username and IP bans....and store it in a cookie as an additional step...just an extra step to annoy them more. The method depends on how you're storing the banned users...MySQL database? Flat file?

  8. Why not make it simple and redirect them?...or even display the content only if they are a certain user level?

     

    <?php
    
      echo'
      <html>
      <head>
    
      <title>Blah blah blah</title>
      </head>
    
      <body>';
    
        if($_SESSION['admin'] == 1) {
          //Load admin content
        }
    
      echo'
      </body>
      </html>';
    
    ?>

     

  9. Not sure what you mean by that...my example was showing that you can determine what error they made so that you can then use a conditional statement to echo out a notice in the page they are redirected to.

     

    Example...

     

    <?php
    
    
        if(isset($_GET['error'])) {
    
        $error = $_GET['error'];
          
          if($error == 'wronguser') {
            echo'You did not enter the correct username';
          }
    
          if($error == 'wrongpass') {
            echo'You did not enter the correct password';
          }
    
        }
    
    ?>

     

    Etc...etc. You can of course use swirches...or in fact...use a different approach altogether...but the point was, you can't echo out something and then output the header.

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