Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-25-2009, 04:32 PM Download page
Junior Talker

Posts: 3
Trades: 0
Hi,

Iv been looking for a download page in php,html what ever it doesnt matter as long as it works, trouble is i cant find a template for one at all, iv googled many times but not found the results i need.

Any help would be appreciated.
eraldo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-25-2009, 05:24 PM Re: Download page
Extreme Talker

Posts: 181
Name: David Jackson
Trades: 0
are you wanting an Upload script so users can upload files to the server
__________________

Please login or register to view this content. Registration is FREE
davidj is offline
Reply With Quote
View Public Profile
 
Old 05-25-2009, 05:46 PM Re: Download page
Junior Talker

Posts: 3
Trades: 0
Quote:
Originally Posted by davidj View Post
are you wanting an Upload script so users can upload files to the server
No, i want a download page. with that ability, so me and other users can upload and download files.
eraldo is offline
Reply With Quote
View Public Profile
 
Old 05-25-2009, 06:21 PM Re: Download page
Extreme Talker

Posts: 181
Name: David Jackson
Trades: 0
ok

a download page is any page with a link on it. Even a link to another page as when its clicked you 'Download' the page

any one with basic HTML skills (<a href="file.whatever">DOWNLOAD</a>) can write a download page.

What you want is an UPLOAD script in order to upload the files

[cite]
PHP Code:
 
<?php 
$target 
"upload/"
$target $target basename$_FILES['uploaded']['name']) ; 
$ok=1

//This is our size condition 
if ($uploaded_size 350000

echo 
"Your file is too large.<br>"
$ok=0


//This is our limit file type condition 
if ($uploaded_type =="text/php"

echo 
"No PHP files<br>"
$ok=0


//Here we check that $ok was not set to 0 by an error 
if ($ok==0

Echo 
"Sorry your file was not uploaded"


//If everything is ok we try to upload it 
else 

if(
move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 

echo 
"The file "basename$_FILES['uploadedfile']['name']). " has been uploaded"

else 

echo 
"Sorry, there was a problem uploading your file."


?>
Then to read and list a directory
PHP Code:
<?

//define the path as relative
$path "/your/path/here/";

$handle opendir($path) or die("Unable to open $path");

while (
$file readdir($handle)){

   if(
$file!="." && $file!=".."){

      echo 
"<a href='$file'>$file</a><br/>";
 
   }

}

closedir($dir_handle);

?>
__________________

Please login or register to view this content. Registration is FREE
davidj is offline
Reply With Quote
View Public Profile
 
Old 05-26-2009, 02:58 PM Re: Download page
Junior Talker

Posts: 3
Trades: 0
thanks for the help
eraldo is offline
Reply With Quote
View Public Profile
 
Old 08-10-2009, 09:30 AM Re: Download page
Average Talker

Posts: 17
Trades: 0
This helped me a lot oo. I was just about to code somethinf like this one any you saved a lot of time for me
__________________
Biggest source to
Please login or register to view this content. Registration is FREE
free.
Thousands of
Please login or register to view this content. Registration is FREE
links indexed by genre.

Please login or register to view this content. Registration is FREE
source by genres.
ekolipik is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Download page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.03244 seconds with 12 queries