PDA

View Full Version : how do i make a poll?!?


kraftwerk
06-26-2002, 03:23 PM
can someone tell me how to make a poll/survey and put it on my site? please!

Gforce
06-28-2002, 12:44 PM
CGI Script (http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=161&lngWId=6) Is a good one. Or go to http://htmlgear.lycos.com/ if you want to put up with the adds.

Need help with cgi?

g

kraftwerk
06-28-2002, 11:23 PM
yes, i do need help with CGI. i downloaded the thing that you linked me to. now i just need to know how to set it up and where to set it up. do i upload the files into the file manager or somewhere else?

Gforce
06-29-2002, 07:34 AM
Put your cgi in a separate directory to keep your web clean and files that you have granted special permission to, together where ever possible. I label mine cgi-poll for instance, under public_html of course.

Upload the files in ASCII. Binary just wont work for cgi. (I don’t know the reason - something about cr/lf or eof markers I presume)

CHMOD, change the permission for the files because the have to execute or write to. Normal html only reads and files are given read access by default. Once you get into File Manager change permission you will see where they are talking about setting them to 755/766 etc.

Remember if you make any changes to the cgi or pl files you must CHMOD them after you upload them.

To run a cgi/perl script you can run it from your browser = http://www.yourdomain.com/yourscipt.cgi

You can hyperlink to the script or to include this in one of your web pages insert this code where you want to display the poll:
<!--#include virtual="/cgi-poll/poll.pl"-->

then be sure to save the web page as a server side page, yourpage.shtml, note the file extension ‘shtml’. The server will recognize this and look for instruction.

CGI and PL don’t normally run on your computer, they run on the server. There are utilities that let you run them locally but I have not played with them.

Here is some info on includes:
http://homepages.paradise.net.nz/milhous/cgi.htm

Readme or install.txt files included may direct you to some other specifics depending on the cgi script you use. The one link we are working with has a limitation in that the files have to be in the directory that the page you are calling it from. This one : http://scrop.org/shopoll.htm doesn’t return nicely to the results. I am sure there others out there that may work for your needs. I found one for sale that looked really good but it was $125.

You can do a google for “cgi poll”

I'd be happy to help with any questions or maybe somebody here with more experiance can chime in.

I hope this helps.

g

kraftwerk
06-29-2002, 01:16 PM
"then be sure to save the web page as a server side page, yourpage.shtml, note the file extension ‘shtml’. The server will recognize this and look for instruction"
is it ok if i save my webpages as .php?

what do you mean by "CHMOD"?

"Once you get into File Manager change permission you will see where they are talking about setting them to 755/766 etc."
ok, so can i just uncheck ALL of the boxes in the Change Permissions thing and just put the 3 #'s at the bottom?

Gforce
06-29-2002, 02:09 PM
Originally posted by kraftwerk
"then be sure to save the web page as a server side page, yourpage.shtml, note the file extension ‘shtml’. The server will recognize this and look for instruction"
is it ok if i save my webpages as .php?
I really don't know if it will work. You'll have to try it. In order for the server to reconize the included it may have to be a .shtml.

what do you mean by "CHMOD"?

CHMOD is the Unix command that changes permissions. The friendly user interface is File Manager. Changing permissions is commonly refered to as the verb 'to CHMOD'.

"Once you get into File Manager change permission you will see where they are talking about setting them to 755/766 etc."
ok, so can i just uncheck ALL of the boxes in the Change Permissions thing and just put the 3 #'s at the bottom?

My browser balks at that. Yours may work just fine. As you click the fields the numbers change. I'd play with it until you get comfortable with it, you'll soon see where the numbers begin to make sense. If you use an FTP program generally you can issue the command from there or highlight and right click the file and set them to read, write, execute.

If you get an error when you go to run the script generally the first place to look is:
Permissions
Path
Upload Method ASCII/Binary?
g

