1.11M Members

T_STRING error

 
0
 

Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\E-COMMERCE\admin\inventory_list.php on line 55

move_uploaded_file($_FILES['fileField']['tmp_name'], "../inventory_images/$newname");

what is t_string error?
here is almst full full.

<?php...

$sql = mysql_query("INSERT INTO products (product_name, price, details, category, subcategory, date_added)
VALUES('$product_name','$price','$details','$category','subcategory','details', now())")or die("insert error");

$pid = mysql_insert_id(); 
    $newname = "$pid.jpg"
    move_uploaded_file($_FILES['fileField']['tmp_name'], "../inventory_images/$newname");
    ...?

    <html>
    ....
    <form action="inventory_list.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post">
     ...
                <input type="file" name="fileField" id="fileField"/>
                <input type="submit" name="button" id="button" value="add this item now">
    </form>
    ...
    </html>
 
0
 

You're missing a semi-colon at the end of line 2.

 
0
 
$newname = "$pid.jpg" //Semi Colon ; missing. FIX IT! And Try Again
Isn't it about time forums rewarded their contributors?

Earn rewards points for helping others. Gain kudos. Cash out. Get better answers yourself.

It's as simple as contributing editorial or replying to discussions labeled or OP Kudos

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article