473,394 Members | 2,063 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,394 software developers and data experts.

Notice: Undefined index:

When i want to save the page,the notice apperas as undefined index...plz solve the pbm here is the coding

this is at the very first line in my page
Expand|Select|Wrap|Line Numbers
  1.     if(isset($_GET['save']) && $_GET['save']=="yes" && isset($_GET['cid']))
  2.      {
  3.         $cust_id=$_GET['cid'];
  4.         $edit_cname=$_POST['edit_cname'];
  5.         $edit_caddr=$_POST['edit_caddr'];
  6.         $edit_cphno1=$_POST['edit_cphno1'];
  7.         $edit_cphno2=$_POST['edit_cphno2'];
  8.         $edit_cemail=$_POST['edit_cemail'];
  9.         $edit_web=$_POST['edit_cweb'];
  10.         if(is_numeric($edit_cphno1) && is_numeric($edit_cphno2))
  11.          {
  12.           @$up=mysql_query("update pms_customer set cust_name='$edit_cname',cust_addr='$edit_caddr',cust_ph=$edit_cphno1,cust_ph1=$edit_cphno2,email='$edit_cemail',website='$edit_web' where cust_id=$cust_id") or die('Unable to perform operation');
  13.           header("location:cust_index.php?action1=dis&cid=$cust_id");         
  14.           }
  15.        }  
  16.  
  17.  
  18.  
  19. <body bgcolor="#dbdbdb">
  20. <?php
  21.  
  22.    if(isset($_GET['action1']) && $_GET['action1']=="dis")
  23.   {
  24.     include('adminlogin.php');
  25.  
  26.     $query=mysql_query("select cust_name,cust_id from pms_customer");
  27.    ?>
  28.    <form action="" method="post" name="cust">
  29.    <br />
  30.    <center>
  31.    Select Customer Name :
  32.    <select name="cname" id="cname" onChange="cust_display()">
  33.    <option value="0">--Select--</option>
  34.    <?php
  35.  
  36.    while($r=mysql_fetch_object($query))
  37.     {
  38.      if(isset($_GET['cid']))
  39.      {
  40.        $cid=$_GET['cid'];
  41.       if($cid==$r->cust_id)
  42.       {
  43.     ?>
  44.    <option value="<?php echo $r->cust_id;?>" selected="selected"><?php echo $r->cust_name;?></option>
  45.     <?php
  46.        }
  47.       else
  48.       {
  49.       ?>
  50.       <option value="<?php echo $r->cust_id;?>"><?php echo $r->cust_name;?></option>
  51.       <?php
  52.      }
  53.     }
  54.     else
  55.     {
  56.     ?>
  57.       <option value="<?php echo $r->cust_id;?>"><?php echo $r->cust_name;?></option>
  58. <?php
  59.      }
  60.      }
  61.      ?>
  62.    </select>
  63.  
  64.   <?php
  65.   if(isset($_GET['cid'])) 
  66.  {
  67.     $cust_id=$_GET['cid'];
  68.     $query=mysql_query("select * from pms_customer where cust_id=$cust_id");
  69.     $res=mysql_fetch_object($query);
  70.    ?>
  71.    &nbsp;&nbsp;&nbsp;&nbsp;[<a href="cust_index.php?action=del">Delete</a>] 
  72.     <br /><br />
  73.     <fieldset>
  74.     <legend>Customer Details</legend>
  75.     <table align="center" cellspacing="9"> 
  76.     <tr><td>Customer Name </td><td>:</td><td>
  77.      <?php
  78.       if(isset($_GET['action']) && $_GET['action']=="edit_cust")
  79.        {
  80.        ?>
  81.         <input type="text" name="edit_cname" value="<?php echo $res->cust_name;?>" />
  82.        <?php
  83.        }
  84.       else
  85.        {       
  86.          echo $res->cust_name;
  87.         }
  88.        ?></td></tr>
  89.     <tr><td>Address </td><td>:</td><td>
  90.       <?php
  91.       if(isset($_GET['action']) && $_GET['action']=="edit_cust")
  92.        {
  93.         ?>
  94.         <textarea cols="25" rows="3" name="edit_caddr"><?php echo $res->cust_addr;?></textarea>
  95.        <?php
  96.        }
  97.       else
  98.        {   
  99.         echo $res->cust_addr;
  100.        }
  101.         ?>
  102.         </td></tr>
  103.     <tr><td>Phone Number1 </td><td>:</td><td>
  104.     <?php
  105.       if(isset($_GET['action']) && $_GET['action']=="edit_cust")
  106.        {
  107.        ?>
  108.        <input type="text" name="edit_cphno1" value=<?php echo $res->cust_ph;?> />
  109.        <?php
  110.        }
  111.       else
  112.       {
  113.        echo $res->cust_ph;
  114.        }
  115.       ?>
  116.        </td></tr>
  117.     <tr><td>Phone Number2 </td><td>:</td><td>
  118.    <?php
  119.       if(isset($_GET['action']) && $_GET['action']=="edit_cust")
  120.        {
  121.        ?>
  122.         <input type="text" name="edit_cphno2" value="<?php echo $res->cust_ph1;?>" />
  123.        <?php
  124.        }
  125.       else
  126.        {
  127.          echo $res->cust_ph1;
  128.        }
  129.         ?> 
  130.           </td></tr>
  131.     <tr><td>Email - ID </td><td>:</td><td>
  132.    <?php
  133.       if(isset($_GET['action']) && $_GET['action']=="edit_cust")
  134.        {
  135.        ?>
  136.         <input type="text" name="edit_cemail" value="<?php echo $res->email;?>" />
  137.       <?php
  138.        }
  139.        else
  140.         {
  141.           echo $res->email;
  142.         }
  143.         ?>  
  144.        </td></tr>
  145.     <tr><td>Web Site </td><td>:</td><td>
  146.    <?php
  147.       if(isset($_GET['action']) && $_GET['action']=="edit_cust")
  148.        {
  149.        ?>
  150.         <input type="text" name="edit_cweb" value="<?php echo $res->website;?>" />
  151.       <?php
  152.        }
  153.        else
  154.        {
  155.           echo $res->website;
  156.         }
  157.        ?>
  158.   </td></tr>
  159. <tr><td colspan="3" align="center">
  160.     <?php
  161.       if(isset($_GET['action']) && $_GET['action']=="edit_cust")
  162.        {
  163.        ?>
  164.        [<a href="cust_index.php?save=yes&cid=<?php echo $cust_id;?>">Save</a>] &nbsp;&nbsp;&nbsp;[<a href="cust_index.php?action1=dis&cid=<?php echo $cust_id;?>">Cancel</a>]
  165.       <?php
  166.        }
  167.       else
  168.        {
  169.        ?> 
  170.     <tr><td colspan="3" align="center">[<a href="cust_index.php?action=edit_cust&action1=dis&cid=<?php echo $cust_id;?>">Edit Section</a>]
  171.       <?php
  172.        }
  173.         ?>
  174.      </td></tr>
  175.     </table>
  176.  
Apr 1 '08 #1
3 1328
ak1dnar
1,584 Expert 1GB
Please post your error message, Sorry little bit busy here. Can't read your code from top to bottom. your error message will say exactly what's missing there.
Apr 1 '08 #2
hai
here is the error messages...plz help me....
Notice: Undefined index: edit_cname in /rhome/mainlab/user/selvi/Desktop/pms/cust_index.php on line 9

Notice: Undefined index: edit_caddr in /rhome/mainlab/user/selvi/Desktop/pms/cust_index.php on line 10

Notice: Undefined index: edit_cphno1 in /rhome/mainlab/user/selvi/Desktop/pms/cust_index.php on line 11

Notice: Undefined index: edit_cphno2 in /rhome/mainlab/user/selvi/Desktop/pms/cust_index.php on line 12

Notice: Undefined index: edit_cemail in /rhome/mainlab/user/selvi/Desktop/pms/cust_index.php on line 13

Notice: Undefined index: edit_cweb in /rhome/mainlab/user/selvi/Desktop/pms/cust_index.php on line 14
Apr 1 '08 #3
TheServant
1,168 Expert 1GB
You have half your form from POST variables and half from GET variables. Your submission can only be one of the two. If you don't understand the difference, please look it up on google and then come back here with any more problems.
Apr 1 '08 #4

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:...
2
by: Reggie | last post by:
am trying to create a a upload file.am uploading files ok but i recieve this message. Notice: Undefined variable: uploaded_size in /home/fhlinux169/c/ clashoff.co.uk/user/htdocs/upload.php on...
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...
5
by: Pseudonyme | last post by:
Dear All : Ever had an httpd error_log bigger than the httpd access log ? We are using Linux-Apache-Fedora-Httpd 2006 configuration. The PHP lines code that lead too tons of errors are : ...
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. ...
2
by: Smellydog | last post by:
I'm having a strange issue with PHP version 5.2.8 running on Windows Vista with Lighttpd. I receive a Notice that says the following: Notice</b>: Undefined index: name in...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.