Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Dec 2005
    Posts
    6,228
    Tokens
    1,145

    Latest Awards:

    Default [URGENT] Upload script!!

    Okay, this is the last time i'm posting it. If I cannot get it working, then i'm getting rid of the current uploader.

    http://biolabs.x10hosting.com/bioupload.php

    My upload script, no matter how many times you upload something, even if you have never used it, it comes up with the same message 'too many uploads per session'. Below are the codes...

    This is the upload form code (the one shown on that link up above):
    PHP Code:
    <?php session_start();
    ?>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
     
    <meta name="generator" content="HTML Tidy for Linux (vers 1 September 2005), see http://www.w3.org">
     
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Biolabs v1</title>
     
     
    <link href="style.css" rel="stylesheet" type="text/css">
     
    <style type="text/css">
    /*<![CDATA[*/
    li.c2 {list-style: none}
    span.c1 {font-weight: bold;}
    /*]]>*/
    </style>
    <style type="text/css">
    <!--
    .style2 {font-size: 36px}
    -->
    </style>
    </head>
     
     
     
    <body style="background-color: rgb(0, 0, 0);">
     
    <div id="holder">
    <div id="header">
    <div id="logo2"><img src="images/newlogo.bmp" alt="logo"></div>
     
    <br>
     
    <div id="menu">
    <ul>
     
    <li><a href="index.html">Home</a></li>
     
    <li><a href="scripts.html">Scripts</a></li>
     
    <li><a href="vip.html">VIP</a></li>
     
    <li><a href="bioupload.php">BioUpload</a></li>
     
    <li><a href="about.html">About</a></li>
     
    </ul>
     
    </div>
     
    </div>
     
    <div id="main">
    <div id="sidebar"><span class="c1">Current
    BioTools:<br>
     
    <span style="font-weight: normal;">BioUpload - v1.12</span><br style="font-weight: normal;">
     
    <span style="font-weight: normal;">BioConverter - Alpha
    v0.08</span><br style="font-weight: normal;">
     
    <span style="font-weight: normal;">BioProxy - Alpha v0.05</span><br>
     
    <br>
     
    Current Scripts:<br>
     
    <span style="font-weight: normal;">HxF Status Signature -
    Beta v0.7</span><br style="font-weight: normal;">
     
    <span style="font-weight: normal;">Ingenerator - Alpha
    v0.05</span><br>
     
    <br>
     
    Site version - v1.28<br>
     
    </span>
    <br>
     
    <a href="http://validator.w3.org/check?uri=referer"><img style="border: 0pt none ; width: 88px; height: 31px;" src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a><a href="http://jigsaw.w3.org/css-validator/"> <img style="border: 0pt none ; width: 88px; height: 31px;" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!"></a>
    <br>
     
    <br>
     
    <a href="http://www.x10hosting.com/?rid=91209"> <img style="border: 0pt none ;" src="images/x10hosting.gif" alt="x10hosting">
    </a> </div>
     
    <div id="text">
    <div align="center"><br>
     
    <br>
     
    <span class="style2"><font color="#000000">Biolabs
    Image Uploader v1.12</font></span><br>
     
    <br>
     
    </div>
     
    <center>
    <p><font color="#000000">Choose the image you want
    to upload, The image must be less than 1MB in size.</font><br>
     
    <font color="#000000">There is no limit to the ammount of
    images that you upload!</font><br>
     
    <font color="#000000">Inappropriate images are NOT allowed!</font></p>
     
    <form action="bioupload2.php" enctype="multipart/form-data" method="post"> <input name="user_file" size="50" type="file"> <br>
     
    <br>
     
    <input name="submit" value="Upload Now" type="submit"></form>
     
    </center>
     
    </div>
     
    </div>
     
    <div id="footer">
    <div id="left_footer"><strong><strong>Copyright
    &copy;2008 Biolabs.co.uk</strong></strong></div>
     
    <div id="right_footer"><strong><strong>Site
    created by Jack Moore</strong></strong></div>
     
    </div>
     
    </div>
     
    </body>
    </html>
    And here is the code for the upload script (the one which uplaods the image given, and gives the link for it):
    PHP Code:
    <?php session_start();
    ?>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
     
    <meta name="generator" content="HTML Tidy for Linux (vers 1 September 2005), see http://www.w3.org">
     
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Biolabs v1</title>
     
     
    <link href="style.css" rel="stylesheet" type="text/css">
     
    <style type="text/css">
    /*<![CDATA[*/
    li.c2 {list-style: none}
    span.c1 {font-weight: bold;}
    /*]]>*/
    </style>
    <style type="text/css">
    <!--
    .style2 {font-size: 36px}
    -->
    </style>
    </head>
     
     
     
    <body style="background-color: rgb(0, 0, 0);">
     
    <div id="holder">
    <div id="header">
    <div id="logo2"><img src="images/newlogo.bmp" alt="logo"></div>
     
    <br>
     
    <div id="menu">
    <ul>
     
    <li><a href="index.html">Home</a></li>
     
    <li><a href="scripts.html">Scripts</a></li>
     
    <li><a href="vip.html">VIP</a></li>
     
    <li><a href="bioupload.php">BioUpload</a></li>
     
    <li><a href="about.html">About</a></li>
     
    </ul>
     
    </div>
     
    </div>
     
    <div id="main">
    <div id="sidebar"><span class="c1">Current
    BioTools:<br>
     
    <span style="font-weight: normal;">BioUpload - v1.12</span><br style="font-weight: normal;">
     
    <span style="font-weight: normal;">BioConverter - Alpha
    v0.08</span><br style="font-weight: normal;">
     
    <span style="font-weight: normal;">BioProxy - Alpha v0.05</span><br>
     
    <br>
     
    Current Scripts:<br>
     
    <span style="font-weight: normal;">HxF Status Signature -
    Beta v0.7</span><br style="font-weight: normal;">
     
    <span style="font-weight: normal;">Ingenerator - Alpha
    v0.05</span><br>
     
    <br>
     
    Site version - v1.28<br>
     
    </span>
    <br>
     
    <a href="http://validator.w3.org/check?uri=referer"><img style="border: 0pt none ; width: 88px; height: 31px;" src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a><a href="http://jigsaw.w3.org/css-validator/"> <img style="border: 0pt none ; width: 88px; height: 31px;" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!"></a>
    <br>
     
    <br>
     
    <a href="http://www.x10hosting.com/?rid=91209"> <img style="border: 0pt none ;" src="images/x10hosting.gif" alt="x10hosting">
    </a> </div>
     
    <div id="text">
    <?php
    $n 
    $_FILES['user_file']['name'];
    $type $_FILES['user_file']['type'];
    $size $_FILES['user_file']['size'];
    $time time();
    $n $time;
    $path "uploads/"$n;
     
    $uploaded $_SESSION['firsttimeupload'];
    if (
    $uploaded == "ok")
    {
    if (
    $size <1048576 && ereg("image"$type ))
    {
    move_uploaded_file($_FILES['user_file']['tmp_name'],
    $path);
     
    $root "http://biolabs.x10hosting.com/uploads/";
    $path2 $root $n;
    echo 
    "<center>";
    echo 
    "<h3><span style='color: #000;'><center><b>Your Image Link Is: </h3><a href=$path2>$path2</a></b><center></span>"
    echo 
    "<br>";
    echo 
    "<img src=$path2 border='5'></img>";
    echo 
    "<center>";
     
     
    $fp=fopen("links.text""at");
    fwrite($fp$path2."\n");
    fclose($fp);
    session_destroy();
    session_unset();


    else
    {
    echo(
    "<span style='color: #000;'><center><b>You can't upload the same image too many times per session!<br>Go back and choose another one!</b><center></span>");

     
    ////////////
    if ($size>1048576)
    {
    echo(
    "<span style='color: #000;'><center><b>ERROR<br>The image size is too big!</b><center></span>");
    }
    if (!
    ereg("image"$type) )
    {
    echo(
    "<span style='color: #000;'><center><b>ERROR<br>The file is not image!</b><center></span>");
    }
    echo 
    "";
    ?>
    </div>
     
    </div>
     
    <div id="footer">
    <div id="left_footer"><strong><strong>Copyright �2008 Biolabs.co.uk</strong></strong></div>
     
    <div id="right_footer"><strong><strong>Site created by Jack Moore</strong></strong></div>
     
    </div>
     
    </div>
     
    </body>
    </html>
    Last edited by jackass; 15-06-2008 at 01:54 PM.
    i'm out of touch, i'm out of love
    i'll pick you up when you're getting down
    and out of all these things i've done
    i think i love you better now

  2. #2
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Sorry I can't help, but I reccomend you get a better uploader ^^

  3. #3
    Join Date
    Dec 2005
    Posts
    6,228
    Tokens
    1,145

    Latest Awards:

    Default

    Quote Originally Posted by Minor View Post
    Sorry I can't help, but I reccomend you get a better uploader ^^
    Damn.
    i'm out of touch, i'm out of love
    i'll pick you up when you're getting down
    and out of all these things i've done
    i think i love you better now

  4. #4
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    No idea if this will work, but;

    PHP Code:
    <?php session_start();
    ?>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
     
    <meta name="generator" content="HTML Tidy for Linux (vers 1 September 2005), see http://www.w3.org">
     
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Biolabs v1</title>
     
     
    <link href="style.css" rel="stylesheet" type="text/css">
     
    <style type="text/css">
    /*<![CDATA[*/
    li.c2 {list-style: none}
    span.c1 {font-weight: bold;}
    /*]]>*/
    </style>
    <style type="text/css">
    <!--
    .style2 {font-size: 36px}
    -->
    </style>
    </head>
     
     
     
    <body style="background-color: rgb(0, 0, 0);">
     
    <div id="holder">
    <div id="header">
    <div id="logo2"><img src="images/newlogo.bmp" alt="logo"></div>
     
    <br>
     
    <div id="menu">
    <ul>
     
    <li><a href="index.html">Home</a></li>
     
    <li><a href="scripts.html">Scripts</a></li>
     
    <li><a href="vip.html">VIP</a></li>
     
    <li><a href="bioupload.php">BioUpload</a></li>
     
    <li><a href="about.html">About</a></li>
     
    </ul>
     
    </div>
     
    </div>
     
    <div id="main">
    <div id="sidebar"><span class="c1">Current
    BioTools:<br>
     
    <span style="font-weight: normal;">BioUpload - v1.12</span><br style="font-weight: normal;">
     
    <span style="font-weight: normal;">BioConverter - Alpha
    v0.08</span><br style="font-weight: normal;">
     
    <span style="font-weight: normal;">BioProxy - Alpha v0.05</span><br>
     
    <br>
     
    Current Scripts:<br>
     
    <span style="font-weight: normal;">HxF Status Signature -
    Beta v0.7</span><br style="font-weight: normal;">
     
    <span style="font-weight: normal;">Ingenerator - Alpha
    v0.05</span><br>
     
    <br>
     
    Site version - v1.28<br>
     
    </span>
    <br>
     
    <a href="http://validator.w3.org/check?uri=referer"><img style="border: 0pt none ; width: 88px; height: 31px;" src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a><a href="http://jigsaw.w3.org/css-validator/"> <img style="border: 0pt none ; width: 88px; height: 31px;" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!"></a>
    <br>
     
    <br>
     
    <a href="http://www.x10hosting.com/?rid=91209"> <img style="border: 0pt none ;" src="images/x10hosting.gif" alt="x10hosting">
    </a> </div>
     
    <div id="text">
    <?php
    $n 
    $_FILES['user_file']['name'];
    $type $_FILES['user_file']['type'];
    $size $_FILES['user_file']['size'];
    $time time();
    $n $time;
    $path "uploads/"$n;
     
    if ( 
    $_SESSION['image'] == $_FILES['user_file']['name'])
    {
    echo (
    "You just uploaded that image");
    }
    else
    {
    if (
    $size <1048576 && ereg("image"$type ))
    {
    move_uploaded_file($_FILES['user_file']['tmp_name'],
    $path);
     
    $root "http://biolabs.x10hosting.com/uploads/";
    $path2 $root $n;
    echo 
    "<center>";
    echo 
    "<h3><span style='color: #000;'><center><b>Your Image Link Is: </h3><a href=$path2>$path2</a></b><center></span>"
    echo 
    "<br>";
    echo 
    "<img src=$path2 border='5'></img>";
    echo 
    "<center>";

    $_SESSION['image'] = $_FILES['user_file']['name'];
     
    $fp=fopen("links.text""at");
    fwrite($fp$path2."\n");
    fclose($fp);


    else
    {
    echo(
    "<span style='color: #000;'><center><b>You can't upload the same image too many times per session!<br>Go back and choose another one!</b><center></span>");

     
    ////////////
    if ($size>1048576)
    {
    echo(
    "<span style='color: #000;'><center><b>ERROR<br>The image size is too big!</b><center></span>");
    }
    if (!
    ereg("image"$type) )
    {
    echo(
    "<span style='color: #000;'><center><b>ERROR<br>The file is not image!</b><center></span>");
    }
    echo 
    "";
    ?>
    </div>
     
    </div>
     
    <div id="footer">
    <div id="left_footer"><strong><strong>Copyright �2008 Biolabs.co.uk</strong></strong></div>
     
    <div id="right_footer"><strong><strong>Site created by Jack Moore</strong></strong></div>
     
    </div>
     
    </div>
     
    </body>
    </html>
    Lets set the stage on fire, and hollywood will be jealous.

  5. #5
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Unexpected T_else for me?

  6. #6
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    If I was you I wouldn't use PHP to upload files, I'd use PERL.
    Hi, names James. I am a web developer.

  7. #7
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    This is not a habbo room. Everybody wants the quickest replies - saying [urgent] isn't going to speed it up - on topic:

    links.text ?
    putting it by time? What happens when two people upload in the same second?

    Your hosting - as it's free - may not give you the file permissions you need to write, or for you to use certain functions. I'd suggest doing all your testing on a test server (locally), use wamp or as some people on here suggest xamp, they're server emulator software and use the LAMP platform (Linux, apache, mysql, php), I also suggest you use MySQL to write the links to, in the future if you ever plan on expanding this uploader you'll find it a lot easier with MySQL or any other database.

    I don't see anything immedietely wrong.

    Correct me if i'm wrong - I haven't looked at my session architecture for a while, but I believe session_unset() and session_destroy must be before headers are sent in which case you should throw a redirect to either of the two, then again we all hate relying on browsers to do something, in which case you'd have to use something else.

    -Charlie
    How could this hapen to meeeeeeeeeeeeeee?lol.

  8. #8
    Join Date
    Dec 2005
    Posts
    6,228
    Tokens
    1,145

    Latest Awards:

    Default

    Whats habbo got to do with anything...?

    Its doubtful that it would happen in the same second, and i've got unlimited PHP on x10, so I have all the functions and I can chmod it to my choice.

    But yeah thanks.

    Quote Originally Posted by Hypertext View Post
    This is not a habbo room. Everybody wants the quickest replies - saying [urgent] isn't going to speed it up - on topic:

    links.text ?
    putting it by time? What happens when two people upload in the same second?

    Your hosting - as it's free - may not give you the file permissions you need to write, or for you to use certain functions. I'd suggest doing all your testing on a test server (locally), use wamp or as some people on here suggest xamp, they're server emulator software and use the LAMP platform (Linux, apache, mysql, php), I also suggest you use MySQL to write the links to, in the future if you ever plan on expanding this uploader you'll find it a lot easier with MySQL or any other database.

    I don't see anything immedietely wrong.

    Correct me if i'm wrong - I haven't looked at my session architecture for a while, but I believe session_unset() and session_destroy must be before headers are sent in which case you should throw a redirect to either of the two, then again we all hate relying on browsers to do something, in which case you'd have to use something else.

    -Charlie
    i'm out of touch, i'm out of love
    i'll pick you up when you're getting down
    and out of all these things i've done
    i think i love you better now

  9. #9
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Biohazard View Post
    Whats habbo got to do with anything...?

    Its doubtful that it would happen in the same second, and i've got unlimited PHP on x10, so I have all the functions and I can chmod it to my choice.

    But yeah thanks.
    He means that putting [URGENT] just makes you look desperate and wont get you a reply any faster, like what people do in habbo.

    And i dont see why youve put in sessions? From what i can see you delete them when its been uploaded anyways, so whats the point?

    Dont over-complicate things lol.
    Coming and going...
    Highers are getting the better of me

  10. #10
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Quote Originally Posted by Hypertext View Post
    This is not a habbo room. Everybody wants the quickest replies - saying [urgent] isn't going to speed it up - on topic:

    links.text ?
    putting it by time? What happens when two people upload in the same second?

    Your hosting - as it's free - may not give you the file permissions you need to write, or for you to use certain functions. I'd suggest doing all your testing on a test server (locally), use wamp or as some people on here suggest xamp, they're server emulator software and use the LAMP platform (Linux, apache, mysql, php), I also suggest you use MySQL to write the links to, in the future if you ever plan on expanding this uploader you'll find it a lot easier with MySQL or any other database.

    I don't see anything immedietely wrong.

    Correct me if i'm wrong - I haven't looked at my session architecture for a while, but I believe session_unset() and session_destroy must be before headers are sent in which case you should throw a redirect to either of the two, then again we all hate relying on browsers to do something, in which case you'd have to use something else.

    -Charlie
    DarrenToogood. session_unset() and session_destroy() do what they say, they unset and destroy the session.

    You can put them at the end of a program, and it work just fine. session_start() should be before anything else that outputs.

    I've told you what is wrong with the script, and you won't listen, you're not setting the session at all.

    You are looking to see if $_SESSION['firsttimeupload'] is equal to 'ok' and it isn't so you are getting the session error.

    How do you think that $_SESSION['firsttimeupload'] gets to be 'ok', it isn't magically set that as default... you need to set it.. you need some sort of validation to check to see if it has been uploaded, you're going about this all wrong.

    There isn't any point in even using sessions in something like this if you can't figure out what it is for.

    The session ends when the user closes the browser window and a new session ID is generated, so there is no use in even using it, because if he wanted to upload the same image over and over, all he needs to do is get IE and upload, close, upload, close.. but you would need your script fixed to do that.

    Your uploader isn't going to be popular enough to even need 'protection' like this, and it isn't needed anyway, hence why TinyPic, Photobucket, Imageshack don't do it.

    Hope that helped.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •