New to php coding,
Moderator: General Moderators
New to php coding,
hello,
I am new to php coding. Can i put a php coding in a html file?
Becaue i want to get a code that give you the amount of times the page has been accessed also download. How can i find that and do it on my files?
Thanks
I am new to php coding. Can i put a php coding in a html file?
Becaue i want to get a code that give you the amount of times the page has been accessed also download. How can i find that and do it on my files?
Thanks
You can put PHP inside of an HTML file, but in order to be executed the file extention would have to be changed from .HTML to .PHP, and then ran on a php enabled webserver.
Tracking visits and downloads can be done by cookies or database. Database would be the most reliable as cookies can easily be deleted or not enabled.
Tracking visits and downloads can be done by cookies or database. Database would be the most reliable as cookies can easily be deleted or not enabled.
I was not thinking along the lines of a hit counter, but rather showing how many times a single user has accessed the page.shiznatix wrote:cookies? how the heck can you have a hit counter with cookies?
the most easy way to do those things is with a flat txt file but the best way it with a database
such as a 'You have visited this page 7 times.' type of deal.
I probably should've specified that, I most likely confused him
First you need to set up a database.
PHPMyAdmin is a wonderful tool for creating databases using a web interface.
-- Your web host most likely has this installed already. Go to your control panel > databases > PHPMyAdmin
Then you need to learn how to perform queries to add to, update, and delete from your database.
http://www.mysql.com is a great resource for one of the most common types of databases -- MySQL.
I couldn't just give you an example of code (probably what you're looking for) because the question is so generic.
PHPMyAdmin is a wonderful tool for creating databases using a web interface.
-- Your web host most likely has this installed already. Go to your control panel > databases > PHPMyAdmin
Then you need to learn how to perform queries to add to, update, and delete from your database.
http://www.mysql.com is a great resource for one of the most common types of databases -- MySQL.
I couldn't just give you an example of code (probably what you're looking for) because the question is so generic.
http://www.php.net
http://www.mysql.com
http://www.phpmyadmin.net
http://www.google.com
are your friends. =)
also you should google for a simple database tutorial, read it, reread it, then practice it.
it will teach you tons
http://www.mysql.com
http://www.phpmyadmin.net
http://www.google.com
are your friends. =)
also you should google for a simple database tutorial, read it, reread it, then practice it.
it will teach you tons
Last edited by s.dot on Fri Aug 05, 2005 1:28 pm, edited 1 time in total.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.