Re: Problems passing form data outside the root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Mark Crosby wrote:
> Regarding this error, I'm still having the same problem.
>
> I've visited the httpd room on IRC and posted in several forums.
>
> Here is the page I'm having problems with:
> http://www2.specialistagencyservices.co.uk/sections/needwork/test.php
>
> It links to a script that shows the variables produced by this form:
>
> <?
> echo $firstname, $surname;
> ?>
>
>
> I'm stuck - Any ideas?
>
>
>
>
> ----- Original Message ----- From: "Mark Crosby"
> <mcrosby@xxxxxxxxxxxxxxxx>
> To: <users@xxxxxxxxxxxxxxxx>
> Sent: Thursday, March 22, 2007 2:38 PM
> Subject:  Problems passing form data outside the root
>
>
>> Hi Folks!
>>
>> I've hunted high and low for a solution for this, to no avail.
>>
>> I have a standard http form on a page on my website which passes data
>> to a php script to add data to mysql.  The problem is it doesn't get
>> the data. I'm having the same problems with scripts that need
>> authentication such as username/password, as the username/password
>> doesn't get passed to the next page.
>>
>> Scripts do pass data if in the root directory of the website, but not
>> in sub directorys.
>>
>> I'm using Apache with CentOS 4 (RHEL4).  Theres nothing in the log
>> files.
>>
>> Any help would be much appreciated as I've hunted high and low for
>> the answer to this, and no one knows the answer.
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>>   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>
>>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>
>

this is probably not an apache config error, unless you are removing the
handler in certain directories, or unless you have some weird cgi based
php setup with cgiscripting only in the root.

Run php as a module,
dont save your php files with BOM, (although you can save in utf-8)
dont use short tags

<? echo "hello world"; ?>
instead use
<?php echo "hello" world"; ?> for maximum portability

globals should be off, so that when posting or using
url?firstname=hello&lastname=world

<?php
echo $firstname, ' ', $lastname;
?>

should not result in anything at all being printed to screen,

instead use the following notation

<?php
echo $_GET['firstname'], ' ', $_GET['lastname'];
?>
or


<?php
echo $_POST['firstname'], ' ', $_POST['lastname'];
?>

depending on the method your form employs which should be post for any
action which does more than retrieve data.


-- 
Matthew Farey




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux