image counter

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

lnt
Forum Newbie
Posts: 12
Joined: Mon Sep 24, 2007 8:47 am

Post by lnt »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Code: Select all

MYSQL_QUERY("INSERT INTO counter VALUES ('', '$name', '2')")
Do you want to write:

Code: Select all

MYSQL_QUERY("INSERT INTO counter (field1, field2, field3) VALUES ('', '$name', '2')")

Code: Select all

<script type="text/javascript" src="myCount.php"></script>
Attribute "src" of script element must be a script file including javascript statements. but your php file echoes some img tags.

Try this

Code: Select all

for ($i = 0; $i < strlen($count); $i++) {
    echo "var img=document.createElement('img');";
    echo "img.src=\"$url$count[$i]$style$ending\";";
    echo "document.body.appendChild(img);";
}
Use firebug to debug your script in firefox before posting a question here :)


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Nanaosei
Forum Newbie
Posts: 9
Joined: Sat Sep 22, 2007 7:01 pm

image counter

Post by Nanaosei »

I try your suggustion but nothing show up on the index.html page
lnt
Forum Newbie
Posts: 12
Joined: Mon Sep 24, 2007 8:47 am

Post by lnt »

Sorry, I copied your code but I did not see strlen($count). It must be $count in the for loop.
Post Reply