Jump to content

only one

Members
  • Posts

    437
  • Joined

  • Last visited

    Never

Posts posted by only one

  1. oh i see,

     

    make a new table in youre database, now on the upload page sotre the infromation, like the link (most important) now just give a link just echo all the links and you can return the urls

     

    mysql_query("INSERT INTO table(`url`) VALUES('uploads/".$HTTP_POST_FILES[file name][file type]."')");

     

    edit bold bits

  2. doesnt work  :-\

     

    look try this

    <?

    $memyear = 2002;

    $memday = 93;

    $year = date("Y");

    $yearsold = $year - $memyear;

    $day = date("z");

    $days = $memday - $day;

    $daysold = 365 - $days;

    if($daysold > $days){

    $year = date("Y") - 1;

    $yearsold = $year - $memyear;

    }

    echo "$daysold: $yearsold";

    ?>

     

    today is the 95th day, its returning that ive been registerd for 367 days and 4 years, should be 5 years and 2 days...

  3. $year = date("Y");

    $yearsold = $year - $mem[year];

    $day = date("z");

    $daysold = $mem[day] - $day;

    if($daysold<0){

    $year = date("Y") - 1;

    $daysold = $mem[day] - $day + 365;

    }

    lmao i dont even know how many days there are in a year

  4. <table width="200" border="1">

      <tr>

        <td></td>

        <td></td>

        <td></td>

      </tr>

      <tr>

        <td></td>

        <td></td>

        <td></td>

      </tr>

      <tr>

        <td></td>

        <td></td>

        <td></td>

      </tr>

    </table>

     

    already have googled it...

     

  5. figured it..

    $year = date("y");

    $yearsold = $year - registerdyear;

    $day = date("z");

    $daysold = dayregisterd - $day;

    if(daysold<0){

    $year = date("y") - 1;

    $daysold = dayregisterd - $day + 360;

    }

     

    hope it works, ive never tried this before

  6. here you go, make a new feild in your users table

    <?php
    $date = date("YmdHi");
    $info = mysql_query("SELECT * FROM usertable WHERE lastactive>$date"); // edit this
    $r = mysql_fetch_array($info);
    $number = mysql_num_rows($info);
    echo "users active in last 15 minutes:$number<br /><br />$r['username']";
    ?>
    

    to update it:

    <?php
    $lastactive = date("YmdHi") + 15;
    mysql_query("UPDATE usertable SET lastactive='$lastactive' WHERE username = '$user'");
    ?>

     

    using this date format date("YmdHi") will return a number like 200704052048(YearMonthDayHourMinute)

    all the numbers have leading zeros like say its 1am it comes up as 01 and if its 1pm it comes up as 13.., this means that you can never return a number thats less only greater, when you add 15 it ads on an extra 15... the only problem is if its 5 minutes and you add an extr 15 it will go up to 74, not the next hour, this means everytime the hour changes the last active gets wiped

     

     

  7. ive got an upload script

     

    <?php
    $path = "uploads/";
    if (!isset($HTTP_POST_FILES['userfile'])){ echo "
    <FORM ENCTYPE=multipart/form-data ACTION=?page=Upload METHOD=POST>
    
      <p>The file:<br>
        <INPUT TYPE=file NAME=userfile style='border: 1px solid #222222; background-color: #111111; color: #888888'>
      </p>
      Name: <br><input type=text name=name size=25 style='border: 1px solid #222222; background-color: #111111; color: #888888'>
      <p>
      Descritption:<br> <textarea cols=25 name=description style='border: 1px solid #222222; background-color: #111111; color: #888888'></textarea>
      </p>
    
      <p>
        <INPUT TYPE=submit VALUE=Upload style='border: 1px solid #222222; background-color: #111111; color: #888888'>
      </p>
    </FORM>
    "; }else{
    if($name==NULL){ echo "<font color=red>Error!</font>: Please give you image a name<br><FORM ENCTYPE=multipart/form-data ACTION=?page=Upload METHOD=POST>
    
    
      <p>The file:<br>
        <INPUT TYPE=file NAME=userfile style='border: 1px solid #222222; background-color: #111111; color: #888888'>
      </p>
      Name: <br><input type=text name=name size=25 style='border: 1px solid #222222; background-color: #111111; color: #888888'>
      <p>
      Descritption:<br> <textarea cols=25' name=description style='border: 1px solid #222222; background-color: #111111; color: #888888'></textarea>
      </p>
    
      <p>
        <INPUT TYPE=submit VALUE=Upload style='border: 1px solid #222222; background-color: #111111; color: #888888'>
      </p>
    </FORM>"; }else{
    if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
    if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg")) {
    if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) { echo "The file already exists, try calling your file a different name.<br>"; }else{
    $res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path .
    $HTTP_POST_FILES['userfile']['name']);
    if (!$res) { echo "upload failed!<br>"; exit; } else { echo "upload sucessful<br><br>"; }
    echo "File Name: ".$HTTP_POST_FILES['userfile']['name']."<br>";
    echo "File Path: <a href=uploads/".$HTTP_POST_FILES['userfile']['name']." TARGET=_BLANK>uploads/".$HTTP_POST_FILES['userfile']['name']."</a><br>";
    echo "File Size: ".$HTTP_POST_FILES['userfile']['size']." bytes<br>";
    echo "File Type: ".$HTTP_POST_FILES['userfile']['type']."<br>";
    echo "<img src=uploads/".$HTTP_POST_FILES['userfile']['name']."><br>";
    //edit this for your database
    mysql_query("INSERT INTO table(`sender`, `type`, `name`, `description`, `url`) VALUES('$user','img','$name','$description','uploads/".$HTTP_POST_FILES[userfile][name]."')");
    
    }}}}}
    
    
    ?>

     

    this code has all you want i think... only thing is if you have one image called something and someone else tries to upload another one with the same name it wont work...

     

    dont forget to make a folder called uploads, must be in the same directorie as the page where the files get uploaded

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