siddscool19 Posted October 13, 2008 Share Posted October 13, 2008 Hey people I want to redirect to another page after submitting data in a form I mean after I click submit button I am not taken to the (action="") page I want it to redirect it to a page of my choice can I do that? I wana setup it on my site..... I can't include redirect thing in my action="" page since I use that page sometimes for other purposes Link to comment Share on other sites More sharing options...
waynew Posted October 13, 2008 Share Posted October 13, 2008 header('Location: page.php'); NOTE: The above code must be used before ANYTHING is outputted to the screen. That means no echos, no prints, no errors. Link to comment Share on other sites More sharing options...
siddscool19 Posted October 13, 2008 Author Share Posted October 13, 2008 See the forum is this: <form action=http://www.sitename.com method=post> <input type=text name=data> <input type=submit value=Submit> </form> Now after someone click on submit button it redirect to this page www.newsite.com rather than to www.sitename.com How to do that? Link to comment Share on other sites More sharing options...
waynew Posted October 13, 2008 Share Posted October 13, 2008 <form name ="redirectform" action="http://www.newname.com" method="post"> <input type=text name=data> <input type=submit value=Submit> </form> Link to comment Share on other sites More sharing options...
siddscool19 Posted October 13, 2008 Author Share Posted October 13, 2008 U didn't get me..... I want to do this.. Submit data to this site www.sitename.com But it should load this site www.newsite.com Link to comment Share on other sites More sharing options...
waynew Posted October 13, 2008 Share Posted October 13, 2008 After they submit the data and the data is taken in, redirect using the first piece of code I gave you. Link to comment Share on other sites More sharing options...
siddscool19 Posted October 13, 2008 Author Share Posted October 13, 2008 See the site I am sending the data to is not in my control...... That is the problem So how can I redirect to another site with header function Link to comment Share on other sites More sharing options...
AndyB Posted October 13, 2008 Share Posted October 13, 2008 This looks suspiciously like a spam application. Again. If you come up with a convincing reason why you need this, we'll unlock the thread (and don't even think of starting another equivalent). Otherwise, you're done, Link to comment Share on other sites More sharing options...
Recommended Posts