corillo181 Posted June 10, 2007 Share Posted June 10, 2007 i got a link like this http://localhost/gallery/thumb.php?id=1 you know people be messing around to find flows in websites so i want to know how cna i rederect someone that enter the address link this http://localhost/gallery/thumb.php Quote Link to comment https://forums.phpfreaks.com/topic/55022-solved-ur-redirection/ Share on other sites More sharing options...
Wuhtzu Posted June 10, 2007 Share Posted June 10, 2007 Just add a certain action to be taken in the event that no id is passed: thumb.php: //Get the ID $id = $_GET['id']; if(isset($id)) { view a thumbnail or something } else { //Take a default action echo "Stop screwing around and give me an ID!"; } Quote Link to comment https://forums.phpfreaks.com/topic/55022-solved-ur-redirection/#findComment-271989 Share on other sites More sharing options...
corillo181 Posted June 10, 2007 Author Share Posted June 10, 2007 that works when is only http://localhost/gallery/thumb.php but if is like this http://localhost/gallery/thumb.php?id it doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/55022-solved-ur-redirection/#findComment-271995 Share on other sites More sharing options...
soycharliente Posted June 10, 2007 Share Posted June 10, 2007 what does the id number correspond to? A table id? You can check if it's a valid id else show a message. Quote Link to comment https://forums.phpfreaks.com/topic/55022-solved-ur-redirection/#findComment-271997 Share on other sites More sharing options...
corillo181 Posted June 10, 2007 Author Share Posted June 10, 2007 i got a gallery set up.. so when you click in one gallery it goes into the thumb page with the id as the gallery id for the chosen one. i try making it that if the id has no value to go back to the main gallery page, but it does not work. Quote Link to comment https://forums.phpfreaks.com/topic/55022-solved-ur-redirection/#findComment-272003 Share on other sites More sharing options...
redarrow Posted June 10, 2007 Share Posted June 10, 2007 correct way ok. <?php $id=$_GET['id']; $url="http://localhost/gallery/thumb.php?id=".$id." "; if(eregi("^(http://localhost/gallery/thumb.php)\?[a-z]{0,2}\=[0-9]",$url)){ echo "correct url"; }else{ echo " Dont play games go to bed mate"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/55022-solved-ur-redirection/#findComment-272005 Share on other sites More sharing options...
corillo181 Posted June 11, 2007 Author Share Posted June 11, 2007 thats great man Quote Link to comment https://forums.phpfreaks.com/topic/55022-solved-ur-redirection/#findComment-272008 Share on other sites More sharing options...
redarrow Posted June 11, 2007 Share Posted June 11, 2007 Your welcome use the solved button ok if the issue is solved. Quote Link to comment https://forums.phpfreaks.com/topic/55022-solved-ur-redirection/#findComment-272010 Share on other sites More sharing options...
corillo181 Posted June 11, 2007 Author Share Posted June 11, 2007 yeha almost forgot .. Quote Link to comment https://forums.phpfreaks.com/topic/55022-solved-ur-redirection/#findComment-272011 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.