Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-14-2012, 03:32 PM   PM User | #1
akhilreddy
New to the CF scene

 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
akhilreddy is an unknown quantity at this point
I am getting an error as "undefined index" in line 3 in below program

<?php
$firstname=$_POST["txt1r"];
$lastname=$_POST["txt2r"];
$email=$_POST["txt3r"];
$password=$_POST["txt4r"];
$date=$_REQUEST["date"];
$month=$_REQUEST["month"];
$years=isset($_REQUEST["year"]);
echo 'your name is '.$firstname.' '.$lastname;
echo '<br>your email is '.$email;
echo '<br>your password is '.$password;
echo '<br>your date of birth '.$date.'-'.$month.'-'.$years;
$con=mysql_connect("localhost","root","9441059334");
if (!$con)
{
die('could not connect:'.mysql_error());
}
mysql_close($con);
?>
akhilreddy is offline   Reply With Quote
Old 07-14-2012, 05:30 PM   PM User | #2
MarPlo
Regular Coder

 
Join Date: Mar 2011
Posts: 145
Thanks: 0
Thanked 20 Times in 20 Posts
MarPlo is an unknown quantity at this point
Hi,
Line 3 is:
Code:
$lastname=$_POST["txt2r"];
The error means that there is not data send via POST with name "txt2r".
Check if in the form there is the field with name="txt2r" .
__________________
MarPlo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:50 AM.


Advertisement
Log in to turn off these ads.