Forum Moderators: coopster & phranque

Message Too Old, No Replies

Perl vs PHP for email forms

         

Marcia

10:41 pm on Apr 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have to re-do some forms for email, and while there are a couple of tried and true Perl scripts to use for forms, at this point I'm "obsessed" with PHP and wondering if it's practical to use a PHP script for the forms just to get started with it.

Any difference between the two for that purpose, and any issues to watch out for?

Air

10:54 pm on Apr 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually it is much easier to work with PHP for forms handling than Perl. The decoding is automatically done, and variables used in a form immediately become available to the script used to process the form, very easy and flexible.

sugarkane

9:52 am on Apr 23, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There may be a simple solution I'm overlooking, but in Perl you can fetch the names of all the variables passed to a page without knowing what they're called:

[perl]
use CGI;
$query=CGI::new();
@variable_names=$query->param();
[/perl]

Is there a way to do this in PHP?

circuitjump

5:18 pm on Apr 23, 2002 (gmt 0)

10+ Year Member



Not that I know of, but in PHP you can just do this

echo "My name is ".$textfield1." and I like "$textfield2;

Where textfield1 and 2 are the names of the textfields in the form. You don't have to declare those variables. PHP passes the data automaitcally as long as you name the variable by the field name.

jatar_k

5:37 pm on Apr 23, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I am not sure but can you use $HTTP_POST_VARS and just read all the vars out of there.

Tapolyai

5:43 pm on Apr 23, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use PHP to manipulate the forms themselves for populating fields and post validation, and once submitted to return the information to DB and/or e-mailing the information.

What is it specifically you are trying to accomplish?

knight

4:39 am on Apr 24, 2002 (gmt 0)



PHP is a wonder. Take perl and make it faster to run, faster to code, more simple to code and more powerfull(more features) and you get PHP.

I use PHP daily and love it.

Knight

sugarkane

1:09 pm on Apr 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> use $HTTP_POST_VARS

Aha! Yes, that's what I was looking for. Thanks jatar.

knight

3:22 pm on Apr 24, 2002 (gmt 0)



there is also $HTTP_ENV_VARS and $HTTP_GET_VARS, the first is post and get(i think) and the second is only get.

Brendan