You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Wes Smith <we...@gmail.com> on 2012/10/23 21:45:02 UTC

[users@httpd] New PHP user requests your assistance.

I am receiving NOTICES when I run a script like this one:

<?php
echo "<p>Welcome <b>$_POST[user]</b>!</p>";
echo "<p>Your product choices are:<br>";
if (!empty($_POST[products])) {
   echo "<ul>";
   foreach ($_POST[products] as $Value) {
       echo"<li>$value";
   }
   echo "</ul>";
}
?>

The following are example of the Notices that I receive.
[image: Inline image 1]

I welcome and seek advice from those more experienced.
Thank you.
Wes Smith

Re: [users@httpd] New PHP user requests your assistance.

Posted by Marcin 'Rambo' Roguski <ra...@id.uw.edu.pl>.
> I welcome and seek advice from those more experienced.
> Thank you.
> Wes Smith

This is not a PHP forum but whatever, array keys should be used in 
parentheses unless there are statically declared variables used on
purpose (in your code they're not).

-- 
What ever happened to happily ever after?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] New PHP user requests your assistance.

Posted by Anders Johansson <an...@universumglobal.com>.
Maybe someone can unsubscribe users that spams the list? :)

-----Original Message-----
From: Hendrik Schmieder [mailto:hendrik.schmieder@jedox.com]
Sent: den 24 oktober 2012 09:07
To: users@httpd.apache.org
Subject: Re: [users@httpd] New PHP user requests your assistance.

Wes Smith schrieb:
> I am receiving NOTICES when I run a script like this one:
>
> <?php
> echo "<p>Welcome <b>$_POST[user]</b>!</p>"; echo "<p>Your product
> choices are:<br>"; if (!empty($_POST[products])) {
>     echo "<ul>";
>     foreach ($_POST[products] as $Value) {
>         echo"<li>$value";
>     }
>     echo "</ul>";
> }
> ?>
>

As already told you, this is not PHP list.
Try it with
$_POST["user"]
$_POST["products"]

And read the fine PHP manual more carefully.

    Hendrik


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


________________________________

DISCLAIMER: this message and all attachments transmitted with it are intended solely for the use of the addressee and may contain confidential information. If you have received this message in error, please notify the sender immediately by replying to the message and delete it from your computer. Any other unauthorized use is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] New PHP user requests your assistance.

Posted by Hendrik Schmieder <he...@jedox.com>.
Wes Smith schrieb:
> I am receiving NOTICES when I run a script like this one:
>
> <?php
> echo "<p>Welcome <b>$_POST[user]</b>!</p>";
> echo "<p>Your product choices are:<br>";
> if (!empty($_POST[products])) {
>     echo "<ul>";
>     foreach ($_POST[products] as $Value) {
>         echo"<li>$value";
>     }
>     echo "</ul>";
> }
> ?>
>

As already told you, this is not PHP list.
Try it with
$_POST["user"]
$_POST["products"]

And read the fine PHP manual more carefully.

    Hendrik


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] New PHP user requests your assistance.

Posted by John Iliffe <jo...@iliffe.ca>.
I'm not a PHP guru but don't you mean:

     if ( isset($_POST[products])) ....

Regards,

John
========================================
On Tuesday 23 October 2012 15:45:02 Wes Smith wrote:
> I am receiving NOTICES when I run a script like this one:
> 
> <?php
> echo "<p>Welcome <b>$_POST[user]</b>!</p>";
> echo "<p>Your product choices are:<br>";
> if (!empty($_POST[products])) {
>    echo "<ul>";
>    foreach ($_POST[products] as $Value) {
>        echo"<li>$value";
>    }
>    echo "</ul>";
> }
> ?>
> 
> The following are example of the Notices that I receive.
> [image: Inline image 1]
> 
> I welcome and seek advice from those more experienced.
> Thank you.
> Wes Smith

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org