Hi everyone,

every time I try to upload a picture I get the same problem in return. First
of all, it's not being uploaded (but this is for later concern I'm afraid).
Trying to display the info of the (not)uploaded file should be done with:


but every time I run this the return is a error like this:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\apache\htdocs\seabird.jmtech.ca\otf.com\submit.php on
line 69

If I leave out the qoutes it runs fine but my output (echo) is Array['name']

Running a FILES list gives correct names and everything. Where did this go

Here's my code aswell.... please help me, don't point me to another website
or manual (have read a dozen, and I'm still stuck).

if ($_POST[submit]) {

$link = mysql_pconnect("localhost","myuser","mypass");
$db = test;

$query = "INSERT INTO inventory

exec("cp $_FILES[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: $_FILES[picture]<br>\n";
echo "file name: $_FILES[picture][name]<br>\n";
echo "file size: $_FILES[picture][size]<br>\n";
echo "file type: $_FILES[picture][type]<br>\n";
echo "<br>\n";
echo "<img src=images/$_FILES[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">
echo "<pre>";
print_r($_FILES);  // or use print_r($_POST) if you are using a POST instead
of a GET method for your form
echo "</pre>";


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