Action link

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

    Action link

    Greetings,

    Does anyone have a solution for this problem:

    - I would like a PHP script to execute an action before a user clicks
    on a link (updating the value of a variable, for instance).

    Is there an easy way to do this?

    Thanks,
    Mark

  • Carl Vondrick

    #2
    Re: Action link

    Mark Towner wrote:[color=blue]
    > - I would like a PHP script to execute an action before a user clicks
    > on a link (updating the value of a variable, for instance).[/color]

    What do you mean? A PHP script is only executed when it is told to so by
    eihter Apache (via the user), a cron job, or some other method.

    What are you trying to accomplish? If you want to just update a variable,
    put it at the top of the script.
    [color=blue]
    > Is there an easy way to do this?[/color]

    A few:
    - Just put it at the top of the script
    - Cron jobs (scheduled tasks)
    - Ajax/JS

    Carl
    [color=blue]
    > Thanks,
    > Mark[/color]

    --
    Carl Vondrick
    Web-Engineer
    Professor of Computer Science at Columbia University, researching computer vision, machine learning, and AI applications.

    Comment

    • Jerry Stuckle

      #3
      Re: Action link

      Mark Towner wrote:[color=blue]
      > Greetings,
      >
      > Does anyone have a solution for this problem:
      >
      > - I would like a PHP script to execute an action before a user clicks
      > on a link (updating the value of a variable, for instance).
      >
      > Is there an easy way to do this?
      >
      > Thanks,
      > Mark
      >[/color]

      Mark,

      If I understand your question correctly, no, you can't do anything before the
      user clicks on a link. PHP is server-side only, and nothing happens until the
      user does something to request the page.

      It sounds like you need something client-side, like javascript.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      Working...