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 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!"; } 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. 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. 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. 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"; } ?> 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 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. 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 .. Link to comment https://forums.phpfreaks.com/topic/55022-solved-ur-redirection/#findComment-272011 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.