Spa2004 Posted June 15, 2009 Share Posted June 15, 2009 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 More sharing options...
Mark Baker Posted June 15, 2009 Share Posted June 15, 2009 use a header() redirect rather than include() Link to comment https://forums.phpfreaks.com/topic/162246-loading-new-page-in-php/#findComment-856275 Share on other sites More sharing options...
Spa2004 Posted June 15, 2009 Author Share Posted June 15, 2009 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. Link to comment https://forums.phpfreaks.com/topic/162246-loading-new-page-in-php/#findComment-856436 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.