Jump to content

newb seeking advice


pzieye
 Share

Recommended Posts

hey everyonefirst of all, yup, I'm a newb. I used to be in the scene back when I had 12 y/o, when php was just getting popular.however, my interests ended up going somewhere else and now I know 0, so I'm sorry for seeking advice on such a trivial matter.That being said, I'll explain the situation.I want to make a website with a statistical purpose. I'll show people different images and ask them to click on just one.After making them clicking, I want to refuse any more votes from the same IP. I also want to count the votes gotten for each image (x+1, have it stored on local for example) and if possible generate a graphic bars with these as percentage.My doubt is, what languages should I study to have this idea rolling? HTML+JS, PHP, or what?I don't really know which is better for this particular scenario. I guess one of the main goals would be "compatibility/accessibility" since this is also (perhaps mainly) for that "common" people which uses IE (with no plugins or whatever). I don't know if I'm explaining myself clearly but I think the main idea is there. On a special note, the webhosting program (support for php, mysql, etc) won't be a problem..Thanks- pzieye

Link to comment
Share on other sites

This sounds mostly like HTML and PHP. You could use SQL, but it's just as easy to use the file system. If you want to learn SQL, you could use that also. Here's how I'd do it:1. The html page will send a form to a PHP script.2. The script will open a flat file that stores a list of IP numbers that have already participated. If the incoming IP is not there, the script will add it and close that file.3. Now the script will open a second file. This one is just a series of numbers: one number for each vote. Read the whole file into an array, increment the correct item, then write the data back to the file.4. PHP has some built-in graphics library that could help you generate your graphs. It might be just as easy to have PHP generate graphics in HTML using very small gifs (1px by 20px). For every one or ten votes (or whatever), add another gif. That makes the bar grow longer/taller by 1px (or whatever).Eventually you'll want to learn javascript and sql. If this is something you want to seriously get into, you can't live without them.

Link to comment
Share on other sites

So it's preferable to use PHP instead of JS?
Preference has nothing to do with it. Javascript affects things in the browser. PHP runs on the server. If you're collecting votes from multiple clients, the data can only stored on a server. That means using a server-side script like PHP.
Link to comment
Share on other sites

Preference has nothing to do with it. Javascript affects things in the browser. PHP runs on the server. If you're collecting votes from multiple clients, the data can only stored on a server. That means using a server-side script like PHP.
ah, gotcha. thanks
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...