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!
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]
I have recently started learning PHP and was wondering why this code isn't running?
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]
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]
Do you believe this should work as I've created a loop to set a value of 0 to all variables in the $counter array.
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]
Last edited by impulse() on Fri Aug 11, 2006 10:15 am, edited 3 times in total.
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]
Right, I have working code now but the code never keeps track of the variables throughout each run of the program. Is this due to HTTP being stateless?
This is the working code I have
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]
Last edited by impulse() on Fri Aug 11, 2006 10:17 am, edited 1 time in total.
You need to use sessions to track the counting over multiple requests
FYI... place error_reporting(E_ALL); at the top of your script.... you'll get notices sinc e$counter is never initialized using $counter = array(); .... I do hope your text book hasn't tought you that
I'm still on the basics doing loops, variables and arrays. I just keep getting ideas while reading and go on a mad 'n trying to get my idea working I'll hit the book again for a while and stop jumping the gun.