Hello! I am a 17 year old student, working on some IT-project at school. I'm not very experienced, though IT is my hobby... I said that, since I want as simple replies as possible, not like hardcore high leveled developers replies!
So, I'm 100% new to this forum, but wanted to join, simply because I'll need much help now, which I can't really get from my teacher.
Now, to the real topic:
I'm currently making a webiste (in norwegian) where one can vote to what one think is the best product (for example...)
As I don't have the whole IT vocabulary, I'm gonna have to explain what I mean in a.... N00bish way.
Heres the complete idea: I want to make the voting-part as automatic as possible. I want the user/client/whatever to just click on a picture to vote. Then the vote will be magically registered (with the clients IP as primary key???), and the client will be redirected to the main page/or the rusults page.
This is my idea, but I really need help to make it work. None of my books have anything near this to help me, nor do I know what to search for in google.
Sorry for a long and depressive post, but I hope some people can take the time and try understanding what I meant, and then lead me to the right direction
-Amund.
This is how you can do it only with php.
This is the HTML file
PHP Code:
<? //connect and select the db, get the info you need if([ip_check])//check if the ip is already in your DB. if so header('Location:[results_page]'); ?> [HTML] <html> <a href="[your_script].php?id=[unique_value_integer]"><img src="[path_to_your_image]"/></a> <a href="[your_script].php?id=[unique_value_integer]"><img src="[path_to_your_image]"/></a> //you can add more if you need </html> [/HTML]
This is the php script:
PHP Code:
<?php //connect and select the db $id=intval($_REQUEST['id']); //insert the data in your db where the id=$id header('Location:[results_page]'); ?>
This way you don't have to use radio buttons and the user will see the poll only once, if he's ip doesn't change
Nice! Thank you very much, ssdog!
Yes, I'm supposed to stick to php, as we don't have anything about javascripts at school.
I will have to study your replies a bit though, as I atm don't really understand much of it. But I'm pretty sure I will get it soon, and thank you so much for your help!
I'll reply to this thread again some time, if there will be more I need help with. Hope you get a notification then? :P
Bookmarks