| shimmyshack 2007-04-24, 1:21 am |
| On 23 Apr, 19:59, G...@steric.net wrote:
> Have the following configuration.
> php 5.2.0
> apache 2.2.4
>
> The following submission, before I did a major upgrade back in
> February, worked fine with localhost,
> and will still work fine in a server enviornment,anything from jatol,
> to godaddy.
>
> ....
> <form name='fmSubmittal' method='post' action="<?php
> $_SERVER['PHP_SELF']; ?>">
> <table border='3'>
>
> <tr><td colspan='4' align='center'><button type='submit'
> value='SUBMIT' name='sub1'>SUBMIT</button><button type='reset'
> value='reset' name='res'>Reset</button></tr>
>
> if (isset($sub1)) { //$CommA is the submit button
> session_register('chosen');
> include 'autunite/dConn.php';
> include 'autunite/Ser.php';
> $szInterests=sizeOf($Int);
> echo "# of interests is, $szInterests or sizeOf($Int)";
>
> ....
>
> BUT, when developing on my local machine (localhost), I get the
> following message when submitting a form, using the variable action
> above. $_SERVER['PHP_SELF']
>
> Forbidden
> You don't have permission to access /dt/< on this server.
>
> Starting with "?php... " makes the Forbidden error go away, but
> doesn't process the form. (yes, I included some of the variables in
> session_register). The series of code, however, processes. Not even
> that echo, echoes like it is supposed to.
>
> putting <?= in front results in the same FORBIDDEN error, with the
> http line reading,http://localhost/dt/%3C?=$_SERVER['PHP_SELF'];%20?%3E
>
> Is there a change in either the httpd file or php.ini, I'm missing?
> It worked fine before the overhaul, and might of, even after it.
>
> Everything works, as expected, on the server side. But don't want to
> upload small changes every time to see if it works, lol.
>
> any ideas????
do you mean
action="<?php echo $_SERVER['PHP_SELF']; ?>"
whereas you have
action="<?php $_SERVER['PHP_SELF']; ?>"
which doesnt print anything, and so there tried to post back to
whatever the URL is which in your case is /dk/ - your localhost is set
up not to use index.php - add
directoryindex index.php
to your conf file, so it tries presumably to post to the default page
which doesnt exist, index.htm/l?
anyway you cant use short tags in this version of php (well shouldnt )
and its probably disabled by default, get away from <?= if you can
instead always use <?php echo instead to future proof your code.
|