"Michal Wozniak" <mikiwoz_remove_this@yahoo_remove_this.co.uk> wrote in
message news:d4nat8$o3g$1@213-238-75-8.adsl.inetia.pl...[color=blue]
> One quick glance of an experienced eye allowed to understand the blurred
> and almost unreadable Greg A's handwriting:
>[color=green]
>> Hi:
>>
>> I have my index.php page.
>>
>> For the header, sidebar, and footer, those are separate php pages that
>> I call into the index.php page.
>>
>> My sidebar.php page has a form in it, that works fine if I load the
>> page by itself. However when I try to use it in the index.php page
>> being called by an include, it doesn't work.
>>
>> Is there a way to make it so it does work? I think there may be some
>> way to use $_GET to make this work, but I'm not quite sure how to
>> implement it.
>>
>> Thanks!
>>
>> Here is my code just incase it's needed:
>>
>> <?
>>
>>
>> $form_block = "
>> <TABLE border=1><TR><TD align=center>
>>
>> <FORM METHOD=\"POST\" ACTION=\"$PHP_SELF\">[/color]
>
> Something's fishy about the above line... If you want the form to send
> the values to the same file that's the form in, you should use
> $_SERVER['PHP_SELF'], unless of course you have register_globals set to
> on in php.ini - which is NOT a good idea.
> However, IF you have register_globals on, it SHOULD work. Could you post
> what exactly happens - what page get's loaded upon submiting the form,
> or that no page is loaded, or watever else actually happens? That could
> help to track down the problem.
>[color=green]
>> <snip>[/color]
>
> Cheers
> Mike[/color]
Hi:
Let me start off with the problem I was running into (which I should have
mentioned previously).
Well the error I'm getting is:
Http 405 - Resource not allowed
Internet Information Services.
(I'd rather use Apache, but I don't have a choice)
I saw this page which explained stuff about the error:
http://www.somacon.com/blog/page26.php
However, my settings seem to be fine. And as I mentioned, the sidebar.php
page processes fine if I load it by itself rather than in an include.
If I make the action a separate PHP file, rather than php_self, it also
works fine. But I don't want an entire new page to load. I just wanted the
page to stay where it is.
I looked into what you said, and my register global is set to off.
I tried changing the line to: <FORM METHOD=\"POST\"
ACTION=$_SERVER['$PHP_SELF']>
However when I do that, I get this error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in C:\Inetpub\wwwroot\new\sidebar.php
on line 72
Still lost.....
I was also simply using <? include 'sidebar.php'; ?>, perhaps this needs to
be more elaborate?
Thanks!