MySQL Forums
Forum List  »  Perl

Re: MySql, Perl, and HTML Update function not working
Posted by: adam gruber
Date: February 05, 2013 08:51AM

Yes, that is correct. Here is the code that is in a separate script that references the hidden input type:
<form method="post" name="address" action="http://10.1.1.1/cgi-bin/edit_save.pl"&gt;
<INPUT TYPE=hidden NAME="serial" id="serial" value=$serial />
<tr><td align=right>Name First </td><td><INPUT TYPE=text NAME="name_first" id=name_first size=30 value="$name_first"></td></tr>
<tr><td align=right>Name Last </td><td><INPUT TYPE=text NAME="name_last" id=name_last size=30 value="$name_last"></td></tr>
<tr><td align=right>Address 1 </td><td><INPUT TYPE=text NAME="address_01" id=address_01 size=40 value="$address_01"></td></tr>
<tr><td align=right>Address 2 </td><td><INPUT TYPE=text NAME="address_02" id=address_02 size=40 value="$address_02></td></tr>
<tr><td align=right>City </td><td><INPUT TYPE=text NAME="address_city" id=address_city size=30 value="$address_city></td></tr>
<tr><td align=right>State </td><td><INPUT TYPE=text NAME="address_state" id=address_state size=2 value="$address_state"></td></tr>
<tr><td align=right>Zip </td><td><INPUT TYPE=text NAME="address_postal_code" id=address_postal_code size=10 value="$address_postal_code"></td></tr>
<tr><td colspan=2><center><input type="submit" value="Save Changes" alt="Save Changes"></td></tr>
</form>

And also, the serial number looks like it is passed first by the home page script page which has this:
while (@data = $sth->fetchrow_array()) {
$serial = $data[0];
$name_first = $data[1];
$name_last = $data[2];
$address_01 = $data[3];
$address_02 = $data[4];
$address_city = $data[5];
$address_state = $data[6];
$address_postal_code = $data[7];

print "<tr bgcolor=$bgcolor><td><a href=edit.pl?id=$serial>$serial</a></td><td>$name_first</td><td>$name_last</td><td>$address_01</td><td>$address_02</td><td>$address_city</td><td>$address_state</td><td>$address_postal_code</td><td>";
if ($bgcolor =~ "#EEEEEE") { $bgcolor = "white"; }

Thanks again for your response, you have been infinitely helpful thus far!!



Edited 1 time(s). Last edit at 02/05/2013 09:05AM by adam gruber.

Options: ReplyQuote


Subject
Written By
Posted
Re: MySql, Perl, and HTML Update function not working
February 05, 2013 08:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.