By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,026 Members | 1,222 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,026 IT Pros & Developers. It's quick & easy.

Can I overrule an internal bookmark eg script.php#middle in case of error?

P: n/a
Hi,
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?

--
zzapper
Best of VimTips
http://www.vim.org/tips/tip.php?tip_id=305

Apr 2 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
zzapper wrote:
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 A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 2 '07 #2

P: n/a
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
Apr 2 '07 #3

P: n/a
zzapper wrote:
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.
Apr 3 '07 #4

P: n/a
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

Apr 3 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.