Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8218539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:49:48+00:00 2026-06-07T12:49:48+00:00

I transferred a file from my server that works well on the internet to

  • 0

I transferred a file from my server that works well on the internet to my local computer.

And it throws a lot of undefined index for my variables,

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

below is the error and related code

“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 required 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″

the code

<?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&&$Pname&&$Pidno&&$Weblink&&$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, <a href="youraccount.php">CLICK TO GO BACK TO YOUR LIST</a>');
    }
    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 ';
    }
    ?>
    <form action='youraccount.php' method='Post' class='ilistbar'>
        <!--<div>
        <label for='shoppinglist' class='fixedwidth'></label>
        <textarea type='text' name='shoppinglist' id='username' cols='100' rows='15'></textarea>
        </div> -->
        <div>
        <label for='Sname' class='fixedwidth'> * Shop name</label>
        <input type='text' name='Sname' id='Sname'/>
        </div>
        <div>
        <label for='Pname' class='fixedwidth'> * Product name</label>
        <input type='text' name='Pname' id='Pname'/>
        </div>
        <div>
        <label for='Pidno' class='fixedwidth'> * Product id no /ad reference</label>
        <input type='text' name='Pidno' id='Pidno'/>
        (This should be unique for each product)
        </div>
        <div>
        <label for='Psize' class='fixedwidth'>Product size</label>
        <input type='text' name='Psize' id='Psize'/>
        </div>
        <div>
        <label for='Pcolour' class='fixedwidth'>Product colour</label>
        <input type='text' name='Pcolour' id='Pcolour'/>
        </div>
        <div>
        <label for='Pquantity' class='fixedwidth'>Product quantity</label>
        <select name="Pquantity" id="Pquantity">
         <option value="1">1</option>
         <option value="2">2</option>
         <option value="3">3</option>
         <option value="4">4</option>
         <option value="5">5</option>
         <option value="6">6</option>
         <option value="7">7</option>
         <option value="8">8</option>
         <option value="9">9</option>
         <option value="10">10</option>
    </select>
    (You can update quantity in excess of 10 on the shopping list below)
        </div>
        <div>
        <label for='Weblink' class='fixedwidth'> * Web link</label>
        <input type='text' name='Weblink' id='Weblink'/>
        </div>
        <div>
        <label for='Price' class='fixedwidth'> * Price GBP</label>
        <input type='text' name='Price' id='Price'/>
        Please valid format is (.) for decimal
        </div>
        <div>
        <label for='comment' class='fixedwidth'> Extra info</label>
        <input type='text' name='comment' id='comment'/>
        Please give different colours , sizes of the same products,discount codes, and other information that you would like us to use
        </div>
        <div>

        <div class='buttonarea'>
                <p>
                <input type='submit' name='submit' value='Add'>
                </p>
                </div>
                </p>
        </form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:49:50+00:00Added an answer on June 7, 2026 at 12:49 pm

    I would wrap the php-block at the top in an if:

    if( isset($_POST['submit']) ){ 
    
        // Rest of the code that populates the variables and so on
    
    }
    

    This would ensure that you don’t try to operate on values that aren’t even remotely there. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to automatically transfer an xml file from server A over internet to
We are developing an application that uploads large files over Internet. File size before
I'm uploading a SQL Server CE compact database file from a Windows Mobile application
I need to implement a file transferring from a web server to a SFTP
i have a java chat server & client, that works fine. I made a
I need to transfer a huge file from local machine to remote machine using
My team transferred our tfs from an old server to a new one a
My scenario - I am trying to send a Assembly File from Server to
My java program uploads a zip file from my system to FTP server. uploadfile()
I've been having some trouble trying to send a file from a server to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.