Action before clicking a link

Discussion in 'Perl Misc' started by lg, May 8, 2007.

  1. lg

    lg Guest

    I have the following code (scaled down from complete code):


    [snip]
    print "Press link below to go to next level";
    print '<form action="http://thisandthat.com" method="post">';
    print "</form>";
    [snip]

    When user clicks the link he then goes to the page link point to.
    I would like to save info that the user has clicked the link.
    How do I do that?
    lg, May 8, 2007
    #1
    1. Advertising

  2. lg <> wrote:

    > Subject: Action before clicking a link



    before clicking.


    > When user clicks the link



    after clicking.

    Which is it?


    > How do I do that?



    In the first case, by accurately predicting the future.

    In the later case, by putting the appropriate code it the
    resource at the end of the link.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, May 8, 2007
    #2
    1. Advertising

  3. lg wrote:
    > I have the following code (scaled down from complete code):

    [snip]
    > print "Press link below to go to next level";
    > print '<form action="http://thisandthat.com" method="post">';
    > print "</form>";
    > [snip]
    >
    > When user clicks the link he then goes to the page link point to.
    > I would like to save info that the user has clicked the link.
    > How do I do that?


    Yor print() statements look correct to me. Beside that is there anything
    else related to Perl that you like to discuss?

    jue
    Jürgen Exner, May 8, 2007
    #3
  4. lg

    Brian Wakem Guest

    lg wrote:

    > I have the following code (scaled down from complete code):
    >
    >
    > [snip]
    > print "Press link below to go to next level";
    > print '<form action="http://thisandthat.com" method="post">';
    > print "</form>";
    > [snip]
    >
    > When user clicks the link he then goes to the page link point to.
    > I would like to save info that the user has clicked the link.
    > How do I do that?



    Point to a script which redirects after logging.


    --
    Brian Wakem
    Email: http://homepage.ntlworld.com/b.wakem/myemail.png
    Brian Wakem, May 8, 2007
    #4
  5. lg

    Xicheng Jia Guest

    On May 8, 5:36 am, lg <> wrote:
    > I have the following code (scaled down from complete code):
    >
    > [snip]
    > print "Press link below to go to next level";
    > print '<form action="http://thisandthat.com" method="post">';
    > print "</form>";
    > [snip]
    >
    > When user clicks the link he then goes to the page link point to.
    > I would like to save info that the user has clicked the link.
    > How do I do that?


    my question:
    1) There is no link, just an empty form
    2) Can you use 'GET' instead of 'POST'

    You might also want to check Javascript's onChange handler if you dont
    like a 'submit' button

    Regards,
    Xicheng
    Xicheng Jia, May 8, 2007
    #5
  6. lg

    lg Guest

    Brian Wakem <> wrote:

    >lg wrote:
    >
    >> I have the following code (scaled down from complete code):
    >>
    >>
    >> [snip]
    >> print "Press link below to go to next level";
    >> print '<form action="http://thisandthat.com" method="post">';
    >> print "</form>";
    >> [snip]
    >>
    >> When user clicks the link he then goes to the page link point to.
    >> I would like to save info that the user has clicked the link.
    >> How do I do that?

    >
    >
    >Point to a script which redirects after logging.


    Thank for the tip.
    How do I do the redirecting?
    lg, May 9, 2007
    #6
  7. lg

    Brian Wakem Guest

    lg wrote:

    > Brian Wakem <> wrote:
    >
    >>lg wrote:
    >>
    >>> I have the following code (scaled down from complete code):
    >>>
    >>>
    >>> [snip]
    >>> print "Press link below to go to next level";
    >>> print '<form action="http://thisandthat.com" method="post">';
    >>> print "</form>";
    >>> [snip]
    >>>
    >>> When user clicks the link he then goes to the page link point to.
    >>> I would like to save info that the user has clicked the link.
    >>> How do I do that?

    >>
    >>
    >>Point to a script which redirects after logging.

    >
    > Thank for the tip.
    > How do I do the redirecting?



    http://search.cpan.org/~lds/CGI.pm-3.29/CGI.pm#GENERATING_A_REDIRECTION_HEADER


    --
    Brian Wakem
    Email: http://homepage.ntlworld.com/b.wakem/myemail.png
    Brian Wakem, May 9, 2007
    #7
  8. lg <> wrote:

    > How do I do the redirecting?



    Your Questions is Asked Frequently:

    perldoc -q redirect

    How do I redirect to another page?


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, May 9, 2007
    #8
  9. lg

    lg Guest

    Brian Wakem <> wrote:

    >lg wrote:
    >
    >> Brian Wakem <> wrote:
    >>
    >>>lg wrote:
    >>>
    >>>> I have the following code (scaled down from complete code):
    >>>>
    >>>>
    >>>> [snip]
    >>>> print "Press link below to go to next level";
    >>>> print '<form action="http://thisandthat.com" method="post">';
    >>>> print "</form>";
    >>>> [snip]
    >>>>
    >>>> When user clicks the link he then goes to the page link point to.
    >>>> I would like to save info that the user has clicked the link.
    >>>> How do I do that?
    >>>
    >>>
    >>>Point to a script which redirects after logging.

    >>
    >> Thank for the tip.
    >> How do I do the redirecting?

    >
    >
    >http://search.cpan.org/~lds/CGI.pm-3.29/CGI.pm#GENERATING_A_REDIRECTION_HEADER


    Thank you. I got it working.
    lg, May 9, 2007
    #9
  10. lg

    Joe Smith Guest

    lg wrote:

    > When user clicks the link he then goes to the page link point to.
    > I would like to save info that the user has clicked the link.
    > How do I do that?


    Have the link invoke a CGI that does a re-direct.
    That info will show up in your access_log.

    http://www.inwap.com/mybin/list-files.pl?goto.cgi

    -Joe
    Joe Smith, May 10, 2007
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page