At 11:58 PM 2/18/2008, Susan Shemin wrote:
thanks, Mike and Ken

first off, I'm not using a form (so no POST); the link is in an anchor tag. I could put a form around it, but that seems to me making a simple link complex.

You don't understand. The POST method is defined in the AJAX code you write, it has nothing to do with having a form or not.


I want to run this php code when the link is clicked

 $webpage="";
 $link_clicked="";

Function capture_click($webpage,$link_clicked)
{
     $entry_date=date("m-d-y-H-i");

      $sql = "INSERT INTO click_details " .
"SET webpage='$webpage', link_clicked='$link_clicked', entry_date='$entry_date'";
      $ok = mysql_query($sql);
      if ($ok) {
        //error checking
      }
}
?>

and then the anchor text (or how I guessed would work)

<a href=www.nyphp.org onclick="<?php capture_click(name_of_my_webpage,link_name); ?>";>info on PHP</a>

But, Austin, is correct, you don't need AJAX here.

Ken
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to