Hi everyone, I have been struggeling with this for some time know and don't
know where it goes wrong. I want to upload pictures into a folder AND store
their path into MySQL. I used a joe's auto tutorial but can't get it to
work. All the information is put in correctly but not the picture.

Please help me, here's my code: (ps globals are off)

if ($_POST[submit]) {

$link = mysql_pconnect("localhost","myusername","mypassword");
$db = test;

$query = "INSERT INTO inventory

exec("cp $_POST[picture]

mysql_query( $query, $link);
print 'Thank you<br>You have submitted the following information:<br>';
echo "Registration: $_POST[registration]<br>\n";
echo "Type: $_POST[type]<br>\n";
echo "Total Time: $_POST[total_time]<br>\n";
echo "Price: $_POST[price]<br>\n";
echo "Description: $_POST[description]<br>\n";
echo "temp file: $_POST[picture]<br>\n";
echo "file name: $_POST[picture_name]<br>\n";
echo "file size: $_POST[picture_size]<br>\n";
echo "file type: $_POST[picture_type]<br>\n";
echo "<br>\n";
echo "<img src=images/$picture_name><br>\n";
else { ?>
    <form enctype="multipart/form-data" method="post"
action="<?php echo $PHP_SELF ?>">
        <input type="Text" name="registration" size="25" value="N">
        <input type="Text" name="type" size="25">
        total time<br>
        <input type="Text" name="total_time" size="25">
        <input type="Text" name="price" size="25">
        <textarea name="description"></textarea>
        <input type="file" name="picture" size="25">
        <input type="submit" name="submit" value="Upload">


Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching????

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to