therock Posted September 6, 2006 Share Posted September 6, 2006 hi all, i'm new to this forum awa to php. can someone help me i want to redirect to some other php page on a button click. i used this code, but it doesn't work$URL="http://www.example.com";header ("Location: $URL");is there anythin like redirect(""); Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 6, 2006 Share Posted September 6, 2006 So why not use html .... <a href="http://www.example.com">click here</a> Quote Link to comment Share on other sites More sharing options...
therock Posted September 6, 2006 Author Share Posted September 6, 2006 hi andy,i'm gettin datas from users usin a form(getdata.php) and insertin it into a table(insertdata.php).wen datas r inserted the page (insertdata.php) remains.wat i need is to redirect it to (getdata.php) again after insertion is over. Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 6, 2006 Share Posted September 6, 2006 As long as you have no output to the browser in insertdata,php, you can use the header() function:[code]<?php// insertdata.php// retrieve data from form// conn to database, select database// create and execute db queryheader("Location: getdata.php");?>[/code] 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.