
-----------------------------------
Ravage
Mon Apr 14, 2003 12:13 pm

Forms
-----------------------------------
I was wondering if there is anyway to make a form without using CGI script (I know this isnt HTML but I dont know where else to put it)

-----------------------------------
Blade
Mon Apr 14, 2003 12:26 pm


-----------------------------------
you have to use some sort of scripting language... i prefer to use php, so heres an example..



Enter your name:

Enter your age:

Select one:

Girl
Boy
Man
Woman
I don't know




that is what a form may look like... and a form handler in php would look like this... although you will have to find a server that has php to be able to execute it.. but anyway, here it is
// name this accept.php so the form can find it
// also put it in the same folder..

the  tags are to show that you are starting up the php parser, echo is used to output to the screeen, and if you wanted different things posted you'd use a large if statement, or an array with a while loop. php is much like C++ like its if statements, the semicolon at the end of each line, and so on... although the variables are shows with $'s...

edit:
i would also lke to add that another really good thing about php is you can start it anywhere in an html document, and then end it, and use html for a while... even when you have php running in the document you can unlude tags using echo() like i did in my example of the form handler

-----------------------------------
yuethomas
Mon Apr 14, 2003 4:44 pm


-----------------------------------
Err, are you sure about the variables' names in PHP part? I remember you have to use $_POST['name'], $_POST['age'], etc. The method=get equivalents are $_GET['name'], $_GET['age'], etc.

-----------------------------------
Blade
Mon Apr 14, 2003 4:51 pm


-----------------------------------
yeah i'm positive... try it out man... i got it up on one of my old sites...
http://members.lycos.co.uk/devilomayhem/stuffs/form.html

edit: sometimes the servers go down... so try it later if you want to

-----------------------------------
yuethomas
Mon Apr 14, 2003 5:00 pm


-----------------------------------
It isn't much use unless you post the PHP code for us. =p

(Oh and, the script I wrote myself... it doesn't work)








It's at http://osiris.dyndns.info/newsite/sections/temp/temp.php.

-----------------------------------
Blade
Mon Apr 14, 2003 5:25 pm


-----------------------------------
i did post it... thats exactly what i was using up top, i copied and pasted it, ive been doing it that way for a long time man...

-----------------------------------
yuethomas
Mon Apr 14, 2003 5:27 pm


-----------------------------------
Oy, my bad, didn't realise they were the same thing.

But my script still doesn't work...

-----------------------------------
Blade
Mon Apr 14, 2003 5:35 pm


-----------------------------------
it works fine on my server
http://members.lycos.co.uk/devilomayhem/stuffs/temp.php
it's probably the way they have their php set up...

-----------------------------------
yuethomas
Mon Apr 14, 2003 5:43 pm


-----------------------------------
Thanks, I'll check my php.ini then.

-----------------------------------
Blade
Mon Apr 14, 2003 5:44 pm


-----------------------------------
do you have your comp running as a server?

-----------------------------------
yuethomas
Mon Apr 14, 2003 6:08 pm


-----------------------------------
Yes.

-----------------------------------
Blade
Mon Apr 14, 2003 6:20 pm


-----------------------------------
sweet... i'd like to ask you a couple question... do you have msn or aim?

-----------------------------------
octopi
Mon Apr 14, 2003 7:52 pm


-----------------------------------
Now, since the OP mentioned not using cgi script (which php, perl, c++ etc.. are.(when used over the internet)) 



That will send the form contents to your email address, downside is it uses outlook to send the form, and IE pops up a bunch of warning messages about it.

A much better solution would be to use formmail.pl by Matt Wright. 

http://www.scriptarchive.com/formmail.html

You will need perl installed to use it(on your server), but if you search on google you can find versions for php etc..

http://www.google.ca/search?q=formmail+php

-----------------------------------
Blade
Mon Apr 14, 2003 8:17 pm


-----------------------------------
perl is cgi... php isn't anything like perl

-----------------------------------
octopi
Mon Apr 14, 2003 8:35 pm


-----------------------------------
Your correct, one could also say that perl and c++ are not alike, but both can, and are used as 'cgi scripts'. 

Php is more commonly used like mod_perl is, which runs as a module linked into apache (or whatever major webserver you use.)

However you can use php in the exact same way you would call perl (and originally had to).

#!/usr/bin/php

#!/usr/bin/perl

both those assume a unix machine (with perl, and php installed into /usr/bin)
you can then follow with php code, the exact same you would with perl.

-----------------------------------
yuethomas
Mon Apr 14, 2003 10:44 pm


-----------------------------------
Well considering that I run a Windows 2000, it's not very helpful to me.  :P 

(Blade can you please ask the questions here? ^_^ )

-----------------------------------
Blade
Wed Apr 16, 2003 4:20 pm


-----------------------------------
lol... its more of a discussion but sure.. i went online and got php, i followed all the instructions for installing it to the server, but it still didnt work properly.... running it on xp should be fine, cuz i had foxserv.. but it doesnt index the files like the normal apache does, when you dont have an index file in the folder... it just says it cant find it... but i'd still like to have php on my server...

confused yet?

-----------------------------------
yuethomas
Sat Apr 19, 2003 10:38 pm


-----------------------------------
Oh... I have no experience with webservers other than Apache. So, sorry, can't help you there.  :(

-----------------------------------
Blade
Tue Apr 22, 2003 9:57 pm


-----------------------------------
Oh... I have no experience with webservers other than Apache. So, sorry, can't help you there.  :(

i was talking about installing php on apache...
