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(""); Link to comment https://forums.phpfreaks.com/topic/19868-page-redirect/ 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> Link to comment https://forums.phpfreaks.com/topic/19868-page-redirect/#findComment-86937 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. Link to comment https://forums.phpfreaks.com/topic/19868-page-redirect/#findComment-86949 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] Link to comment https://forums.phpfreaks.com/topic/19868-page-redirect/#findComment-86952 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.