Re: Returning to previous page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If I understand what you mean, you would like them to go back to the last
page they were on before they came to this page where they might have
clicked a few icons and updated the page?

In my applications where I need to do this, I carry around a variable called
$returnto.  Then all of my urls contain '&returnto=' . myGetURI($returnto).
On the page with the clickable icons, just use '&returnto=' . $returnto on
the icons in order to not add the current page into the history.

Then you can have a back button with href=$returnto.

The code below adds the current page to the $returnto variable, preserving
other querystring variable.

 function myGetURI($returnto) {
  global $QUERY_STRING;
  global $SCRIPT_NAME;
  if ($returnto=='close') {
   $function_ret='close';
  } else {
   $QS=$QUERY_STRING.'';
   $tempURI=$SCRIPT_NAME.($QS!=''?'?'.$QS:'');
   if ((strpos($QS,"returnto")==0) && ($returnto!='')) {
    $tempURI=hrefargs($tempURI,'returnto',$returnto);
   }
   $function_ret=rawurlencode($tempURI);
  }
  return $function_ret;
 }

 function hrefargs($href,$arg,$val) {
  $function_ret =
$href.((strpos($href,'?')>0)?'&':'?').$arg.'='.rawurlencode($val);
  return $function_ret;
 }

----- Original Message ----- 
From: "Weng Cheng" <wengcheng@ephone.com.ph>
To: <php-objects@yahoogroups.com>; <php_king@yahoogroups.com>;
<php-list@yahoogroups.com>; <php_mysql@yahoogroups.com>
Sent: Thursday, September 16, 2004 12:42 AM
Subject:  Returning to previous page


> Hi all,
>
> I got a dynamic page where a list is called from the DB. Now, I have an
> icon with a tag for each item wehreby you can click on the icon and it
> changes the status for that item. How do I return to the previous page,
> since my function I called as a separate file.
>
> Let me know if this is in the manual.
>
>
>
>
>
> PHP Data object relational mapping generator -
http://www.meta-language.net/
> Yahoo! Groups Links
>
>
>
>
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux