Visit this site http://www.stevedawson.com/article0006.php
the php script works very well ” title=”” class=”bbcode_smiley” /> and can be used on an html site too.
There are special cases not handled. What if you misspelled some client you want to link to. So you have to handle the case that no if query is successful.
A better one would be
if( …..){
header( ‘Location: link’);
exit;
} elseif (…..){
header( ‘Location: link’);
exit;
} else{
header( ‘Location: link’);
exit;
}
The else case will be used if no other query succeeds. This is neccessary as users may looking for weak points in your scripts and may change the URLs.
The elseif queries are much better as only one case can be successful. In the told script all queries are checked not relevant if the first one is successful already. Also it is not neccessary to store the link in a variable. It is much better to redirect directly and stop the script.
Using the original script i have not had issues.
Changing the url to seek a nonexistant link loads the index page. which is fine by me.
There is no reason for a person to seek a weak link in a redirect script… no value in doing it just wasting their own time.?
I didn’t say that the script is not working and it might be unimportant if the links are not stored in a database, but it’s not the really good solution.
Please login or Register to submit your answer