Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Anyone good at PHP?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
Hyaxor
Master Cheater
Reputation: 0

Joined: 25 Jan 2009
Posts: 251

PostPosted: Sun Feb 07, 2010 8:37 am    Post subject: Anyone good at PHP? Reply with quote

Well, I'm trying to make a small file uploading website called BeanLoad(max. file upload is 10MB) and I can't seem to get it right.

I got an HTML file called upload.html with this code in it:
Code:
<form enctype="multipart/form-data" action="upload.php" method="POST">
Please choose a file: <input name="uploaded" type="file" /><br />
<input type="submit" value="Beanload" />
</form>


And a PHP file called upload.php with this code in it:
Code:
<?php
$target = "upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if ($uploaded_size > 10000000)
{
echo "Your bean is too large, maximum upload range is 10MB.<br>";
$ok=0;
}
if ($uploaded_type =="text/php")
{
echo "PHP files aren't allowed.<br>";
$ok=0;
}
if ($ok==0)
{
Echo "Sorry, your bean was not uploaded";
}
else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "Your bean ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else
{
echo "Sorry, there was a problem uploading your bean.";
}
}
?>


And i've got a folder called files. All that on a domain.

The problem is, when I select a file and try to upload it, it just gives me an error message(on 000webhost at least). You can find a preview on http://www.beanload.webatu.com/upload.html

EDIT: Nvm, got it working.
Back to top
View user's profile Send private message
Roy
Advanced Cheater
Reputation: 0

Joined: 01 Aug 2009
Posts: 60

PostPosted: Sun Feb 07, 2010 3:20 pm    Post subject: Re: Anyone good at PHP? Reply with quote

Hyaxor wrote:
Well, I'm trying to make a small file uploading website called BeanLoad(max. file upload is 10MB) and I can't seem to get it right.

I got an HTML file called upload.html with this code in it:
Code:
<form enctype="multipart/form-data" action="upload.php" method="POST">
Please choose a file: <input name="uploaded" type="file" /><br />
<input type="submit" value="Beanload" />
</form>


And a PHP file called upload.php with this code in it:
Code:
<?php
$target = "upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if ($uploaded_size > 10000000)
{
echo "Your bean is too large, maximum upload range is 10MB.<br>";
$ok=0;
}
if ($uploaded_type =="text/php")
{
echo "PHP files aren't allowed.<br>";
$ok=0;
}
if ($ok==0)
{
Echo "Sorry, your bean was not uploaded";
}
else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "Your bean ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else
{
echo "Sorry, there was a problem uploading your bean.";
}
}
?>


And i've got a folder called files. All that on a domain.

The problem is, when I select a file and try to upload it, it just gives me an error message(on 000webhost at least). You can find a preview on http://www.beanload.webatu.com/upload.html

EDIT: Nvm, got it working.
That's pretty lame code you know, you could have shortened it a lot.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites