Jump to content

[SOLVED] Data fed, but doesn't show in the textarea...


pets2soul

Recommended Posts

Hello everyone,

 

I'm converting my plain html website into a php one, and I'm working on the backend now...

I built a page to submit articles to MySQL, and another page to list all the entries in the

database, from there I can link to the article editing page to call up article headline, body and

date etc. into their own field in a form...However, the editing page is not working properly...

I made some screen captures to describe the problem...

 

1. http://www.prophet-records.com/images/phpprob01.gif This is my article submitting

page, I captured it to show you what supposed to be in the article...

 

2. http://www.prophet-records.com/images/phpprob02.gif This is the article editing

page...as you can see...article headline and date showed up, but the textareas appear to be

empty.

 

3. http://www.prophet-records.com/images/phpprob03.gif I checked its source code

with my browser, the highlighted part is where the article body is, it seems alright there, but it

just doesn't appear on the web page....

 

Below is the code for the article editing page....

<?php
$con = mysql_connect("hostname","username","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("dbname", $con);

$sql = mysql_query("SELECT * FROM table WHERE fname='$fname'") or die(mysql_error());

while ($rw = mysql_fetch_assoc($sql)) {
//now we display a form with the users info in text boxes and areas.
echo '<form action="update.php?fname='.$rw['fname'].'" method="post">
<table width="510" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="38" align="left" valign="top"><a href="dataentry.php">Add</a>  |  <a href="datalist.php">List</a>  |  <a href="annuallist.php">Annual</a></td>
</tr>
<tr>
<td height="28" align="left">Title: <input name="headline" type="text" maxlength="40" value="'.$rw['headline'].'">
</td>
</tr>
<tr>
<td align="left">Content:<br><textarea name="newscont" cols="70" rows="15" value="'.$rw['newscont'].'"></textarea>
</td>
  	</tr>
<tr>
<td align="left"><input name="date" value="'.$rw['date'].'">
</td>
</tr>
<tr>
<td align="left">Brief:<br><textarea name="newsbrf" cols="70" rows="10" value="'.$rw['newsbrf'].'"></textarea>
</td>
</tr>
<tr>
<td height="28" align="left">File Name: <input name="fname" type="text" maxlength="30" value="'.$rw['fname'].'">
</td>
</tr>
<tr>
<td height="32" align="center"><input type="submit">
</td>
</tr>
</table>
</form>';
}

mysql_close($con)
?>

 

Would anyone tell me what went wrong?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.