473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
4 1491
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: weiwei | last post by:
Hi, I am having trouble with http 500 internal error. I have develope several dynamic pages, it works fine on our intranet server, however, when I migrated into our external IIS server, most of...
5
by: NG | last post by:
Hi, We are having DB2-V7.2 DB on AIX 5.2 machine. Recently we upgraded our system to fixpack 13 and activated activate AIX asynchronous IO function. Our DB is going to crash recovery with...
1
by: timVerizon | last post by:
Hoping someone can help here.. Our application (C#.Net) was receiving IBM.Data.DB2.DB2Exceptions ERROR SQL0904N Unsuccessful execution caused by an unavailable resource. Reason code: '', type...
16
by: pj | last post by:
(Was originally, probably wrongly, posted to the vc subgroup.) (This doesn't appear to be a c# problem, but a problem with a bug in the Visual Studio c# compiler, but, any help will be welcome...)...
1
by: Ayende Rahien | last post by:
reparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error (0xc0000005 at address 53168B12): likely culprit is 'BIND'. An internal...
1
by: pj | last post by:
Oh, I forgot to list the error messages; I would be delighted if someone could explain how to deduce which line number in which file is the one that the VC compiler cannot handle. Actually I'm...
2
by: mike_li | last post by:
On Window 2000 Professional Server DB2 UDB Level: DB2 code release "SQL07029" with level identifie "030A0105" and informational tokens "DB2 v7.1.0.98", "n040510" and "WR21337". In the...
1
by: magnogreato | last post by:
OS=WIN XP HOME ED. I need to download marine mapping from NOAA but can't because I need to have Java Script installed. Problem: Whenever I download offline(Sun's reccommended method) "any"...
8
by: jayavidya | last post by:
Whenever I run the PHP script on the browser, a script error : "Object not found" is generated. The script I'm working on is syntactically correct. How can I detect this error in the code?
2
Frinavale
by: Frinavale | last post by:
I thought it would be nice to share the solution to my IIS headache with the rest of the world. I have developed a web application that has been distributed. Upon installing my application, some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.