To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > ClientSide Technologies

ClientSide Technologies Discuss HTML/CSS/Javascript, and any other client-side technologies, here.

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-08-2006, 04:51 AM   #1
fibonacci
Member
 
Join Date: May 2006
Posts: 37
[RESOLVED] edit form...

heyya..
can anyone help me here..
i got a problem with my edit form

my code as follow:
PHP Code:
<?
require 'f:/www/digitallibrary/conf/config.inc.php';    
require
'f:/www/digitallibrary/conf/smarty.inc.php';
chdir('../../');
?>
<?php

$query
= "select * from dil_logins WHERE userID='".$_GET['userID']."'";

$result = mysql_query($query);


if (!
$result)
{
    die(
'DIEEEEEEEE'.mysql_error());
}

echo
"HEY : ".$query;

$row = mysql_fetch_array($result);

    
$userID=$row["userID"];
    
$username=$row["username"];
    
$password=$row["password"];
    



?>

<html>
<head>
  <title>student form</title>
</head>
<body>

<form action="edit_form.php" method="post">

<fieldset style="width: 320; height: 240; padding: 2">


<p><b>Username: </b>
Username&nbsp;<input type="text" name="userID" readonly size="20" maxlength="40" value='<?php echo $userID;?>'></p>

<p><b>First Name: </b>
First_Name&nbsp;<input type="text" name="username" size="20" maxlength="40" value='<?php echo $username;?>' ></p>

<p><b>Last Name: </b>
Second_Name&nbsp;<input type="text" name="password" size="20" maxlength="40" value='<?php echo $password;?>'></p>

<input type ="submit" value="Edit "></form>
</fieldset>
</body>
</html>


<?php

if (isset($_POST["userID"]))
{

//$query = "select * from STUDENT WHERE email='$email'";
//$result = mysql_query($query);




    
$query_insert = "update dil_logins set username='".$_POST['username']."',password='".$_POST['password']."' where userID='".$_POST['UserID']."'";
    echo
"HEY 2 :".$query_insert;

    
$execute_query = mysql_query($query_insert);

    if (!
$execute_query)
    {
        die(
'DIEEEEEEEE'.mysql_error());
    }
    else
    {
        echo
"Succeessful insert";    
    }

}


?>

<p>
<a href ="menu.html">Back</a></p>

the error apear to be like this;
HTML Code:
Notice: Undefined index: userID in F:\WWW\digitallibrary\htdocs\login\edit_form.php on line 8
i have no idea where should i define the username..
please help me out...
thanks in advanced
fibonacci is offline   Reply With Quote
Old 05-08-2006, 05:27 AM   #2
laserlight
PHP Witch
 
laserlight's Avatar
 
Join Date: Apr 2003
Location: Singapore
Posts: 12,388
Looks like a PHP error to me.
__________________
Use Bazaar for your version control system
Read the PHP Spellbook
Learn How To Ask Questions The Smart Way
laserlight is offline   Reply With Quote
Old 05-08-2006, 05:59 AM   #3
pppppp
Member
 
Join Date: Apr 2006
Posts: 78
<?php

$query = "select * from dil_logins WHERE userID='".$_GET['userID']."'";

$result = mysql_query($query);


if (!$result)
{
die('DIEEEEEEEE'.mysql_error());
}

echo "HEY : ".$query;

$row = mysql_fetch_array($result);

$userID=$row["userID"];
$username=$row["username"];
$password=$row["password"];




?>


y have u used this at the start of ur form... are u passing the userid thru the get method???
pppppp is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes 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 -4. The time now is 07:09 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.