473,378 Members | 1,564 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,378 software developers and data experts.

Notice: Undefined index:address? whats this?

Paul NIcolai Sunga
here's the code i use..then the error appeared something like that..
Notice: Undefined index:address


Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. $a1 = $_POST['address'];
  3. if($a1 = "")
  4. {
  5. echo "Empty Address Field.";
  6. }
  7. ?>
  8.  

and all other codes like this have the same error though it is not empty.


Expand|Select|Wrap|Line Numbers
  1. $surname = $_POST['surname'];
  2. $sex = $_POST['sex'];
  3. $firstname = $_POST['firstname'];
  4. $cstatus = $_POST['cstatus'];
  5. $middlename = $_POST['middlename'];
  6. $weight = $_POST['weight'];
  7. $age = $_POST['age'];
  8. $blood = $_POST['blood'];
  9. $pnumber = $_POST['pnumber'];
  10. $year = $_POST['year'];
  11. $month = $_POST['month'];
  12. $day = $_POST['day'];
  13. $email = $_POST['email'];
  14. $address = $_POST['address'];
  15. $category = $_POST['category'];
  16. $team = $_POST['team'];
  17. $browse = $_POST['Browse'];
  18. $password = $_POST['password'];
  19. $person = $_POST['person'];
  20. $contactadd = $_POST['contactadd'];
  21. $relationship = $_POST['relationship'];
  22. $ecnumber = $_POST['ecnumber'];
  23.  
  24.  

what's wrong?



thanks.
Jul 28 '09 #1
12 6136
Dormilich
8,658 Expert Mod 8TB
maybe you didn't post? print out $_POST to see, what it actually contains.
Jul 28 '09 #2
thanks but it is stil not working.. i tried to print out but it produce the same error..
Jul 28 '09 #3
Dormilich
8,658 Expert Mod 8TB
@Paul NIcolai Sunga
how did you print out???
Jul 28 '09 #4
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.  
  3. $a1 = $_POST['address'];
  4. echo $a1;
  5.  
  6. ?> 
Jul 28 '09 #5
Markus
6,050 Expert 4TB
Do a print_r() on $_POST, is what Dormilich meant. print_r() will traverse an array and print it in readable format.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. print_r($_POST);
  4.  
  5. ?>
  6.  
Jul 28 '09 #6
this is what contains in my redirect page:

Expand|Select|Wrap|Line Numbers
  1.  
  2. $Submit = $_POST['Submit'];
  3.  
  4. if($Submit == 'Submit')
  5. {
  6. //GETTING DATA IN FORM
  7. $surname = $_POST['surname'];
  8. $sex = $_POST['sex'];
  9. $firstname = $_POST['firstname'];
  10. $cstatus = $_POST['cstatus'];
  11. $middlename = $_POST['middlename'];
  12. $weight = $_POST['weight'];
  13. $age = $_POST['age'];
  14. $blood = $_POST['blood'];
  15. $pnumber = $_POST['pnumber'];
  16. $year = $_POST['year'];
  17. $month = $_POST['month'];
  18. $day = $_POST['day'];
  19. $email = $_POST['email'];
  20. $address = $_POST['address'];
  21. $category = $_POST['category'];
  22. $team = $_POST['team'];
  23. $browse = $_POST['Browse'];
  24. $password = $_POST['password'];
  25. $person = $_POST['person'];
  26. $contactadd = $_POST['contactadd'];
  27. $relationship = $_POST['relationship'];
  28. $ecnumber = $_POST['ecnumber'];
  29. $others = $_POST['others'];
  30.  
  31. echo $firstname, $middlename, $surname, $address, $category, $year $month $day, $age, $pnumber, $email, $sex, $weight, $cstatus;
  32. }
  33. header('Location:registration.php');
  34. exit();
  35.  

then the error appears like this:
Notice: Undefined index: Submit in C:\wamp\www\redirect.php on line 3
this is the line 3: $Submit = $_POST['Submit'];
instead of printing the data in forms the error appear.

why? im so confused about it.

thanks
Jul 28 '09 #7
Canabeez
126 100+
Try printing out $_REQUEST instead of $_POST, see what you get:
Expand|Select|Wrap|Line Numbers
  1. var_dump($_REQUEST);
Jul 28 '09 #8
Markus
6,050 Expert 4TB
Ignored again.

*leaving thread*
Jul 28 '09 #9
ak1dnar
1,584 Expert 1GB
This error appears because of your PHP error reporting configuration settings. Normally , it appears when your variable is not properly set. There are two ways to fix this issue.

Check if $_POST['VAR_NAME_HERE'] is set before using it.
example:
Expand|Select|Wrap|Line Numbers
  1. if (!isset($_POST['VAR_NAME_HERE']))
  2. {
  3. //If not isset provide a dummy value here
  4. $_POST['VAR_NAME_HERE'] = "";
  5.  
or simply ignore the NOTICES from your error reporting settings.to do that modify your error_reporting settings on php.ini to
Expand|Select|Wrap|Line Numbers
  1. error_reporting = E_ALL & ~E_NOTICE
  2.  
or else add this line to the top of your code
Expand|Select|Wrap|Line Numbers
  1. <?php error_reporting (E_ALL ^ E_NOTICE); ?>
  2.  
Jul 28 '09 #10
thanks a lot!!




is it common that E_NOTICE is always showing?
Jul 29 '09 #11
i found the path to php.ini but the problem is i dont know how to configure it.
Jul 29 '09 #12
ak1dnar
1,584 Expert 1GB
find this line
error_reporting = E_ALL
and modify it with
error_reporting = E_ALL & ~E_NOTICE

save it and make sure to restart the web server too before test it.
Jul 29 '09 #13

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

Similar topics

3
by: serge calderara | last post by:
Dear all, I have a tool which is able to receive any kind of data from a remote system. For that I need to get the ipadress of the remote system. If the system is not connected to a DHCP...
4
by: Kees Hoogendijk | last post by:
Hi everyone, Actually I dont know how te explein this, that's why I paste my code below. I've a main en I've a few header files. After I include the headers, the compiler shows the errors as...
5
by: Kelvin Moss | last post by:
Hi group, I have an array of structure. Say - typedef struct Person { int i; int j; int k; }person;
1
by: Uzi Baruch | last post by:
Hi! i want to know if i have an ip address of a computer and its DNS server name, if their is an windows API that can resolve the computer name of the given ip address. or vice verca -...
0
by: Marcel Brekelmans | last post by:
Hi, That's what MicroSoft says about it. On the one hand it offers you an index (apparently into the EventLogEntryCollection) but you can't be sure as to which element you are retrieving!? As a...
2
by: Martin v. Löwis | last post by:
I've been working on PEP 353 for some time now. Please comment, in particular if you are using 64-bit systems. Regards, Martin PEP: 353 Title: Using ssize_t as the index type Version:...
57
by: Robert Seacord | last post by:
i am trying to print the address of a function without getting a compiler warning (i am compiling with gcc with alot of flags). if i try this: printf("%p", f); i get: warning: format %p...
4
by: (2b|!2b)==? | last post by:
template <typename T1, typename T2> struct MyDbInfo { MyDbInfo():m_pEnv(0), m_tran(0), m_db(0), m_idx(0) {} MyDbInfo(CDbEnv *env, DbTxn* tran, T1* db_ptr, T2 *idx_ptr):m_pEnv(env),...
4
hemantbasva
by: hemantbasva | last post by:
We have designed an aspx page having five ajax tab in it. the data of first four are designed on page whereas for the fifth tab it renders a user control named MYDOMAIN. in the tab container's even...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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...
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.