Search found 3 matches

by GeoTrail
Fri Jun 06, 2003 6:36 pm
Forum: PHP - Code
Topic: PHP variables in JavaScript
Replies: 3
Views: 1308

Never mind. I figured out what I did wrong :oops: <?php // PHP Script echo "document.write("Hits $hits");"; ?> &lt;html&gt; &lt;head&gt;&lt;title&gt;Test counter&lt;/title&gt;&lt;/head&gt; &lt;body&gt; &lt;script src="http:...
by GeoTrail
Fri Jun 06, 2003 6:20 pm
Forum: PHP - Code
Topic: PHP variables in JavaScript
Replies: 3
Views: 1308

Didn't work :cry: Here's what I got so far. Did I change the JS var correctly? Remember I'm not very good with javascript :lol: <?php if (isset($id)) { $query=mysql_query("UPDATE counter SET hits=hits+1 WHERE id='$id'"); $tmp = mysql_query("SELECT hits FROM counter WHERE id='$id'"...
by GeoTrail
Fri Jun 06, 2003 5:40 pm
Forum: PHP - Code
Topic: PHP variables in JavaScript
Replies: 3
Views: 1308

I've got a question on using JS with PHP. I've made a simple counter using PHP and MySQL. Now I need to be able to use it with a html page using JavaScript. I have tried everything I can think of, but maybe someone could help me out with this. Here is what the html page looks like: <!-- File: test.h...