SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict thoresson's Avatar
    Join Date
    Dec 2002
    Location
    Gothenburg, Sweden
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    force the user to return to the previous page

    Hi,

    I'm learning PHP and xHTML but have a problem that I think javascript have to solve:

    I'm buildning a permissions system. If the database check shows that the user doesn't have access to the PHP script she tries to access, I want to diplay an alert window telling her so. And when she presses the "OK"-button, I want the browser to send here back to the previous page that she came from.

    Is this a javascript problem? Is there a quick and dirty solution?
    //Anders

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,424
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    location.replace = history.go(-1);

    Put that after the alert. It will take them one page back.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •