Jump to content

Loading new page in php


Spa2004

Recommended Posts

I've been using php for a while but have a problem with something I suspect is incredibly basic.

 

I have an online business where users can upload files.  They do this from an html form which has action=Uploader.php  Uploader then runs some checks, uploads the files and takes them to a success page.  I take them to the success page by saying include("UploadSuccess.php").  Everything works fine except the url which the visitor will see in their browser is Uploader.php not UploadSuccess.php beacuse the UploadSuccess script has been included within Uploader.php

 

How can I cause the page UploadSuccess.php to be loaded and to ensure that when analysing my page hits, the hit is shown against UploadSuccess.php not Uploader.php?  I've looked around lots of php resources but can't find anything, so I have concluded I must really have a pretty basic hole in my php understanding!

 

I really want to be able to say in Uploader.php, if everything was okay display the UploadSuccess.php page but I can't see how to make that happen.

 

Many thanks and most grateful for any suggestions.

Link to comment
https://forums.phpfreaks.com/topic/162246-loading-new-page-in-php/
Share on other sites

Many thanks, I've tried using header() but can't get it to work, no page is displayed.

 

if($mailsuccess) {
ob_clean();
header("Location: http://www.mysite.com/UploadSuccess.php");
//include("UploadSuccess.php");
die();	}

 

As you can see I used to have an include which I've commented out and have instead put in a header().  No output is created, so I wondered about the output buffers so put the ob_clean statement in, but this still doesn't direct to my UploadSuccess.php page.

Archived

This topic is now archived and is closed to further replies.

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