|
Posted by zzapper on 04/03/07 11:25
On Apr 3, 11:50 am, Schraalhans Keukenmeester <bitbuc...@invalid.spam>
wrote:
> zzapperwrote:
> > On Apr 2, 3:33 pm, Toby A Inkster <usenet200...@tobyinkster.co.uk>
> > wrote:
> >> zzapperwrote:
> >>> I use an internal bookmark
> >>> <form method="post" action="${form_action}#mark1">
> >>> to return to the correct place in the page.
> >>> In case of an error I would wish to return to the top of the screen
> >>> can I overrule the bookmark "mark1" in my PHP code?
> >> No, but your results page could put id="mark1" at the top of the page
> >> instead of further down.
>
> >> --
> > Toby
> > Can I "Read" the value of this bookmark from the PHP environment
> > variables?
>
> > --
> >zzapper
> > Best of VimTips
> >http://www.vim.org/tips/tip.php?tip_id=305
>
> You can get to it via $_POST['action'].
> Look for the position of the '#' using strpos(), then substr() the
> desired part from the total string.
> e.g.
>
> <?PHP
> $bookmark=false;
> if (isset($_POST['action']){
> if ($poundpos=strpos($_POST['action'],'#')!=false){
> $bookmark=substr($_POST['action'],$poundpos);
> }}
>
> if ($bookmark){
> //your code here
>
> }
>
> ?>
>
> There are other ways to get the bookmark part from the string, using
> explode() for example. This is just one idea.
> HTH
>
> Sh.
JWTDO!
Thanks both of you
--
zzapper
Best of VimTips
http://www.vim.org/tips/tip.php?tip_id=305
[Back to original message]
|