[thelist] PHP_SELF / Contact Form

DAVOUD TOHIDY dtohidy at hotmail.com
Thu Jul 29 13:50:15 CDT 2010

> Date: Thu, 29 Jul 2010 14:58:35 -0300
> From: sarahwbs at gmail.com
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] PHP_SELF / Contact Form

> Put your echo statement back in, look at the form in your browser, view
> the source, and tell us what is being output in the form action. It
> should be the same address you are viewing the form at.

o.k let me explain where the problem comes from. 

First: As I mentioned before I have my index.php file and placing and replacing
other pages such as contact.php file inside it using a configuration file
which includes an array of pages that I have defined and etc. such as 
$mypages = array("0x12" => "contact.php", etc.)

I have another page at the same level as index.php however it is an independent 
page and I am not including it inside index.php. So this page works just fine when
doing $_SERVER['PHP_SELF'];

However the problem comes when I do $_SERVER['PHP_SELF']; inside other pages
such as contact.php because I am inserting this page inside the index.php file.

after couple of updates I now have the following:

<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. 



More information about the thelist mailing list