[prev in list] [next in list] [prev in thread] [next in thread]
List: php-windows
Subject: Re: [PHP-WIN] Newbie working with PHP 5.0, IIS, Win2000
From: Sudeep Zamudra <sudeep_zamudra () yahoo ! com>
Date: 2004-08-18 9:08:46
Message-ID: 20040818090846.5015.qmail () web53307 ! mail ! yahoo ! com
[Download RAW message or body]
Hi chuck,
As far as the "Notices" are concerned you can disable it from php.ini configuration file.
Regards,
SuDeEp
Chuck <cmorris@threesource.tv> wrote:
Hello everyone. Hopefully someone can help me with this.
I was able to install PHP successfully. I tried a sample script and it
worked fine through IE. I then tried to create a script that would pass a
value on to another script using the post method. These are called Pass.php
and Pass1.php.
Pass.php contains the following.
Name: [input]
Email: [input]
[input]
Pass1.php contains the following.
// Available since PHP 4.1.0
echo $_POST['username'];
echo $_REQUEST['username'];
import_request_variables('p', 'p_');
echo $p_username;
// Available since PHP 3. As of PHP 5.0.0, these long predefined
// variables can be disabled with the register_long_arrays directive.
echo $HTTP_POST_VARS['username'];
// Available if the PHP directive register_globals = on. As of
// PHP 4.2.0 the default value of register_globals = off.
// Using/relying on this method is not preferred.
echo $username;
?>
This is the output I received from this.
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
PHP Notice: Undefined index: username in C:\Web\Pass1.php on line 4
PHP Notice: Undefined index: username in C:\Web\Pass1.php on line 5
PHP Notice: Undefined variable: p_username in C:\Web\Pass1.php on line 8
PHP Notice: Undefined variable: HTTP_POST_VARS in C:\Web\Pass1.php on line
13
PHP Notice: Undefined variable: username in C:\Web\Pass1.php on line 19
I then replaced Pass1.php with the following code to check for any data that
was being posted.// This will check for posted values
$empty = $post = array();
foreach ($_POST as $varname => $varvalue) {
if (empty($varvalue)) {
$empty[$varname] = $varvalue;
} else {
$post[$varname] = $varvalue;
}
}
print "
";
if (empty($empty)) {
print "None of the POSTed values are empty, posted:\n";
var_dump($post);
} else {
print "We have " . count($empty) . " empty values\n";
print "Posted:\n"; var_dump($post);
print "Empty:\n"; var_dump($empty);
exit;
}
?>
This supplied the following output.
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
// This will check for posted values
None of the POSTed values are empty, posted:
array(0) {
}
I would really appreciate if someone could help me figure out what is going
on.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic