Page 1 of 1

help!!!! what's wrong with this error??????????

Posted: Fri May 14, 2004 1:44 pm
by jenny
halo, can anyone help me to solve this problem????? i can't display the my profile.... this below error come's out... may i know wat wrong with this coding???????????


Code: Select all

<?php
<html>
<body> 
<head> 
<title>List MY Records</title> 
</head> 


<h1>My Profile</h1></center> 
<?php 


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

$selectStmt = "select * from users where username = '{$_GET['username']}'"; 

if(!($link=mysql_pconnect('localhost', 'root', '')))
{
echo 'Error connecting...Please send the following information to the site administrator!';
exit();
}

mysql_select_db('mobile', $link)or die("There was an error connecting to the database. Please send the following information to the site administrator.<br /><br />".mysql_error()); 

if(!($result=mysql_query($selectStmt, $link))){
echo 'Error executing statement...Please send the following information to the site administrator! '.mysql_error();
exit();
}

if(!($row=mysql_fetch_object($result))){
echo 'Internal Error: The entry does not exist! '.mysql_error();
exit();
}

printf("<FORM target="_blank"  METHOD="post" ACTION="%s"><PRE>\n", "update.php?userID=$row->userID");


printf("</br>userID:
<INPUT TYPE=text SIZE=35 NAME=userID VALUE="%s">
<br>\n",$row->userID);

printf("userName:
<INPUT TYPE=text SIZE=35 NAME=username VALUE="%s">
<br>\n",$row->username);

printf("Password:
<INPUT TYPE=text SIZE=35 NAME=password VALUE="%s">
<br>\n",$row->password);

printf("Email:
<INPUT TYPE=text SIZE=35 NAME=email VALUE="%s">
<br>\n",$row->email);

printf("<INPUT TYPE=submit VALUE=Modify Name=submit>");
printf("</PRE></form>");

mysql_free_result($result);
}

?> 


</body> 
</html>

Code: Select all

<?php
?>

Parse error: parse error, unexpected T_STRING in C:\Apache2\htdocs\fn\userview.php on line 35


?>

Posted: Fri May 14, 2004 1:48 pm
by markl999
printf("<FORM target="_blank" METHOD="post" ACTION=\"%s\"><PRE>\n", "update.php?userID=$row->userID");
The quotes are out. Try using:
printf('<FORM target="_blank" METHOD="post" ACTION="%s"><PRE>', "update.php?userID =$row->userID");

or leave the outer double quotes and escape the inner double quotes if the \n is important to you.

Posted: Fri May 14, 2004 4:55 pm
by EricS
Try this

Code: Select all

printf '<FORM target="_blank" METHOD="post" ACTION="update.php?userID='.$row->userID.'"><PRE>'."\n";

Posted: Fri May 14, 2004 10:23 pm
by jenny
printf('<FORM target="_blank" METHOD="post" ACTION="%s"><PRE>', "update.php?userID =$row->userID");[quote][/quote]


when i used this.. it can run but cannot display my profile details.... how??? can anybody help me solve it????