Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Programming
Reload this Page Need to Know about Upload Form
Reply
 
Thread Tools Display Modes
(#11 (permalink))
Old
Junior Member
Paars is on a distinguished road
 
Posts: 25
Join Date: Aug 2011
Location: Netherlands, Leeuwarden
Default 09-16-2011, 07:47 AM

If it's unclear I can give you a link to the page I meant. (for the ones interested) Not posting it here as it might seem as spam/adverstising.
Reply With Quote
Sponsored Links
(#12 (permalink))
Old
Member
Passionless is on a distinguished road
 
Posts: 48
Join Date: Sep 2011
Default 09-16-2011, 08:02 AM

Hi,
Yeah it's essentially the same thing. You can have a 'index.php' that handles the include of a header and footer template and depending on the action requested by the user add different main content.
So you can add a link to the upload form like this:
<a href="?upload">Upload a file</a>
Then the index.php can process it like the code below.

PHP Code:
<?php
include_once 'header.tpl.php';

// Upload action
if (isset($_REQUEST['upload']))
{
  if (isset(
$_FILES['file']))
  {
// Process the upload
    
    
  
}else{
    
// Show the form
    
include_once 'uploadform.tpl.php';
    
  }


include_once 
'footer.tpl.php';
?>

Last edited by Passionless; 09-16-2011 at 08:10 AM. Reason: It's $_FILES not $_POST
Reply With Quote
(#13 (permalink))
Old
simson's Avatar
Member
simson is on a distinguished road
 
Posts: 46
Join Date: Sep 2011
Location: INDIA
Default 09-16-2011, 08:13 AM

Sorry friend but where to add this line <a href="?upload">Upload a file</a> on upload.php file coz i just create a php file with set of codes you told me and it works but now what to edit? how it redirect visitor to my customize html page.


Human is a Self Destruction Machine
Reply With Quote
(#14 (permalink))
Old
Junior Member
Paars is on a distinguished road
 
Posts: 25
Join Date: Aug 2011
Location: Netherlands, Leeuwarden
Default 09-16-2011, 08:28 AM

My bad, the better a person gets in something(php this case) the worse he gets at teaching it. anyway, send you an example in pm
Reply With Quote
(#15 (permalink))
Old
Junior Member
Paars is on a distinguished road
 
Posts: 25
Join Date: Aug 2011
Location: Netherlands, Leeuwarden
Default 09-16-2011, 08:51 AM

you replied just when I was about to post the following.

die ('Seems ok');
this line, try to replace it with:
header("location:index.html"); // or any other page
exit(); // needed, else you will get an error for the htmlform display and such

I hope that ll fix it.
Reply With Quote
(#16 (permalink))
Old
simson's Avatar
Member
simson is on a distinguished road
 
Posts: 46
Join Date: Sep 2011
Location: INDIA
Default 09-16-2011, 08:57 AM

Thanks Passionless & Paars for being long time here for small issue as i say NOT FOR ME... I'll just try this hope its work.


Human is a Self Destruction Machine
Reply With Quote
(#17 (permalink))
Old
Member
Passionless is on a distinguished road
 
Posts: 48
Join Date: Sep 2011
Default 09-16-2011, 09:21 AM

Check the attachment. You owe me 1M internets XD

Cya 'round.
Attached Files
File Type: zip template.zip (2.2 KB, 2 views)
Reply With Quote
(#18 (permalink))
Old
simson's Avatar
Member
simson is on a distinguished road
 
Posts: 46
Join Date: Sep 2011
Location: INDIA
Default 09-16-2011, 10:09 AM

Thank You Friends, your opinion and suggestion goes up from my head ... but my problem solved now thanks to you guys.


Human is a Self Destruction Machine
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com