[thelist] PHP_SELF / Contact Form

Nan Harbison nan at nanharbison.com
Thu Jul 29 14:06:33 CDT 2010

After years of creating forms on websites, I found out that if the action is
just staying on the same page, you can actually leave off the:
action="<?php echo $_SERVER['PHP_SELF']; ?>
and just have:
<form name="mycontactForm"  method="get" >

Who knew?

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Jens Brueckmann
Sent: Thursday, July 29, 2010 2:57 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] PHP_SELF / Contact Form

> <form name="mycontactForm"  action="<?php echo $_SERVER['PHP_SELF']; ?>
method="get" >
> HTML source output  action="index.php"
> so while my contact.php file is located inside mypages folder one level
below index.php what should
> I do so the contact form works just fine.

Hi Davoud,

as the action attribute of your form will always have the same value,
there is no need to insert the value as a variable.
Just write action="contact.php" and your form should work.



Jens Brueckmann

* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt ! 

More information about the thelist mailing list