View Single Post
  #3 (permalink)  
Old 09-02-05, 04:49 PM
HoTDaWg's Avatar
HoTDaWg HoTDaWg is offline
Newbie Coder
 
Join Date: Aug 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,
Firstly, thank you for your help, secondly, I'm having trouble with the edit_user.php file. There were some errors in the script which I found out about, here's the code I have so far:
Code:
<html>
<head>
<title>Edit A User</title>
</head>
<body bgcolor="#FFFFFF">
<?php
$conn = mysql_connect("localhost","unenclosed","youtellme");

//now choose the database to use
mysql_select_db("my_db");
$id= $_GET['id'];
if($_POST['edit']):

if(!empty($_POST['username']) && !empty($_POST['password']));
$sql = "UPDATE users SET username='".$_POST['username']."', password='".$_POST['password']."' WHERE id='$id'";
mysql_query($sql) or die(mysql_error());
header("Location: http://www.hotdawg.hostyournet.com/driverpanel/userauthentication/user.php");

else:
echo "Some fields Were left blank";

else
$sql = "SELECT username,password FROM users WHERE id='$id'";
$r = mysql_query($sql) or die(mysql_error());
while($all = mysql_fetch_object($res));
$username=$all->username;
$password=$all->password;
?>

<form method="post">
<!--action= not defined => page recalls itself--!>
<input type="text" name="username" size="25" value="<? echo $username ?>"><br>
<input type="password" name="password" size="25" value="<? echo $password ?>"><br>
<!-- you don't do this normally: displaying a password so you can edit it -->
<input type="submit" name="edit" value="Edit">
</form>
</html>

</body>
</html>
I was hoping that you could help me fix the problem, as it continuesly says the following:
Code:
Parse error: syntax error, unexpected T_ELSE in C:\Documents and Settings\Bakhtawar\Desktop\saeedsite\driverpanel\_debug_tmp.php on line 22
Reply With Quote