|  | error... |  | |
| | | mac |  |
| Posted: Tue Sep 09, 2008 11:02 am Post subject: error... |  |
hi, im new to php.can anybody please tell waht tis error is....
Notice: Undefined index: empname in d:\instantrails\www\test\new \formsubmit.php on line 14
thanx mac |
| |
| | | Jerry Stuckle |  |
| Posted: Tue Sep 09, 2008 11:02 am Post subject: Re: error... |  |
mac wrote:
| Quote: | hi, im new to php.can anybody please tell waht tis error is....
Notice: Undefined index: empname in d:\instantrails\www\test\new \formsubmit.php on line 14
thanx mac
|
You didn't show any code, so it's impossible to tell you exactly. However, it means you are trying to access an element of an array which doesn't exist, i.e. you are trying to get the value of $my_array['empname'], but never set it.
You can check to see if a value has been set with isset().
-- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
| |
| | | mac |  |
| Posted: Tue Sep 09, 2008 11:06 am Post subject: Re: error... |  |
| |  | |
On Sep 9, 4:04 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
| Quote: | mac wrote: hi, im new to php.can anybody please tell waht tis error is....
Notice: Undefined index: empname in d:\instantrails\www\test\new \formsubmit.php on line 14
thanx mac
You didn't show any code, so it's impossible to tell you exactly. However, it means you are trying to access an element of an array which doesn't exist, i.e. you are trying to get the value of $my_array['empname'], but never set it.
You can check to see if a value has been set with isset().
-- =================> Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuck...@attglobal.net ================= hi, |
this is some code...
<?php include("conn.php"); $mode=$_REQUEST["mode"]; if($mode=="add") { $empname=$_REQUEST["empname"]; $age=$_REQUEST["age"]; $designation=$_REQUEST["designation"]; $salary=$_REQUEST["salary"]; $state=$_REQUEST["state"]; $city=$_REQUEST["city"];
$sql="insert into emp(empname,age,designation,salary,state,city) values('$empname','$age','$designation','$salary','$state','$city')"; $result=mysql_query($sql,$connection) or die(mysql_error());
header("location: index.php");
-------------------------- ------------------ |
| |
| | | Geoff Berrow |  |
| Posted: Tue Sep 09, 2008 1:35 pm Post subject: Re: error... |  |
Message-ID: <b3d953bf-dc26-4849-b5db-9e1d1d9dab67@z11g2000prl.googlegroups.com> from mac contained the following:
| Quote: | include("conn.php"); $mode=$_REQUEST["mode"]; if($mode=="add") { $empname=$_REQUEST["empname"]; $age=$_REQUEST["age"]; $designation=$_REQUEST["designation"]; $salary=$_REQUEST["salary"]; $state=$_REQUEST["state"]; $city=$_REQUEST["city"];
$sql="insert into emp(empname,age,designation,salary,state,city) values('$empname','$age','$designation','$salary','$state','$city')"; $result=mysql_query($sql,$connection) or die(mysql_error());
|
The notice may be the least of your problems.
See LINK -- Geoff Berrow 0110001001101100010000000110 001101101011011001000110111101100111001011 100110001101101111001011100111010101101011 LINK - LINK |
| |
| | | Jerry Stuckle |  |
| Posted: Tue Sep 09, 2008 3:43 pm Post subject: Re: error... |  |
| |  | |
mac wrote:
| Quote: | On Sep 9, 4:04 am, Jerry Stuckle <jstuck...@attglobal.net> wrote: mac wrote: hi, im new to php.can anybody please tell waht tis error is.... Notice: Undefined index: empname in d:\instantrails\www\test\new \formsubmit.php on line 14 thanx mac You didn't show any code, so it's impossible to tell you exactly. However, it means you are trying to access an element of an array which doesn't exist, i.e. you are trying to get the value of $my_array['empname'], but never set it.
You can check to see if a value has been set with isset().
-- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuck...@attglobal.net ==================
hi, this is some code...
?php include("conn.php"); $mode=$_REQUEST["mode"]; if($mode=="add") { $empname=$_REQUEST["empname"]; $age=$_REQUEST["age"]; $designation=$_REQUEST["designation"]; $salary=$_REQUEST["salary"]; $state=$_REQUEST["state"]; $city=$_REQUEST["city"];
$sql="insert into emp(empname,age,designation,salary,state,city) values('$empname','$age','$designation','$salary','$state','$city')"; $result=mysql_query($sql,$connection) or die(mysql_error());
header("location: index.php");
-------------------------- ------------------
|
It means that $_REQUEST['empname'] is not set. This should have probably come from a form posted to this page.
Before attempting to use the value, you should check to see if it is set, with
if (isset($_REQUEST['empname'])) { ...
And also - you shouldn't be using $_REQUEST. Rather, use $_POST or $_GET, depending on whether the form method is GET or POST. $_REQUEST will check either, but will also check $_COOKIE - which will cause you problems if you ever set a cookie for empname. No, I'm sure you aren't planning to do so now - but what about six months from now? This just leaves another door open for a bug.
And as Geoff said - study up on SQL injection. If you don't understand it and watch for it, a hacker can do almost anything he wants to your database - including wiping it out.
-- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
| |
| | | mac |  |
| Posted: Wed Sep 10, 2008 4:49 am Post subject: Re: error... |  |
| |  | |
On Sep 9, 10:43 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
| Quote: | mac wrote: On Sep 9, 4:04 am, Jerry Stuckle <jstuck...@attglobal.net> wrote: mac wrote: hi, im new to php.can anybody please tell waht tis error is.... Notice: Undefined index: empname in d:\instantrails\www\test\new \formsubmit.php on line 14 thanx mac You didn't show any code, so it's impossible to tell you exactly. However, it means you are trying to access an element of an array which doesn't exist, i.e. you are trying to get the value of $my_array['empname'], but never set it.
You can check to see if a value has been set with isset().
-- =================> >> Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuck...@attglobal.net ================= hi, this is some code...
?php include("conn.php"); $mode=$_REQUEST["mode"]; if($mode=="add") { $empname=$_REQUEST["empname"]; $age=$_REQUEST["age"]; $designation=$_REQUEST["designation"]; $salary=$_REQUEST["salary"]; $state=$_REQUEST["state"]; $city=$_REQUEST["city"];
$sql="insert into emp(empname,age,designation,salary,state,city) values('$empname','$age','$designation','$salary','$state','$city')"; $result=mysql_query($sql,$connection) or die(mysql_error());
header("location: index.php");
-------------------------- ------------------
It means that $_REQUEST['empname'] is not set. This should have probably come from a form posted to this page.
Before attempting to use the value, you should check to see if it is set, with
if (isset($_REQUEST['empname'])) { ...
And also - you shouldn't be using $_REQUEST. Rather, use $_POST or $_GET, depending on whether the form method is GET or POST. $_REQUEST will check either, but will also check $_COOKIE - which will cause you problems if you ever set a cookie for empname. No, I'm sure you aren't planning to do so now - but what about six months from now? This just leaves another door open for a bug.
And as Geoff said - study up on SQL injection. If you don't understand it and watch for it, a hacker can do almost anything he wants to your database - including wiping it out.
-- =================> Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuck...@attglobal.net ==================- Hide quoted text -
- Show quoted text -
|
hi, thnks a lot...the prblm got solved. mac |
| |
| | | Curtis |  |
| Posted: Wed Sep 10, 2008 6:58 am Post subject: Re: error... |  |
| |  | |
mac wrote:
| Quote: | On Sep 9, 10:43 am, Jerry Stuckle <jstuck...@attglobal.net> wrote: mac wrote: On Sep 9, 4:04 am, Jerry Stuckle <jstuck...@attglobal.net> wrote: mac wrote: hi, im new to php.can anybody please tell waht tis error is.... Notice: Undefined index: empname in d:\instantrails\www\test\new \formsubmit.php on line 14 thanx mac You didn't show any code, so it's impossible to tell you exactly. However, it means you are trying to access an element of an array which doesn't exist, i.e. you are trying to get the value of $my_array['empname'], but never set it. You can check to see if a value has been set with isset().
hi, this is some code... ?php include("conn.php"); $mode=$_REQUEST["mode"]; if($mode=="add") { $empname=$_REQUEST["empname"]; $age=$_REQUEST["age"]; $designation=$_REQUEST["designation"]; $salary=$_REQUEST["salary"]; $state=$_REQUEST["state"]; $city=$_REQUEST["city"]; $sql="insert into emp(empname,age,designation,salary,state,city) values('$empname','$age','$designation','$salary','$state','$city')"; $result=mysql_query($sql,$connection) or die(mysql_error()); header("location: index.php"); -------------------------- ------------------ It means that $_REQUEST['empname'] is not set. This should have probably come from a form posted to this page.
Before attempting to use the value, you should check to see if it is set, with
if (isset($_REQUEST['empname'])) { ...
And also - you shouldn't be using $_REQUEST. Rather, use $_POST or $_GET, depending on whether the form method is GET or POST. $_REQUEST will check either, but will also check $_COOKIE - which will cause you problems if you ever set a cookie for empname. No, I'm sure you aren't planning to do so now - but what about six months from now? This just leaves another door open for a bug.
And as Geoff said - study up on SQL injection. If you don't understand it and watch for it, a hacker can do almost anything he wants to your database - including wiping it out.
in my form i have 2 comboboxes viz state and city,,,,if i select state automatically only those cities shud wich come under that perticular state.. in city combobox... hw to do any idea abt html select tag? mac
|
I believe you're looking for JavaScript help, in this case, not PHP. Try comp.lang.javascript.
-- Curtis |
| |
| | | mac |  |
| Posted: Wed Sep 10, 2008 8:08 am Post subject: Re: error... |  |
| |  | |
On Sep 9, 10:43 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
| Quote: | mac wrote: On Sep 9, 4:04 am, Jerry Stuckle <jstuck...@attglobal.net> wrote: mac wrote: hi, im new to php.can anybody please tell waht tis error is.... Notice: Undefined index: empname in d:\instantrails\www\test\new \formsubmit.php on line 14 thanx mac You didn't show any code, so it's impossible to tell you exactly. However, it means you are trying to access an element of an array which doesn't exist, i.e. you are trying to get the value of $my_array['empname'], but never set it.
You can check to see if a value has been set with isset().
-- =================> >> Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuck...@attglobal.net ================= hi, this is some code...
?php include("conn.php"); $mode=$_REQUEST["mode"]; if($mode=="add") { $empname=$_REQUEST["empname"]; $age=$_REQUEST["age"]; $designation=$_REQUEST["designation"]; $salary=$_REQUEST["salary"]; $state=$_REQUEST["state"]; $city=$_REQUEST["city"];
$sql="insert into emp(empname,age,designation,salary,state,city) values('$empname','$age','$designation','$salary','$state','$city')"; $result=mysql_query($sql,$connection) or die(mysql_error());
header("location: index.php");
-------------------------- ------------------
It means that $_REQUEST['empname'] is not set. This should have probably come from a form posted to this page.
Before attempting to use the value, you should check to see if it is set, with
if (isset($_REQUEST['empname'])) { ...
And also - you shouldn't be using $_REQUEST. Rather, use $_POST or $_GET, depending on whether the form method is GET or POST. $_REQUEST will check either, but will also check $_COOKIE - which will cause you problems if you ever set a cookie for empname. No, I'm sure you aren't planning to do so now - but what about six months from now? This just leaves another door open for a bug.
And as Geoff said - study up on SQL injection. If you don't understand it and watch for it, a hacker can do almost anything he wants to your database - including wiping it out.
-- =================> Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuck...@attglobal.net ==================- Hide quoted text -
- Show quoted text -
|
in my form i have 2 comboboxes viz state and city,,,,if i select state automatically only those cities shud wich come under that perticular state.. in city combobox... hw to do any idea abt html select tag? mac |
| |
|
|