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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zzapper

    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


  • Toby A Inkster

    #2
    Re: Can I overrule an internal bookmark eg script.php#midd le incase of error?

    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!

    Comment

    • zzapper

      #3
      Re: Can I overrule an internal bookmark eg script.php#midd le in case of error?

      On Apr 2, 3:33 pm, Toby A Inkster <usenet200...@t obyinkster.co.u k>
      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



      Comment

      • Schraalhans Keukenmeester

        #4
        Re: Can I overrule an internal bookmark eg script.php#midd le in caseof error?

        zzapper wrote:
        On Apr 2, 3:33 pm, Toby A Inkster <usenet200...@t obyinkster.co.u k>
        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

        >
        >
        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=strp os($_POST['action'],'#')!=false){
        $bookmark=subst r($_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.

        Comment

        • zzapper

          #5
          Re: Can I overrule an internal bookmark eg script.php#midd le in case of error?

          On Apr 3, 11:50 am, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
          wrote:
          zzapperwrote:
          On Apr 2, 3:33 pm, Toby A Inkster <usenet200...@t obyinkster.co.u k>
          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=strp os($_POST['action'],'#')!=false){
          $bookmark=subst r($_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


          Comment

          Working...