undefined index
<p>I transferred a file from my server that works well on the internet to my local computer.</p>

<p>And it throws a lot of undefined index for my variables, </p>

<p>please tell me what could be the problem as it works well on the internet and not working locally</p>

<p>below is the error and related code</p>

<blockquote>
  <p>"Notice: Undefined index: Add in
  /Users/mgltd/Sites/reacheasy/youraccount.php on line 27 Notice:
  Undefined index: Sname in /Users/mgltd/Sites/reacheasy/youraccount.php
  on line 30 Notice: Undefined index: Pname in
  /Users/mgltd/Sites/reacheasy/youraccount.php on line 31 Notice:
  Undefined index: Pidno in /Users/mgltd/Sites/reacheasy/youraccount.php
  on line 32 Notice: Undefined index: Psize in
  /Users/mgltd/Sites/reacheasy/youraccount.php on line 33 Notice:
  Undefined index: Pcolour in
  /Users/mgltd/Sites/reacheasy/youraccount.php on line 34 Notice:
  Undefined index: Pquantity in
  /Users/mgltd/Sites/reacheasy/youraccount.php on line 35 Notice:
  Undefined index: Weblink in
  /Users/mgltd/Sites/reacheasy/youraccount.php on line 36 Notice:
  Undefined index: Price in /Users/mgltd/Sites/reacheasy/youraccount.php
  on line 37 Notice: Undefined index: comment in
  /Users/mgltd/Sites/reacheasy/youraccount.php on line 38 Warning:
  date(): It is not safe to rely on the system's timezone settings. You
  are <em>required</em> to use the date.timezone setting or the
  date_default_timezone_set() function. In case you used any of those
  methods and you are still getting this warning, you most likely
  misspelled the timezone identifier. We selected 'Europe/London' for
  'BST/1.0/DST' instead in /Users/mgltd/Sites/reacheasy/youraccount.php
  on line 39"</p>
</blockquote>

<p>the code</p>

