Hi, I am trying to make a code (which is a mix of Jscript and PHP) where when a person clicks on a link, it inserts the amount of recorded clicks into mysql...the code looks like this:
And here is an example hyperlink code:Code:<?php $query = "INSERT INTO clicks (click, date) VALUES('$click', '$date') "); echo "<script type='text/javascript'>"; echo "function clicks(){" mysql_query( $query ); echo "}"; echo "</script>"; ?>
But it isn't inserting the data into mysql. Why is this not working? :?Code:<a href="click.php?url=http://www.google.com" onClick="clicks()">Google.com</a>



Reply With Quote

Bookmarks