473,399 Members | 3,656 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,399 software developers and data experts.

problem with the edit the data in form

Hi,

After signin in my home page one button is there.i,e update profile.for that i wrote the below code but it will not work.plz tell that what's the problem in my code.[php]
<?php
// Connect database.
$host="localhost"; // Host name.
$db_user="root"; // MySQL username.
$db_password="sreeni"; // MySQL password.
$database="my_db1"; // Database name.
mysql_connect($host,$db_user,$db_password);
mysql_select_db($database);

// Select all data records in table "name_list" and put them into $result.
$result=mysql_query("select * from Registered_Members where user_name='$_GET[user_name]'");
?>
<html><head><title>My Profile</title>
<link rel=StyleSheet href="style.css" type="text/css" media=screen>
<style type="text/css">
#register_panel_a {
float:left;
width: auto;
}
#register_panel_b {
float:left;
width: auto;
}
</style></head>
<body bgcolor=white lang=EN-US link=blue alink=red vlink=purple>
<div align="center">
<h1>MY PROFILE</h1>
<div class="hr_red tiny_top_margin tiny_bottom_margin"></div>
</div>
<br>
<?
// Fetch record rows in $result by while loop and put them into $row.
while($row=mysql_fetch_assoc($result)){
?>
<form><table><tr>
<td>User Name: </td><td><input class="short_width" type="text" value="<? echo $row['user_name']; ?>" ></td>
</tr>
<tr>
<td>Password: </td><td><input class="short_width" type="text"></td><td>Required to update profile</td>
</tr><tr>
<td>New Password: </td><td><input class="short_width" type="text"></td>
</tr><tr>
<td>New Password: </td><td><input class="short_width" type="text"></td>
</tr><tr>
<td>Private Email: </td><td><input class="short_width" type="text" value="<? echo $row['email']; ?>" ></td><td>Registration confirmation, admin. communication.</td>
</tr><tr>
<td>Public Email: </td><td><input class="short_width" type="text"></td><td>Public profile display</td>
</tr><tr>
<td>First Name: </td><td><input class="short_width" type="text" value="<? echo $row['first_name']; ?>" ></td>
</tr><tr>
<td>Last Name: </td><td><input class="short_width" type="text" value="<? echo $row['last_name']; ?>" ></td>
</tr><tr>
<td>Gender: </td>
<td><select name="gender">
<option value="Unspecified">Unspecified
<option value="Male" selected>Male
<option value="Female">Female
</select>
</td>
</tr><tr>
<td>Birth Year: </td><td><input class="short_width" type="text" value="<? echo $row['date_of_birth']; ?>" ></td>
</tr><tr>
<td>Web Page: </td><td><input class="short_width" type="text"></td>
</tr>
<? } // End while loop. ?>
</table>
Personal Statement: <br><textarea rows="5" cols="20">This is my personal statement, blah blah blah...</textarea>
<div class="floatstop"></div>
<input type="submit" value="Update">
</form></body></html>[/php]
Apr 2 '08 #1
3 1214
TheServant
1,168 Expert 1GB
Edit you last post, put the code into correct code tags (just above the post content part - same line as bold, italics, etc), and also remove your DB username and password! Replace it with something not real!
Apr 2 '08 #2
TheServant
1,168 Expert 1GB
[HTML]<form>
<table>
<tr>[/HTML]
You're not sending your form anywhere? You should use something like:

[HTML]<form name="input" action="html_form_action.php" method="post">[/HTML]

If this was a mistake then let us know, but if you didn't know that, you need to google "html forms" and read up!
Apr 2 '08 #3
ronverdonk
4,258 Expert 4TB
Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.

MODERATOR
Apr 2 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
7
by: Munzilla | last post by:
Ok, I have an ASP page that I use to add several pieces of information to a database and also display that information in an edit mode. The problem is, when I use the page for edit, not all of the...
5
by: comshiva | last post by:
Hi all, I have converted my existing ASP.NET project from 1.1 to 2.0 and i have found that everything works fine except the linkbutton control in my datagrid which throws an javascript error when...
6
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns...
2
by: DC | last post by:
The Code <%@ import namespace="System" %> <%@ import namespace="System.Web" %> <%@ import namespace="System.Web.UI" %> <%@ import namespace="System.Web.UI.HtmlControls" %> <%@ import...
1
by: cctham | last post by:
Hi, I have an issue with php and/or mysql. I have a php form that writes "items" to a mysql database, including a description of the item. I am testing it now by putting special characters in...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
9
bhcob1
by: bhcob1 | last post by:
Hey guys, 'Update or CancelUpdate without AddNew or Edit' On my database i keep occasionly get this error when i try and edit a field, it is not everytime. It will be working fine and then this...
1
by: chromis | last post by:
Hi, I'm having trouble fully implementing the edit section of a contact admin system, so far I have written the following: - Bean (Contact.cfc) - Data Access object (ContactDAO.cfc) - Gateway...
2
coolv
by: coolv | last post by:
Hello I have problem in my page that the dropdown box is not displaying data according to selection of first dropdown.Please help me. Below is my code. thanks.............. <?php ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.