Re: request_uri alternative



On 17 Dec, 04:06, FutureShock <futuresho...@xxxxxxx> wrote:
My server host for whatever reason is not dishing out the correct
request_uri.  It is displaying the page viewing and not the page it was
linked from.

So...what I am looking for is an alternative to determine the previous
page from the site. (nothing from external).

This is what I have so far at the top of each page.

session_start();
// Set previous page
if(isset($_SESSION['current_page'])) {
        $previous_page = $_SESSION['current_page'];}

$_SESSION['current_page'] = $_SERVER['PHP_SELF'];

This works so far with limited testing.

Has anyone used a different method that they know that works?
Can you see any reason why my method may fail?

Thanks
Scotty

There's several ways to solve the problem. Your solution will get
confused if the user opens more than one window and also has the
overhead of maintaining a session for every user. An alternative
approach would be to rewrite the URLs in all the links using
javascript to add a parameter identifying the current page, and add a
hidden field to any POST form with the same. But this does not address
the core issue - why do you need this information?

C.
.



Relevant Pages

  • Re: request_uri alternative
    ... It is displaying the page viewing and not the page it was ... confused if the user opens more than one window and also has the ... Well you are correct having multiple browsers opened does mess up the session data. ...
    (comp.lang.php)
  • Page unload event
    ... I have a web form in my application that will be used for both viewing and ... updating information. ... It seemed logical to put any code to handle this in the page unload event, ... I attempted to check for IsPostBack, before displaying the save message. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Missing: hour/minute / second data (smalldatetime)
    ... The way it is displayed depends on the gui that is displaying it unless you ... >> 1) What does the source time say? ... >> Try viewing the table in Query Analyzer to see if they are truly missing. ...
    (microsoft.public.sqlserver.dts)
  • Re: request_uri alternative
    ... It is displaying the page viewing and not the page it was ... approach would be to rewrite the URLs in all the links using ... The reason for this was to be able to put the user back on the page after a link took him elsewhere. ... It was my thought that it held the value of the page the linked the page I am viewing. ...
    (comp.lang.php)
  • Re: HTMLViewer: How to avoid the handcursor on inactive links
    ... question was about displaying them. ... but I didn't realize you were not in control of the HTML that your program will be viewing. ... Strip the anchor tags and replace them with underline tags; ...
    (borland.public.delphi.thirdpartytools.general)