SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm using this piece of code in a mailform:
    //----------------------------------------------------
    <? if ($notall == 1) { ?>
    <!-- If the variable is set, this will be output, if not it won't -->
    <P><FONT COLOR="red">Please fill out the form completely</FONT></P>
    <? } ?>

    <FORM ACTION="contact.php" METHOD=POST NAME="contactform" onSubmit="return validate(this);">
    Name: <INPUT TYPE="text" SIZE="50" MAXLENGTH="50" NAME="name" VALUE="<? echo $name; ?>"><BR>
    Email: <INPUT TYPE="text" SIZE="50" MAXLENGTH="50" NAME="email" VALUE="<? echo $email; ?>"><BR>
    Your Comments:
    <TEXTAREA COLS="55" ROWS="8" NAME="comments"><? echo $comments; ?></TEXTAREA>
    <INPUT TYPE="submit" NAME="submit" VALUE="Send Message">
    <INPUT TYPE="reset" NAME="reset" VALUE="Reset">

    </FORM>
    //-----------------------------------------------

    If I run this on my local server (win32; apache + php4) then i get the error:
    "Warning</b>: Undefined variable: notall in ..."
    "Warning: Undefined variable: name in ..."
    "Warning: Undefined variable: email in ..."
    etc...

    but if I upload this code to our unixhosting service, then all this code doesnt produce an error, it actually works!

    I looked at both php.ini files: mine, and the unixserver, and i see no imortant differences...

    What am I missing here ?

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Washington State
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This has to do with your level of Error Reporting. The following should give you errors :
    Code:
    echo $array[key];      // Initially looks for existing static var named key, which is undefined.
    if ($a == '')          // as $a is undefined if this is true ...
    print $a;              // if not defined, will give error
    The E_NOTICE setting causes this. This setting isn't normally used during production use. Either adjust code accordingly (something like if (isset($var)) { print $var; } ) or turn down error reporting. See :

    http://www.php.net/manual/en/functio...-reporting.php
    http://www.php.net/manual/en/phpdevel-errors.php

    The setting is in php.ini and is called "error_reporting"

  3. #3
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you VERY MUCH !!

    I compared those two php.ini files, and appearantly, I looked over the option... :-)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •