jagguy Posted November 20, 2006 Share Posted November 20, 2006 Hi,I run a php script and want to return to another page automatically.I get an error when the headers are resent it says, but I thought this is how it is done.... $sql = "INSERT INTO image2 (id,url,filename,description,del) VALUES(NULL,'http://localhost/php/images/','$file','$desc',NULL) "; $result = mysql_query("$sql") or die("Invalid query: " . mysql_error()); } mysql_close($link);header( "Location: http://localhost/php/addImage4.html" ); //errorexit; Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted November 20, 2006 Share Posted November 20, 2006 read the sticky thread at the top of this help forum if your getting header errors... Quote Link to comment Share on other sites More sharing options...
jagguy Posted November 20, 2006 Author Share Posted November 20, 2006 This seems to just goto the file straight away. I want it to do something then return automatically.<?php header ("Content-type: image/png");//must be in 1st col and line of fileignore_user_abort(true);header('Location: http://localhost/php/upload2.html');//do some image resizing in this file.. Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted November 22, 2006 Share Posted November 22, 2006 you mean like include a file? or require_once()? Quote Link to comment Share on other sites More sharing options...
jagguy Posted November 23, 2006 Author Share Posted November 23, 2006 I have worked it out, thanks. Quote Link to comment Share on other sites More sharing options...
marcus Posted November 23, 2006 Share Posted November 23, 2006 You could have just used<?phpob_start();codestuffhereob_end_flush();?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.