Reply to Re: Php... 01 greater than 1 ???

Your name:

Reply:


Posted by purcaholic on 05/28/07 23:00

On 28 Mai, 22:43, wbrowse <wbro...@gmail.com> wrote:
> First, sorry for telling you so little with this issue and leaving it
> for so long without much care from me...
>
> Below you can find the script that made feel confused (I am an early
> Php beginner but I have to stop as for professional needs I need to
> concentrate my free time on learning VBA...) :
>
> Test it with 01 as I can't test it on my current configuration(see
> below why).
>
> ===========start==========
>
> <html>
> <head>
> </head>
>
> <body>
>
> <?php
>
> //lancer recherche $_POST['submit'] dans fichier aide PHP
>
> if (!$_POST['submit'])
>
> {
>
> ?>
>
> <form action="<?=$_SERVER['PHP_SELF']?>" method="post">
>
> Saisissez un nombre : <input name="nombre" size="2">
>
> <input type="submit" name="submit" value="Valider">
>
> </form>
>
> <?php
>
> }
>
> else
>
> {
>
> $nombre = $_POST['nombre'];
>
> if ($nombre < 0)
>
> {echo 'Vous avez saissi un nombre -';
>
> }
>
> elseif ($nombre > 0)
>
> {echo 'Vous avez saissi +';
>
> }
>
> else
>
> {echo 'Vous avez saissi un nombre neutre';
>
> }
> }
>
> ?>
>
> </body>
>
> </html>
>
> ===========end==========
>
> As I changed computer, I had to reinstall php, apache and I wanted to
> test this script again but I had this message:
>
> You don't have permission to access /arch/< on this server.
>
> The other script I run all are working (with forms...) under XP.
>
> It's no big issue for me right now as it's confusing learning 2
> languages at the same time... so I am concentrating on vba and leaving
> Php for later...

Maybe you've installed a newer PHP-Version or you've forgott to
configure PHP. I see the usage of short tags inside your script (<form
action="<?=$_SERVER['PHP_SELF']?>" method="post">).

If handling of short tags are deactivated (this is the default
setting), PHP will not parse the code <?=$_SERVER['PHP_SELF']?>.
Instead of that, the HTML output will contain it as string.

You can change this behaviour by setting "short_open_tag = Off" in the
php.ini file, which should be present either normally in C:\WINDOWS\
or inside the PHP installation directory.

But the better alternative is not to use short tags syntax and to
change your script as follows:
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">


purcaholic

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация