I want to write a page with a limited feedback form - basically a yes/no poll with postcodes able to be logged. I've seen (and got) code (PHP) for a poll. Anyone got advice on a better or easier way to do it. Even better, anyone got any script that already fulfills this function. I'm not a techie so please go easy on me...
Replace {pollname} with the name of the poll. We'll use it to record values.
Now, make the file, "poll.php". Inside write this:
PHP Code:
<?php
// This creates the file that holds the poll data, if it doesn't exist. It uses the OPTIONS element from the form to figure out how many possibilities there should be.
if (!file_exists($POST['poll'].'.dat')) {
$file = fopen($POST['poll'].'.dat','a+');
for ($i=0;$i<$_POST['options'];$i++) {
fwrite($file,$i.'=0'."\n");
}
fclose($file);
}
PHP = free and easy.
ASP = corperate and horrible
CGI = nice, but without cookies the users is ignored
I think that answers your question, PHP is the easiest and its free, it also has the fewest reported bugs and known errors.
ASP is a coperate thing, mircosoft would put up patent on serverside technology to stop people from ignoreing ASP if they could, luckily they didn't develop it.
CGI is nice, but unlike ASP and PHP you don't have easy methods of setting up cookies if the user don't have them enabled, a reason why many CGI sites that require cookies get less visitors.
If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
The same applies to HTML and the forums [HTML][/HTML] tags.
Originally posted by scragar CGI = nice, but without cookies the users is ignored
...
...
...
CGI is nice, but unlike ASP and PHP you don't have easy methods of setting up cookies if the user don't have them enabled, a reason why many CGI sites that require cookies get less visitors.
Hi, scragar...
Would you mind explaining the above? Being a Perl CGI scripter, myself, I don't really understand what you are saying.
And me having been working with ASP for several years, I also dont know what your saying. You also didnt mention the two most powerful and industry-leading technologies, being the .NET framework and JSP.
Your statement is incorrent, though. It comes off making you look ignorant. You let very uneducated quarrels get in the way. ASP is free and easy to setup. ASP (and especially .NET) offer fantasitc security options/tools -- they have to considering their technologies are among the industry leaders.
Other than reading from yourselves and gleaning info gradually from you, is there anywhere i can learn PHP to be able to add interactivity to my site myself? Any read made resources?
The best way is to buy a book. Or atleast borrow one from a local library. Resources on the WWW are often outdated and/or incorrect -- not to mention incomplete.
Bookmarks