Jump to content

Masna

Staff Alumni
  • Posts

    288
  • Joined

  • Last visited

Posts posted by Masna

  1. Its stupid to say tables are outdated, I personally prefer them than using just pure CSS. And yes you can DEFINATELY have PHP code in your div tags.

     

    You're one of a kind then, because everyone I know who has taken the time to learn how to correctly and effectively use purely CSS when developing a web layout has fallen in love and would never go back to using tables!

  2. $file_string = file_get_contents("saved_data.dat");
    
    $rows = explode("\n", $file_string); //if this doesn't work, try \r\n or just \r
    
    foreach($rows as $value){
         $vars = explode("|", $value);
         
         echo "<b>".$vars[0]."</b><br>";
         echo $vars[1]."<br>";
         echo $vars[2]." at ".$vars[3]."<br>";
         echo $vars[4]." at ".$vars[4]."<br>";
    }

  3. I can read and right its the formatting of read data

    parsing manually ???

     

    Well, there's no one specific way to parse data. Just come up with a format that works for this situation. Create your own key characters for splitting individual pieces of data up, and use functions like explode() to parse to usable PHP information (arrays, variables, etc).

  4. back in the back people use to

    that code above is very bad! security issues!

     

    Care to elaborate?

     

    okay... back in the day about 5-7 years ago, php nuke use to use that type of format for some of their file extentions, and I've had to clean up after their bad work because people would inject a file from their own server...

     

    let me explain how it works...

    hack code will be in file called hack.txt

    your url will read...

    http://www.site.com/page.php?template=index.php

    all I would have to do is...

    http://www.site.com/page.php?template=http://www.mysite.com/hack.txt&run=what ever code I want...

     

    its simple security issue... if you include you are including a text file which has php in it, and it works just like a regular php file on your server, leaving exploits all over the place. access to password file anything you want.

     

     

     

    ----

     

    apologize, I miss read your code, its some what security proof although not a way I would do it.

     

    LOL!

     

    Did you even read the code I posted? I didn't include whatever was filled in the appropriate $_GET variable, I used an if--else-if to check to see if whatever was filled in the appropriate $_GET variable matched one of a few various, specific cases.

     

    Pay attention, and apply what you know to situations which you encounter in life. Don't just regurgitate what you know from what has happened in potentially similar cases. It's a very easy trap to fall into. And it makes you look quite stupid.

     

    apologize, I miss read your code, its some what security proof although not a way I would do it.

     

    I appreciate the apology. And, it's completely "security proof." Why wouldn't you do it? It's organized, simple, and effective.

  5. <form action="./tester.php" method="GET">
    <div align="center">
      <select name="state" onchange="this.form.submit();">
        <option>Choose One To Submit This Form</option>
        <option value="CA"<?PHP echo ($_GET['state'] == "CA")?" selected=\"selected\"":NULL; ?>>CA</option>
        <option value="TX"<?PHP echo ($_GET['state'] == "TX")?" selected=\"selected\"":NULL; ?>>TX</option>
      </select>
    </div>
    </form>

     

    On a side note, there's usually no such thing as an "align" property. Try...

     

    <div style="margin-left: auto; margin-right: auto;">CONTENT</div>

  6. Because of how you're setting the cookies, it looks as if they'll never be set long enough to be deleted.

     

    setcookie("HCC","1",0,  "/","www.123.com",0);

     

    The third parameter here is the date of expiration as a UNIX timestamp. You have 0, so, if I'm not mistaken, the cookie is deleted as it's set.

     

    Try this:

     

    setcookie("HCC","1", time()+42000,  "/","www.123.com",0);

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