php-windows Digest 14 Jun 2003 19:16:09 -0000 Issue 1776
Topics (messages 20306 through 20317):
Help please: undefined index in sample code
20306 by: Stuart Felenstein
20307 by: toby z
20308 by: Stuart Felenstein
20309 by: Stephen
20310 by: Stuart Felenstein
Problem in windows
20311 by: James Stanley
Pls help- can't load GD2 extension php_gd2.dll in PHP
20312 by: Walter Ben
20314 by: Stephen
20315 by: Walter Ben
absolute include files
20313 by: dj dust
20317 by: Dash McElroy
Php_gd.dll
20316 by: Wential
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
I can't believe Chapter 1 , section 1 and I'm off to a bad start already.
Using this form and script, I keep getting "undefined index" for the variables I
declare in the script. Running PHP 4.3.2 on XP Pro. Thanks.
Stuart
Form:
<form action="processorder.php" method=post>
<table border=0>
<tr bgcolor=#cccccc>
<td width=150>Item</td>
<td width=15>Quantity</td>
</tr>
<tr>
<td>Tires</td>
<td align="center"><input type="text" name="tireqty" size="3"
maxlength="3"></td>
</tr>
<tr>
<td>Oil</td>
<td align="center"><input type="text" name="oilqty" size="3" maxlength="3"></td>
</tr>
<tr>
<td>Spark Plugs</td>
<td align="center"><input type="text" name="sparkqty" size="3"
maxlength="3"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Submit Order"></td>
</tr>
</table>
</form>
Script:
<html>
<head>
<title>Bob's Auto Parts - Order Results</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Results</h2>
<?php
//create short variable names
$tireqty = $_POST['tireqty'];
$oilqty = $_POST['oilqty'];
$sparkqty = $_POST['sparkqty'];
?>
<?php
echo '<p>Your order is as follows: </p>';
echo $tireqty.' tires<br />';
echo $oilqty.' bottles of oil<br />';
echo $sparkqty.' spark plugs<br />';
?>
</body>
</html>
--- End Message ---
--- Begin Message ---
register globals on or off ?????
--- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > I can't believe
Chapter 1 , section 1 and I'm off to a bad start
> already.
> Using this form and script, I keep getting "undefined index" for
> the variables I declare in the script. Running PHP 4.3.2 on XP
> Pro. Thanks.
> Stuart
>
> Form:
>
> <form action="processorder.php" method=post>
> <table border=0>
> <tr bgcolor=#cccccc>
> <td width=150>Item</td>
> <td width=15>Quantity</td>
> </tr>
> <tr>
> <td>Tires</td>
> <td align="center"><input type="text" name="tireqty" size="3"
> maxlength="3"></td>
> </tr>
> <tr>
> <td>Oil</td>
> <td align="center"><input type="text" name="oilqty" size="3"
> maxlength="3"></td>
> </tr>
> <tr>
> <td>Spark Plugs</td>
> <td align="center"><input type="text" name="sparkqty" size="3"
> maxlength="3"></td>
> </tr>
> <tr>
> <td colspan="2" align="center"><input type="submit" value="Submit
> Order"></td>
> </tr>
> </table>
> </form>
>
> Script:
>
> <html>
> <head>
> <title>Bob's Auto Parts - Order Results</title>
> </head>
> <body>
> <h1>Bob's Auto Parts</h1>
> <h2>Order Results</h2>
> <?php
> //create short variable names
> $tireqty = $_POST['tireqty'];
> $oilqty = $_POST['oilqty'];
> $sparkqty = $_POST['sparkqty'];
> ?>
> <?php
> echo '<p>Your order is as follows: </p>';
> echo $tireqty.' tires<br />';
> echo $oilqty.' bottles of oil<br />';
> echo $sparkqty.' spark plugs<br />';
> ?>
> </body>
> </html>
>
________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/
--- End Message ---
--- Begin Message ---
Yes, register globals are now on. Though it doesn't apparently matter.
Stuart
toby z <[EMAIL PROTECTED]> wrote:
register globals on or off ?????
--- Stuart Felenstein wrote: > I can't believe
Chapter 1 , section 1 and I'm off to a bad start
> already.
> Using this form and script, I keep getting "undefined index" for
> the variables I declare in the script. Running PHP 4.3.2 on XP
> Pro. Thanks.
> Stuart
>
> Form:
>
>
>
>
> Item
> Quantity
>
>
> Tires
> [input] > maxlength="3">
>
>
> Oil
> [input] > maxlength="3">
>
>
> Spark Plugs
> [input] > maxlength="3">
>
>
> [input] > Order">
>
>
>
>
> Script:
>
>
>
>
>
>
> Bob's Auto Parts
> Order Results
> > //create short variable names
> $tireqty = $_POST['tireqty'];
> $oilqty = $_POST['oilqty'];
> $sparkqty = $_POST['sparkqty'];
> ?>
> > echo '
Your order is as follows:
';
> echo $tireqty.' tires
';
> echo $oilqty.' bottles of oil
';
> echo $sparkqty.' spark plugs
';
> ?>
>
>
>
________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/
--- End Message ---
--- Begin Message ---
Which just goes to show some people will say anything...
I don't think this has anything to do with register globals (Sorry toby).
Undefined index sounds like php is just warning you that you are using a
variable without a value. Since you are using a form to send data, this can
occur. To be honest, its a fairly pointless warning, so you probably want to
ignore it. In your php.ini file search for and find the
error_reporting
option. I recommend you change your settings to
error_reporting = E_ALL & ~E_NOTICE
This should solve your problem.
----- Original Message -----
From: "Stuart Felenstein" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 14, 2003 10:18 AM
Subject: Re: [PHP-WIN] Help please: undefined index in sample code
> Yes, register globals are now on. Though it doesn't apparently matter.
>
> Stuart
>
> toby z <[EMAIL PROTECTED]> wrote:
> register globals on or off ?????
>
> --- Stuart Felenstein wrote: > I can't believe
> Chapter 1 , section 1 and I'm off to a bad start
> > already.
> > Using this form and script, I keep getting "undefined index" for
> > the variables I declare in the script. Running PHP 4.3.2 on XP
> > Pro. Thanks.
> > Stuart
> >
> > Form:
> >
> >
> >
> >
> > Item
> > Quantity
> >
> >
> > Tires
> > [input] > maxlength="3">
> >
> >
> > Oil
> > [input] > maxlength="3">
> >
> >
> > Spark Plugs
> > [input] > maxlength="3">
> >
> >
> > [input] > Order">
> >
> >
> >
> >
> > Script:
> >
> >
> >
> >
> >
> >
> > Bob's Auto Parts
> > Order Results
> > > //create short variable names
> > $tireqty = $_POST['tireqty'];
> > $oilqty = $_POST['oilqty'];
> > $sparkqty = $_POST['sparkqty'];
> > ?>
> > > echo '
> Your order is as follows:
> ';
> > echo $tireqty.' tires
> ';
> > echo $oilqty.' bottles of oil
> ';
> > echo $sparkqty.' spark plugs
> ';
> > ?>
> >
> >
> >
>
> ________________________________________________________________________
> Want to chat instantly with your online friends? Get the FREE Yahoo!
> Messenger http://uk.messenger.yahoo.com/
--- End Message ---
--- Begin Message ---
It's more then a warning. The script does not work. All i get back on the screen is:
Order ResultsYour order is as follows:
';echo $tireqty.' tires
'; echo $oilqty.' bottles of oil
'; echo $sparkqty.' spark plugs
'; ?>
>From what I've read though I agree that global registers is not the problem. Besides
>I've tried both ways.
Stuart
Stephen <[EMAIL PROTECTED]> wrote:
Which just goes to show some people will say anything...
I don't think this has anything to do with register globals (Sorry toby).
Undefined index sounds like php is just warning you that you are using a
variable without a value. Since you are using a form to send data, this can
occur. To be honest, its a fairly pointless warning, so you probably want to
ignore it. In your php.ini file search for and find the
error_reporting
option. I recommend you change your settings to
error_reporting = E_ALL & ~E_NOTICE
This should solve your problem.
----- Original Message -----
From: "Stuart Felenstein"
To:
Sent: Saturday, June 14, 2003 10:18 AM
Subject: Re: [PHP-WIN] Help please: undefined index in sample code
> Yes, register globals are now on. Though it doesn't apparently matter.
>
> Stuart
>
> toby z wrote:
> register globals on or off ?????
>
> --- Stuart Felenstein wrote: > I can't believe
> Chapter 1 , section 1 and I'm off to a bad start
> > already.
> > Using this form and script, I keep getting "undefined index" for
> > the variables I declare in the script. Running PHP 4.3.2 on XP
> > Pro. Thanks.
> > Stuart
> >
> > Form:
> >
> >
> >
> >
> > Item
> > Quantity
> >
> >
> > Tires
> > [input] > maxlength="3">
> >
> >
> > Oil
> > [input] > maxlength="3">
> >
> >
> > Spark Plugs
> > [input] > maxlength="3">
> >
> >
> > [input] > Order">
> >
> >
> >
> >
> > Script:
> >
> >
> >
> >
> >
> >
> > Bob's Auto Parts
> > Order Results
> > > //create short variable names
> > $tireqty = $_POST['tireqty'];
> > $oilqty = $_POST['oilqty'];
> > $sparkqty = $_POST['sparkqty'];
> > ?>
> > > echo '
> Your order is as follows:
> ';
> > echo $tireqty.' tires
> ';
> > echo $oilqty.' bottles of oil
> ';
> > echo $sparkqty.' spark plugs
> ';
> > ?>
> >
> >
> >
>
> ________________________________________________________________________
> Want to chat instantly with your online friends? Get the FREE Yahoo!
> Messenger http://uk.messenger.yahoo.com/
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello,
I just installed php/mysql on my windows machine, now when I try to run
a script I get this:
Use of undefined constant s_UID - assumed 's_UID' in
c:\inetpub\wwwroot\php_test\inc\session.php
And then some Undefined variable: s_UserInfo.
Any thought why could this be? Thanks.
James.
--- End Message ---
--- Begin Message ---
Server : Apache 2PHP 4.3.2 OS : Win XP Pro i can't load GD2 extension php_gd2.dll in
PHP , when i
start Apache , it always alert "Can't load dynamic
library php_gd2.dll" .
I'm sure that no problems in my config . When i use
other dll file such as php_java.dll, it has no errors
and works!!! Any similar cases? Bug of new version?
---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
--- End Message ---
--- Begin Message ---
>From my php.ini file:
;GD2 is used for image creation
extension=php_gd2.dll
Are you sure that the php_gd2.dll file is in the extension directory
specified? (Below is where my extension directory is, so my php_gd2.dll is
in c:\server\PHP\extensions\php_gd2.dll)
; Directory in which the loadable extensions (modules) reside.
extension_dir = c:\server\PHP\extensions
----- Original Message -----
From: "Walter Ben" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 14, 2003 2:16 PM
Subject: [PHP-WIN] Pls help- can't load GD2 extension php_gd2.dll in PHP
>
> Server : Apache 2PHP 4.3.2 OS : Win XP Pro i can't load GD2 extension
php_gd2.dll in PHP , when i
>
> start Apache , it always alert "Can't load dynamic
>
> library php_gd2.dll" .
>
> I'm sure that no problems in my config . When i use
>
> other dll file such as php_java.dll, it has no errors
>
> and works!!! Any similar cases? Bug of new version?
>
>
>
> ---------------------------------
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
--- End Message ---
--- Begin Message ---
Yes, I am trying to make GD2 work for image creation;
and I am sure that the php_gd2.dll file is in the right extension directory
specified (since some other .dll (e.g. php_java.dll and php_zip.dll) in some extension
directory works when I enable them)
I am wondering why some dll files work, but php_gd2.dll?
many thanks.
Stephen <[EMAIL PROTECTED]> wrote:
>From my php.ini file:
;GD2 is used for image creation
extension=php_gd2.dll
Are you sure that the php_gd2.dll file is in the extension directory
specified? (Below is where my extension directory is, so my php_gd2.dll is
in c:\server\PHP\extensions\php_gd2.dll)
; Directory in which the loadable extensions (modules) reside.
extension_dir = c:\server\PHP\extensions
----- Original Message -----
From: "Walter Ben"
To:
Sent: Saturday, June 14, 2003 2:16 PM
Subject: [PHP-WIN] Pls help- can't load GD2 extension php_gd2.dll in PHP
>
> Server : Apache 2PHP 4.3.2 OS : Win XP Pro i can't load GD2 extension
php_gd2.dll in PHP , when i
>
> start Apache , it always alert "Can't load dynamic
>
> library php_gd2.dll" .
>
> I'm sure that no problems in my config . When i use
>
> other dll file such as php_java.dll, it has no errors
>
> and works!!! Any similar cases? Bug of new version?
>
>
>
> ---------------------------------
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
--- End Message ---
--- Begin Message ---
hiya
I've been tearing my hair out for 2 days now trying to get this to work and
I'm sure the answer has gotta be pretty simple...
I'm using PHP for the first time and have got some pages uploaded to my live
site and they work like a dream - the problem is that they won't work
locally using PHPdev.
Every page on site uses the following include code on every page:
<?php
include($DOCUMENT_ROOT . "/include/header.htm");
?>
the theory is that no matter where you are in the site hierarchy (there's a
lot of directories within directories) it should still work.
Like I said, it DOES work fine when I upload the pages to my ISP but only
the top level files of the site work locally. If you go down into
sub-directories I get the following error:
"Warning: Failed opening '/include/header.htm' for inclusion
(include_path='.;C:/phpdev/php/includes;C:/phpdev/php/class') in
c:\phpdev\www\curve-online.co.uk\discography\official.php on line 12"
Any idea how I can get my local server working the same as my ISP server?
cheers
daz
--- End Message ---
--- Begin Message ---
daz,
This should be easy enough. First, have you checked to see if
register_globals is on or off on your local machine? It defaults to off,
so $DOCUMENT_ROOT would become $_SERVER['DOCUMENT_ROOT'].
Check a phpinfo() screen and see what variables are different between your
host and your local box. Just a simple file with only the following line:
<?php phpinfo(); ?>
will suffice.
Another thing you could do is to declare a php include directory and stuff
all your include files into there.
-Dash
On Sat, 14 Jun 2003, dj dust wrote:
> hiya
>
> I've been tearing my hair out for 2 days now trying to get this to work and
> I'm sure the answer has gotta be pretty simple...
>
> I'm using PHP for the first time and have got some pages uploaded to my live
> site and they work like a dream - the problem is that they won't work
> locally using PHPdev.
>
> Every page on site uses the following include code on every page:
>
> <?php
> include($DOCUMENT_ROOT . "/include/header.htm");
> ?>
>
> the theory is that no matter where you are in the site hierarchy (there's a
> lot of directories within directories) it should still work.
>
> Like I said, it DOES work fine when I upload the pages to my ISP but only
> the top level files of the site work locally. If you go down into
> sub-directories I get the following error:
>
> "Warning: Failed opening '/include/header.htm' for inclusion
> (include_path='.;C:/phpdev/php/includes;C:/phpdev/php/class') in
> c:\phpdev\www\curve-online.co.uk\discography\official.php on line 12"
>
> Any idea how I can get my local server working the same as my ISP server?
>
> cheers
>
> daz
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I'm running Windows 2000 Server with PHP 4.3.1; when I try to uncomment
extension=php_gd.dll it errors saying that file doesn't exist. I keep
getting told the newer versions of PHP came with Gdlib enabled and
installed. How do I install it and most importantly find that missing
php_gd.dll?
Wential
--- End Message ---