Server not Found

I am working my way slowly through PHP5 & MySql Bible by Converse, Park & Morgan.

Working at the retirement calculator found on page 127 of that book and dealing with passing information between pages.

The html/php code is:-

[code]<FORM ACTION=”<?php echo $_SERVER[‘PHP_SELF’]; ?>”
METHOD=”POST”>

Your age now: ”>

The age at which you plan to retire: ”>

Annual contribution: ”>

Annual return: ”> %

NEST EGG: <?php echo $Total; ?>

. [/code]

When I click on the Calculate button I get
The requested URL /{$_SERVER[ was not found on this server

I am using wampserver in a windows environment

If you are just posting to yourself…

Change this: <FORM ACTION=”<?php echo $_SERVER[‘PHP_SELF’]; ?>”

To this:

WOW!!

I have never had a response in any forum as fast as this.

Thanks

Brian

Glad to help… CYA in the bitstream…

PS: did it work for you?

Oh yes!

Now I will dig into references to find out why.

Brian

One more helping item:

Look here for PHP details: http://php.net/manual/en/reserved.variables.server.php

Note: Some of these depend on your server set up. Also, you can always check out what your server is actually seeing by displaying the variable… I use this type of display for debugging:
[php]
die($_SERVER[‘PHP_SELF’]);
[/php]
This line will kill the page after displaying whatever is in the ().
So, die(“Got here”); does that or die($userid); will show what’s inside a variable…
Makes it very easy to debug if you thing a variable or value is not set correctly…

Good luck… CYA in the bitstream…

Thanks again.

Brian

Sponsor our Newsletter | Privacy Policy | Terms of Service