Simple answer... it is just a warning

When you first create a variable, you normally assign it a value. EG:

$MyVariable = "value";

However, you can (and quite often want to) not assign a value to the
variable before you use it. This is espically true in forms where the values
are sent by the user!

if ( ! empty( $MyVariable ) ) {
    print "My Variable has the value of $MyVariable";
}
else {
    print "My Variable is empty!";
}

would give you a notice warning 'Notice: Undefined variable: MyVariable in
blah blah blah on line 1. To remove this annoying feature, you will need to
edit the error reporting level in the php.ini file. Look in your php.ini
file for 'Error handling and logging'

Stephen

[php.ini - what you are looking for]

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; error_reporting is a bit-field.  Or each number up to get desired error
; reporting level
; E_ALL             - All errors and warnings
; E_ERROR           - fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often
result
;                     from a bug in your code, but it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it's automatically initialized to
an
;                     empty string)
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
;
; Examples:
;
;   - Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE
;
;   - Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
;   - Show all errors except for notices
;
error_reporting  =  E_ALL & ~E_NOTICE


----- Original Message -----
From: "David Kaplowitz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 3:11 PM
Subject: [PHP-INST] n00b - PHP on IIS 5 - Not Allowing File Writes Though
All Permissions Seem Correct


> Hi,
>
> I've installed PHP 4.2.3 on a Win2k Workstation (sp2) Box
> that is running IIS5. If I run the PHPInfo script, it gives
> me the proper HTML feedback about the server, which seems to
> say everything's fine.  I'm also successfully running
> PHPMyAdmin on the box and have successfully entered SELECT
> statements into the MySQL db using that.
>
> But, if I try to run any kind of script that requires writing
> to a file, (with or from a variable for instance - see
> example script lines below), it seems to fail with a
> "Notice: Undefined variable: YourName in
> C:\inetpub\wwwroot\test4.php on line 10" error.
>
> [Note: HPNuke on the same box is giving very similar type
> output in spades, though it knew enough to populate the MySQL
> db upon the first page load.]
>
> I have read the install files and the FAQ for anything
> closely resembling this, I've checked all the permissions on
> every file/folder referenced, and have given full access to
> the I_USER account to most or all of it.  (read and exec. at
> the minimum), but nothing seems to kick this sucker into
> gear.
>
> Any ideas?
>
> *dons flame suit*
>
> TIA
>
> P.S.  Here's the script in the HTML page (test4.html) that's
> that's trying to write to "test4.php" from the above line
> (this script works on a properly configured server that my
> web host has):
>
> <form action="test4.php" method=post> My name is: <br>
> <input type="text" name="YourName">
> <input type="submit" name="submit" value="Enter My Data!">
> </form>
>
> =====
>
>
> __________________________________________________
> Do you Yahoo!?
> HotJobs - Search new jobs daily now
> http://hotjobs.yahoo.com/
>
> --
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to