Jump to content

Archived

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

daena76

Empty Form Fields

Recommended Posts

A newbie.

I have a classified ads website and the client part where they edit their posting title, description, etc, etc. seem to disappear and not show. Client needs to re-type everything. What do I add or change in the script? Here's the script (assuming I got the right one)

===========================================

<br>

<form method=post name="PostForm" onsubmit="return CheckOffer();" enctype="multipart/form-data">
<table align=center width=400>
<caption align=center>
<font face=verdana size=2 color=black><b>Edit your ad</b></font>
</caption>
<tr>
<td align=right>Asset type:</td>
<td>
<select name=ProductType>
<option value="classified" <? if($a1[ProductType] == 'classifeid') { echo "selected"; } ?>>Classified</option>
</select>
</td>
</tr>

<tr>
<td align=right>Category:</td>
<td>
<?=$SelectCategory?>
</td>
</tr>

<tr>
<td align=right>URL or domain:</td>
<td><input type=text name=url value="<?=$a1[url]?>" size=31></td>
</tr>

<tr>
<td align=right>Title:</td>
<td><input type=text name=ProductName value="<?=$a1[ProductName]?>" size=31></td>
</tr>

<tr>
<td align=right valign=top>Description:</td>
<td><textarea name=Description rows=6 cols=30><?=$a1[Description]?></textarea></td>
</tr>

<tr>
<td align=right valign=top>Images:</td>
<td><?=$ShowImages?></td>
</tr>

<tr>
<td align=right>Price:</td>
<td><input type=text name=Price size=6 value="<?=$a1[Price]?>"> <font face=verdana size=1>format: <b>125.95</b></font></td>
</tr>

<tr>
<td align=right>Priority:</td>
<td><?=$SelectPriority?></td>
</tr>

<tr>
<td> </td>
<td style="padding-top:15">
<input type=hidden name=OldImages value="<?=$OldImages?>">
<input type=submit name=s1 value="Update">
</td>
</tr>

</table>
</form>

<br><br>

<?=$ListMemberAsset?>

==========================================

Any help is greatly appreciated. Thanks :-)

Share this post


Link to post
Share on other sites
You havn't done a query statement to set the variable $a1 so you need sumet like

$query=mysql_query("SELECT * FROM table WHERE ID='1'");
$a1=mysql_fetch_array($query);

at the top of you page..

Regards
Liam

Share this post


Link to post
Share on other sites
[!--quoteo(post=376379:date=May 23 2006, 12:10 PM:name=shocker-z)--][div class=\'quotetop\']QUOTE(shocker-z @ May 23 2006, 12:10 PM) [snapback]376379[/snapback][/div][div class=\'quotemain\'][!--quotec--]
You havn't done a query statement to set the variable $a1 so you need sumet like

$query=mysql_query("SELECT * FROM table WHERE ID='1'");
$a1=mysql_fetch_array($query);

at the top of you page..

Regards
Liam
[/quote]

Liam, Thanks for a quick response. I put this on top and still can't seem to make it work. If you see something in the query or don't see please let me know. Thanks a lot!

<?
require_once("../conn.php");


if(isset($_POST[s1]))
{


$q1 = "update class_catalog set
Title = '$_POST[ProductName]',
Description = '$_POST[Description]',
Price = '$_POST[price]'

where Title = '$_GET[ProductName]' ";

mysql_query($q1);

if(!mysql_error())
{
echo "<br><center>Your item was updated successfully!</center>";
}
else
{
echo mysql_error();
}
}

//get the member info
$q1 = "select * from class_catalog where Price = '$_GET[Price]' ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);

?>

Share this post


Link to post
Share on other sites

×

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.