php used to upload an image to file. It gets renamed, but how do I work with the newly named image?

Sep 21st, 2009 | By KC | Category: PHP Related

I have a form which includes an upload picture button.

The php afterwards renames a picture to a pointless series to safeguard it is unique, as well as places it in to a printed matter declared uploads.

The rest of a form report goes off in to a database. we need a pointless picture series to be copied in to which form additionally as it will work as a anxiety after upon to couple a form interpretation as well as a picture together, though we have no thought how.

Any suggestions?

One comment
Leave a comment »

  1. You can either insert it manually or use a hidden form. Here’s how to do it manually:
    <?php
    $image_name = RANDOM IMAGE NAME;
    $query = sprintf("INSERT INTO `table_name` SET `field_for_image_name`=’%s’, $image_name);
    $result = mysql_query($query);
    if (mysql_num_rows($result) != 0) {
    // Success inserting, do whatever
    } else {
    // Failed inserting, throw up error or whatever
    }
    ?>

Leave Comment