<pre><code>&lt;?php
    $submit = $_POST['Add'];
    //form data
    $Sname = mysql_real_escape_string(htmlentities(strip_tags($_POST['Sname'])));
    $Pname = mysql_real_escape_string(htmlentities(strip_tags($_POST['Pname'])));
    $Pidno = mysql_real_escape_string(htmlentities(strip_tags($_POST['Pidno'])));
    $Psize = mysql_real_escape_string(htmlentities(strip_tags($_POST['Psize'])));
    $Pcolour = mysql_real_escape_string(htmlentities(strip_tags($_POST['Pcolour'])));
    $Pquantity = $_POST['Pquantity'];
    $Weblink = mysql_real_escape_string(htmlentities(strip_tags($_POST['Weblink'])));
    $Price = mysql_real_escape_string(htmlentities(strip_tags($_POST['Price'])));
    $comment = mysql_real_escape_string(htmlentities(strip_tags($_POST['comment'])));
    $date = date("Y-m-d");
    //echo " ('','$Sname','$Pname','$Pidno','$Psize','$Pcolour','$Pquantity','$Weblink','$Price','$Uname')";
    if('POST' === $_SERVER['REQUEST_METHOD'])
    {
    if ($Sname&amp;&amp;$Pname&amp;&amp;$Pidno&amp;&amp;$Weblink&amp;&amp;$Price)
    {
    if (is_numeric($Price))
    {
        $repeatheck = mysql_query("SELECT * FROM repplac WHERE Uname = '{$_SESSION['username']}' AND Pidno ='$Pidno' AND Sname='$Sname' AND Pname='$Pname'");
        $count = mysql_num_rows($repeatheck);
    if($count!=0)
    {
        die ('PRODUCT ALREADY IN BASKET YOU CAN INCREASE OR DECREASE QUANTITY, &lt;a href="youraccount.php"&gt;CLICK TO GO BACK TO YOUR LIST&lt;/a&gt;');
    }
    else
    //echo'$Price';
    $tprice = $Price * $Pquantity;
    //echo"$tprice";
    $queryreg = mysql_query("
    INSERT INTO repplac VALUES ('','$Sname','$Pname','$Pidno','$Psize','$Pcolour','$Pquantity','$Weblink','$Price','$comment','$tprice','$date','{$_SESSION['username']}','')
    ")or die(mysql_error());
    }
    else
    echo 'price field requires numbers';
    }
    else
    echo 'please fill in all required * fields ';
    }
    ?&gt;
    &lt;form action='youraccount.php' method='Post' class='ilistbar'&gt;
        &lt;!--&lt;div&gt;
        &lt;label for='shoppinglist' class='fixedwidth'&gt;&lt;/label&gt;
        &lt;textarea type='text' name='shoppinglist' id='username' cols='100' rows='15'&gt;&lt;/textarea&gt;
        &lt;/div&gt; --&gt;
        &lt;div&gt;
        &lt;label for='Sname' class='fixedwidth'&gt; * Shop name&lt;/label&gt;
        &lt;input type='text' name='Sname' id='Sname'/&gt;
        &lt;/div&gt;
        &lt;div&gt;
        &lt;label for='Pname' class='fixedwidth'&gt; * Product name&lt;/label&gt;
        &lt;input type='text' name='Pname' id='Pname'/&gt;
        &lt;/div&gt;
        &lt;div&gt;
        &lt;label for='Pidno' class='fixedwidth'&gt; * Product id no /ad reference&lt;/label&gt;
        &lt;input type='text' name='Pidno' id='Pidno'/&gt;
        (This should be unique for each product)
        &lt;/div&gt;
        &lt;div&gt;
        &lt;label for='Psize' class='fixedwidth'&gt;Product size&lt;/label&gt;
        &lt;input type='text' name='Psize' id='Psize'/&gt;
        &lt;/div&gt;
        &lt;div&gt;
        &lt;label for='Pcolour' class='fixedwidth'&gt;Product colour&lt;/label&gt;
        &lt;input type='text' name='Pcolour' id='Pcolour'/&gt;
        &lt;/div&gt;
        &lt;div&gt;
        &lt;label for='Pquantity' class='fixedwidth'&gt;Product quantity&lt;/label&gt;
        &lt;select name="Pquantity" id="Pquantity"&gt;
         &lt;option value="1"&gt;1&lt;/option&gt;
         &lt;option value="2"&gt;2&lt;/option&gt;
         &lt;option value="3"&gt;3&lt;/option&gt;
         &lt;option value="4"&gt;4&lt;/option&gt;
         &lt;option value="5"&gt;5&lt;/option&gt;
         &lt;option value="6"&gt;6&lt;/option&gt;
         &lt;option value="7"&gt;7&lt;/option&gt;
         &lt;option value="8"&gt;8&lt;/option&gt;
         &lt;option value="9"&gt;9&lt;/option&gt;
         &lt;option value="10"&gt;10&lt;/option&gt;
    &lt;/select&gt;
    (You can update quantity in excess of 10 on the shopping list below)
        &lt;/div&gt;
        &lt;div&gt;
        &lt;label for='Weblink' class='fixedwidth'&gt; * Web link&lt;/label&gt;
        &lt;input type='text' name='Weblink' id='Weblink'/&gt;
        &lt;/div&gt;
        &lt;div&gt;
        &lt;label for='Price' class='fixedwidth'&gt; * Price GBP&lt;/label&gt;
        &lt;input type='text' name='Price' id='Price'/&gt;
        Please valid format is (.) for decimal
        &lt;/div&gt;
        &lt;div&gt;
        &lt;label for='comment' class='fixedwidth'&gt; Extra info&lt;/label&gt;
        &lt;input type='text' name='comment' id='comment'/&gt;
        Please give different colours , sizes of the same products,discount codes, and other information that you would like us to use
        &lt;/div&gt;
        &lt;div&gt;

        &lt;div class='buttonarea'&gt;
                &lt;p&gt;
                &lt;input type='submit' name='submit' value='Add'&gt;
                &lt;/p&gt;
                &lt;/div&gt;
                &lt;/p&gt;
        &lt;/form&gt;
</code></pre>