kraftwerk
07-01-2002, 09:53 PM
i am extremely confused... :(

here is what part of the README file says:

set the permissions as follows:

line.jpg Default (don't change it)
poll.dat 640
poll.pl 755
polladmin.pl 755
questions.dat 640
rgb.gif Default
subs.pl Default


so, i tried to do that, but i dont know how to use the Change Permissions thing. on my browser, the Change Permission thing looks like this:
http://jamcalc.org/change_permission1.GIF

in the README file, it says to change the permission of "poll.dat" to 640. so, do i fill in the boxes like this:
http://jamcalc.org/change_permission2.JPG
or do i fill in each box with "640"?


how the heck do i do this?!?!? :(

don5408
07-01-2002, 11:46 PM
"in the README file, it says to change the permission of "poll.dat" to 640. so, do i fill in the boxes like this"

Yep, exactly like you have in those pictures, correct (if the top picture shows how you found the settings to begin with that means that the poll.dat file was already chmod 640).

As far as the Permissions boxes at the bottom being blank I find that if I just uncheck and recheck one of the boxes the numbers will show up. Once you get used to it though you wont probably wont even need to see the numbers, you'll know that 777 = all boxes checked, 755 is all of the read and execute boxes checked with the write box checked only in the user column, etc.

Things to Note:

In these three digit CHMOD numbers the first digit indicates the permissions for the owner, the second is the permissions for other members of the same "group" as the owner and third is the permissions for "others", aka the public at large.

You might also find permissions specified in rwx format (r= Read, w= Write, x =eXecute), ex: 600 = -rw-rw-rw-

In the three-digit number format the individual numbers are derived by adding up the permissions with 1=execute, 2=write and 4=read (read, write and execute = 4+2+1, aka 7)

0 = no permissions (---)
1 = execute only (--x)
2 = write only (-w-)
3 = write and execute (-wx)
4 = read only (r--)
5 = read and execute (r-x)
6 = read and write (rw-)
7 = read, write and execute (rwx)

644 (-rw-r--r--) = "I don't mind if other people can read this file, however only I should be able to run or write to/edit it"

755 (-rwxr-xr-x) = "I don't mind if other people can read or run this file, however only I should be able to write to/edit it"

777 (-rwxrwxrwx) = "Anybody can do anything they want (read, run, modify) with this file"

Hope that helps
Don

kraftwerk
07-02-2002, 01:10 AM
ok, thank you. that helps me understand how the permissions work

but, i'm still having trouble. in the README file, it says:


To incorperate the table into another web page, use a server-side-incluse (SSI),
which might look like this:
<!--#include virtual="/poll/poll.pl"-->


so i made a page (http://jamcalc.org/cgi-poll/poll.shtml) and inserted the code: <!--#include virtual="http://jamcalc.org/cgi-poll/poll.pl"-->
but when you open the page, it says [an error occurred while processing this directive]
whats wrong with this code? or is something else wrong????

Gforce
07-02-2002, 10:03 AM
don5408,
Thanks for the great tutorial on CHMOD. You should probably submit to the knowledge base: http://www.hostrocket.info/

kraftwerk,
The path you used to poll.pl is actually an address not a path. Very easy to confuse the two. Also the difference between path and address can be confusing and some instruction mix the two terms.

An address is:
http://www.jamcalc.org/cgi-poll/poll.pl

While a path is:
/home/username/public_html/cgi-poll/poll.pl

The difference is on server side includs it is looking for files resident on its own computer. While an address is a place on the internet.

If you are running your shtml in pubic_html/cgi-pol/ then all you need is poll.pl

<!--#include virtual="poll.pl"-->

Hope this works for you.

kraftwerk
07-02-2002, 03:07 PM
it still says the same thing. look: http://jamcalc.org/cgi-poll/poll.shtml

here is the code for the entire page:

<html>
<head>
<title></title>
</head>

<body bgcolor="#FFFFFF">

<!--#include virtual="poll.pl"-->

</body>

</html>

is there something missing?

Gforce
07-02-2002, 03:49 PM
I always to staight back to the cgi before I start to trouble shoot the page it is on. I went to: http://jamcalc.org/cgi-poll/poll.pl
and get this error:


Forbidden
You don't have permission to access /cgi-poll/poll.pl on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------------------------------------

Apache/1.3.26 Server at www.jamcalc.org Port 80

If you check your error logs that error message is probably listed and it should show that it was called from the shtml page. The page is probably ok. It looks to me like permission are set right on your pl or dat files. test this by setting them all to 777 if that works, then turn down the access till the script stops working. Not all servers function the same way with permission.

Try this:

line.jpg Default (don't change it)
poll.dat 766
poll.pl 755
polladmin.pl 755
questions.dat 766
rgb.gif Default
subs.pl 755

The dat usually needs write for answeres to the poll and all the pl have to execute.

Test it from the command line first before you try to execute from the shtml.

g

kraftwerk
07-02-2002, 04:33 PM
"Test it from the command line first before you try to execute from the shtml."
what does that mean?

i also changed the permissions like you said. it still doesnt work

Gforce
07-02-2002, 08:00 PM
Execute on the command line means in this case to enter http://jamcalc.org/cgi-poll/poll.pl in your browser and hit go.

It should try to run the script. If you get an error, go to your error logs in Control Panel and see what the error is.

It could be you still don't have the permission needed, it could be you uploaded the files in auto or binary. The pl files have to be uploaded in ascii.

Have you edited any of the pl script?

g