473,385 Members | 1,506 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Notice: Undefined Index: ...

Hi. I am having some problems with my PHP page (maybe because I'm a noob in PHP). Anyway, please see the attached files. When I try to echo the data of EQUIPCODE and ADDDATE, it doesn't show up in the PROCESSFORM page. EQUIPCODE and CURLOC are almost the same scripts, yet CURLOC was able to echo its own data. I've checked all the variables for any syntax error, but they seem all fine. I really don't understand this. Please, could somebody kindly check my scripts and point out what was wrong in it? I would really appreciate it a lot. Thanks in advance.
Attached Images
File Type: jpg MainPage.jpg (37.8 KB, 108 views)
File Type: jpg UndefinedIndex.jpg (41.8 KB, 233 views)
Attached Files
File Type: txt functions.txt (3.2 KB, 359 views)
File Type: txt newequipment.txt (3.8 KB, 287 views)
File Type: txt process.txt (1.4 KB, 286 views)
Sep 22 '11 #1
2 1992
johny10151981
1,059 1GB
Well, I didnt read your files, tried to view your images, didnt help me.

Anyway, Lets do some experience talk

You are trying to access any array index that does not exists.

Example:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $a['fruite'][0]='Apple';
  3. $a['fruite'][1]='Orange';
  4. $a['count']=2;
  5.  
  6. echo $a['fruite'][2]; //you will get undefined Index error. Why? Cause you didnt define index 2;
  7. ?>
  8.  
Now in some situation you might fall

like
if $a[$id] exists then add $a[$id]=$a[$id]+$New_Value;
else $a[$id]=$New_Value;

in general some programmer(I have seen) they hide all the warning and error in the page and do like this.
Expand|Select|Wrap|Line Numbers
  1. $a[$id]=$a[$id]+$New_Value;
  2.  
case like this php find his way out, but i believe this is not a very smart answer.

use this code
Expand|Select|Wrap|Line Numbers
  1. if(isset($a[$id])==true)
  2. {
  3.  $a[$id]=$a[$id]+$New_Value;
  4. }
  5. else
  6. {
  7.  $a[$id]=$New_Value;
  8. }
  9.  
Sep 22 '11 #2
Well, thanks anyway. I was able to solve it, but it was not pretty at all. Maybe I'll just figured it out later. I just need a working database right now. My problem is more on code re-factoring. Thanks again.
Sep 25 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: jsgoodrich | last post by:
I am looking for some help if anyone can lend a hand. I have a simple php website that displays a table from my mysql database. To prep for my MCSE I moved my home server to Windows 2003...
3
by: number1yan | last post by:
Can anyone help me, i am creating a website and am using a php script that recomends the website to other people. I keep getting the same error and can not work out why. The error is: Notice:...
3
by: sickboy | last post by:
$channels=$_GET; if (empty($channels)) { $channels='blank'; } changechannels($channels); $theatre=$_GET; if (empty($theatre)) { $theatre='splash'; } changetheatre($theatre); $info=$_GET; if...
1
by: francsutherland | last post by:
Notice: Undefined index: send in D:\Domains\workingdata.co.uk\wwwroot\contact_text.php on line 7 Hi, I've started getting this error in the contact page form of my website. The web hosting...
10
by: FutureShock | last post by:
I have since recently turned up my error reporting on a production site to E_ALL to ensure I am using 'best practices' when writing out code. So far it has helped me discipline myself with...
11
by: stealthmode666 | last post by:
New to .php so need script help. I want to know how to stop this being displayed when I click submit. Notice: Undefined index: homeowner in E:\domains\r\...\user\htdocs\...\form.php on line 166 ...
4
by: complearn | last post by:
Do you know why I got these errors for status_bar.php in some webhost, but work perfectly on other webhost? Whats wrong? here are the codes from line 18, our webhost is running php5. ...
3
by: razvanel442 | last post by:
Hi all i am new here! I take a look on forum but i don't found a the answer for my problem ok this is my problem: Line47:$user = $_GET; Line48:$pass = $_GET; Line49:$char = $_GET;
2
by: norwichchris | last post by:
hi, I am having serious trouble with my PHP Postcard script. The error message i get is: Notice: Undefined index: Notice: Undefined variable Basically it does not send out the scripts at...
2
by: nyrzs | last post by:
"Notice: Undefined index: prod_rep in F:\xampp\htdocs\isys\products\process.php on line 153 Notice: Undefined variable: prod_id in F:\xampp\htdocs\isys\products\process.php on line 160 Warning:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.