Jump to content

BK87

Members
  • Posts

    147
  • Joined

  • Last visited

Posts posted by BK87

  1. mime is plenty enough... plus someone injecting code into an image file, is not unreal, but chances of it actually being run are almost none... I mean if you coding runs the image file through bash then your code is horrible. 

  2. <?
    $str = '<statex refid="ALRdi335-14">, which means Alabama Regulations, Division 335-14</statex>';
    preg_match("/<statex refid=\"(.*)\">/",$str,$out);
    echo $out[1];
    ?>
    

     

    this will display the actual "id" in refid tag. since we already know how it will come out...

  3. replace.

    $image_p = imagecreatetruecolor($thumbsize, $thumbsize);

     

    to

     

    if($height>$thumbsize){$height=$thumbsize;}

    $image_p = imagecreatetruecolor($width, $height);

     

    because resize scripts use ratio resizing, so width will be 100

     

     

    that means, if height of avatar is 50px then it will remain 50px and your image that your are making with php is going to be 50px not 100px... I don't see a way around thing with jpg.  if you mandated png or gif, you could make it transparent.

  4. use mysql...

     

    mysql_query("update online_counter set stime=CURRENT_TIMESTAMP where username='Joe'");

    thats to update... this has to execute each time a page loads to update user status...

     

    when displaying user status cross check with db

     

    $query=mysql_query("select username from online_counter where username='Joe' and stime > CURRENT_TIMESTAMP - interval 15 minute");

    $row=mysql_fetch_array($query);

    if($row["username"]!=NULL){ echo "user online"; } else{ echo "user offline"; }

     

     

    *** not tested technically should work

     

  5. the only down site to that, is if user accesses the edit page without going to the "paging" system it will screw things up... so maybe you'd want to make a check to see if they actually came from looking at pictures in the first place, rather than entering it in the url

  6. dude lol easy stuff here lol

     

    okay.  user click a link to edit image or something right?

     

    so...

    <form action=save.php method=post>

    <input type=hidden name=url value="<?= $_SERVER["HTTP_REFERER"]; ?>">

    more input forms or w/e...

    <input type=submit>

    </form>

     

    save.php should have

    <?

    //code for saving changes to your image modifications... then

    header("Location: ".$_POST["url"]);

    die;

    ?>

    end of story

     

    also by you saying original page, do you mean page 1 or the page 6 that user was on?

  7. for true user online, you would need to update the db each time a page loads to the perticular user... because just because you changed "online" to 1 (for logged in) dosen't mean that if I close my web browser I will get logged out in 10-20 mins.

     

     

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