Re: Returning to previous page

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

 



Jeff Bennett wrote:

> 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
> >
> >
> >
> >
> >
>
>
>
> PHP Data object relational mapping generator - 
> http://www.meta-language.net/
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> <http://us.ard.yahoo.com/SIG=129m3qg1j/M=298184.5285298.6392945.3001176/D=groups/S=1705006764:HM/EXP=1095439111/A=2352667/R=0/SIG=11t4iivpf/*http://www.netflix.com/Default?mqso=60185359&partid=5285298> 
>
>
>
> ------------------------------------------------------------------------
> *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
>       <mailto:php-objects-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
Just to add to Jeff Bennett's suggestion...

The added benefit of using a PHP script to navigate between pages rather 
than a client-side script is that it will work for any browser, even if 
scripting is disabled.
For security reasons, a lot of individuals as well as companies disable 
Javascript (and VB Script).
Java also requires a runtime environment which may not be installed on 
the client machine.
That's why I much prefer the server-side solution.

Regards

Andy Clark



------------------------ 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