Jason,

here it all is....

thanks for this...
Cheers
Will


HTML EDIT UPLOAD PAGE:
<html>
<head>
<title>my contact management system: add a contact</title>
</head>
<body>
<?

$db_name = "€€€€€€€€";

$table_name = "€€€€€€€€";

$connection = @mysql_connect("€€€€€€€€", "€€€€€€€€", "€€€€€€€€") or die
("couldn't connect.");

$db = @mysql_select_db($db_name, $connection) or die ("couldn't select
database.");

$sql = "select name, email, picture_name from $table_name where id
=\"$id\"";

$result = @mysql_query($sql, $connection) or die ("couldn't execute query");



while ($row = mysql_fetch_array($result)) {

$name = $row['name'];
$email = $row['email'];
$picture_name = $row['picture_name'];


}


?>


<form method="post" action="do_editauthor.php"
ENCTYPE="multipart/form-data">
<input type="hidden" name="id" value="<? echo "$id"; ?>">
  <table cellspace=3 cellpadding=5>
    <tr> 
      <th>Name & email information</th>
      <th>&nbsp;</th>
    </tr>
    <tr> 
      <td valign=top>
        <p><stong><font size="-2" face="Verdana, Arial, Helvetica,
sans-serif">name:</font><br>
          <input type="text" name="name" value="<? echo "$name"; ?>" size=35
maxlength=75>
        </p>
        <p><stong><font size="-2" face="Verdana, Arial, Helvetica,
sans-serif">email:</font><br>
          <input type="text" name="email" value="<? echo "$email"; ?>"
size=35 maxlength=75>
          <br>
        </p><font size="-2" face="Verdana, Arial, Helvetica,
sans-serif">File 
        to Upload:</font><br>
        <input type="file" name="picture" size="30">
        
        <br><br>
        <?
$pic_name = "$id$picture_name";
$path1 = "http://www.€€€€€€€€.net/php/";;
$imageFile = $path1.$pic_name;
        

 
        ?> 
        <img src="<? echo "$imageFile"; ?>">
        <p><stong></p>
      </td>
      <td valign=top>&nbsp;</td>
    </tr>
    <tr> 
      <td align=center colspan=2>
        <div align="left"><br>
        </div>
        <p align="left">
          <input type="submit" name="submit" value="add to contact system">
        </p>
        <div align="left"></div>
        </td>
    </tr>
  </table>
</form>
</body>
</html>



THIS IS THE DOING EDIT SCRIPT:

<?

$db_name = "€€€€€€€€€€";

$table_name = "€€€€€€€€€€";

$connection = @mysql_connect("€€€€€€€€€€", "€€€€€€€€€€", "€€€€€€€€€€") or
die ("couldn't connect.");

$db = @mysql_select_db($db_name, $connection) or die ("couldn't select
database.");

$sql = "UPDATE $table_name SET

name = \"$name\",
email = \"$email\",
picture_name = \"$picture_name\"
where id = \"$id\"

";


$result = @mysql_query($sql, $connection) or die ("couldn't execute query");


if ($picture) {

$path = "/home/€€€€€€€€€€/€€€€€€€€€€/php/";
$path1 = "http://www.€€€€€€€€€€.net/php/";;
$b_id = mysql_insert_id();
$new_pic_name = "$b_id$picture_name";
$imageFile = $path1.$new_pic_name;

copy($picture,$path . $new_pic_name);
        

}



?> 


<html>
<head>
<title>my contact management system: add a contact</title>
</head>
<body>

  <table cellspace=3 cellpadding=5>
    <tr> 
      <th>Name & email information</th>
      <th>&nbsp;</th>
    </tr>
    <tr> 
      <td valign=top>
        <p><stong><font size="-2" face="Verdana, Arial, Helvetica,
sans-serif">name:</font><br>
        <? echo "$table_name"; ?>
          <? echo "$name"; ?>
        </p>
        <p><stong><font size="-2" face="Verdana, Arial, Helvetica,
sans-serif">email:</font><br><? echo "$email"; ?>
          
          <br>
        </p>
        <font size="-2" face="Verdana, Arial, Helvetica, sans-serif">File
        to Upload:</font><br>


<?
$new_pic_name = "$id$picture_name";
$path1 = "http://www.€€€€€€€€€€.net/php/";;
$imageFile = $path1.$new_pic_name;
        

if ($new_pic_name == "$id") {
        
print ("<img 
src=\"http://www.€€€€€€€€€€.co.uk/images/no_image_available.gif\";
width=\"162\" height=\"113\" border=\"0\">");
       
} else { 
      
      
        print "<img src=".$imageFile.">";


               
     
     }
     ?>
         
         
         
         
         <br> 
      <p><stong></p>
      </td>
      <td valign=top>&nbsp;</td>
    </tr>
    <tr> 
      <td align=center colspan=2>
        <div align="left"><br>
        </div>
        <p align="left">
          <input type="submit" name="submit" value="add to contact system">
        </p>
        <div align="left"></div>
        </td>
    </tr>
  </table>
</body>
</html>













in article [EMAIL PROTECTED], Jason Wong at
[EMAIL PROTECTED] wrote on 30/1/02 9:46 am:

> On Wednesday 30 January 2002 17:10, will hives wrote:
>> The code attached was just the code which ran the html form there is
>> another page which contains all the form details, this code just does the
>> editeing and shows you what it's done.
> 
> Could you post the code which does the editing and, in particular, the
> uploading of the image file?
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to