Jump to content

Raymondo

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Posts posted by Raymondo

  1. Hi,

    I'm an absolute beginner trying to teach myself Apache, PHP and MySql. I have a PC running Windows XP and have set up a local server. The installation went reasonably well though it was rather daunting for a complete beginner. Anyway, I got things working and set off with PHP book in hand. The first few scripts worked without a problem but then came a script that was refused access with the following error message:

     

    --------------

    Forbidden

     

    You don't have permission to access /phpStuff/< on this server.

     

    Apache/2.0.55 (Win32) PHP/5.1.1 Server at localhost Port 80

    --------------

     

    phpStuff is the directory where I create my scripts and run them. It lives in a directory called

     

    D:\MyServer\Apache Group\Apache2\htdocs

     

    The script I'm running is:

     

    <?php

    if (!$_POST['submit']) {

    ?>

    <form action="<?=$_SERVER['PHP_SELF']?>" method="post">

    Enter a number: <input name="number" size="2">

    <input type="submit" name="submit" value="Go">

    </form>

    <?php

    }

    else {

    $number =$_POST['number'];

    if ($number > 0) {

    echo 'You entered a positive number';

    }

    elseif ($number < 0) {

    echo 'You entered a negative number';

    }

    else {

    echo 'You entered zero';

    }

    }

    ?>

     

    When first loaded, the if part is executed no problem. When I submit the form, I get the above message.

     

    Any help would be greatly appreciated.

    Raymondo

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.