SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Problem with initializing variables

    Hello,

    I am trying to execute the script found at www.dvdtraffic.com/order2.php

    Whenever I bring up the page the variables $Price_1 and $Price_2 are initialised with html text and a large warning message appears indicating that the variables are undefined.

    If I enter numbers into the fields and then click on the large warning text (meant to be a calculate button), the script executes ok.

    I am not sure why the variables have rubbish in them or how I should initialise them.

    thankyou,
    Darren Schembri

  2. #2
    SitePoint Member
    Join Date
    Jun 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Because your script will calculate the 2 variables while they are blank: blank + blank = BIG ERROR

    So, in your script you have to define the variables $Price_1 and $Price_2 as for example:

    $Price_1 =0;
    $Price_2 =0;

    Before outputing your page.

    That what I think is solving your problem.

    Thanks,,

  3. #3
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The message is harmless.

    In your php.ini file you will have an error reporting section. Check that this line is uncommented and the others are commented out.

    error_reporting = E_ALL & ~E_NOTICE
    Torrent_ski
    Ski-Info-Online
    Ski-Info-Online Forums
    The complete ski and snowboarding information site


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
  •