This topic is locked

Inhibit Redirection

6/9/2008 12:25:35 PM
PHPRunner General questions
C
cglaeser author

Assuming guest login is allowed, is it possible to display a random item in the database given the URL without redirection? If I post a URL of the form www.site.com/item_view.php?id=1, this will redirect to www.site.com/item_list.php. How do I inhibit this redirection? I want to view the item on the initial visit to the database, and do not want redirection to the item list.
Best,

Christopher

Sergey Kornilov admin 6/9/2008

Christopher,
you can use AfterSuccfullLogin event to implement your own redirection.
To get a random record from the database check the following article:

http://akinas.com/pages/en/blog/mysql_random_row/

C
cglaeser author 6/10/2008

you can use AfterSuccfullLogin event to implement your own redirection.


OK thanks. I'm guessing this needs to be done conditionally. In other words, if the event is from an actual login, then the redirection should proceed, but if the event is from a new visitor to a list item, then the redirection should not proceed. Is that correct? Can you post the code fragment that will accomplish this?
Best,

Christopher