GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   php help (https://gfy.com/showthread.php?t=480493)

mkx 06-13-2005 04:38 PM

php help
 
Trying to put an upload file php script on my site. Am getting an error with this script:

Code:

<?php
if(!isset($_POST['Upload']))
{
        include("form_upload.inc");
} # endif
else
{
        if($_FILES['pix']['tmp_name'] hahahaha "none")
        {
                echo "<b>File did not successfully upload. Check the file size. File must be less than 500kB.<br>";
                include("form_upload.inc");
                exit();
        {
        if(!ereg("image",$_FILES['pix']['type']))
        {
                echo "<b>File is not a picture. Please try another file.</b><br>";
                include("form_upload.inc");
                exit();
        }
        else
        {
                $destination = '/home/asianr/public_html/'."\\".$_FILES['pix']['name'];
                $temp_file = $_FILES['pix']['tmp_name'];
                move_uploaded_file($temp_file,$destination);
                echo "<p><b>The file has successfully uploaded:</b>
                        {$_FILES['pix']['name']}
                        ({$_FILES['pix']['size']})</p>";
                        }
                }
        ?>

Parse error: parse error, unexpected $ in /home/asianr/public_html/pa/uploadfile.php on line 30

line 30 shows up as
Code:

                $destination = '/home/asianr/public_html/'."\\".$_FILES['pix']['name'];
I think it could be a problem with the /home/asianr/public_html/ part as everything else was copied from a book but I am not sure what to put.

directfiesta 06-13-2005 04:40 PM

did you set your permissions ( chmod) at the proper level?

mkx 06-13-2005 04:41 PM

yes the folders are at 777

kernelpanic 06-13-2005 04:44 PM

fucked up quotes on or around 30

ddfGandalf 06-13-2005 04:45 PM

icqed you

mkx 06-13-2005 04:45 PM

copied it from a book, would you be able to paste the correct? I would really appreciate it

V_RocKs 06-13-2005 05:04 PM

Code:

if($_FILES['pix']['tmp_name'] hahahaha "none")
        {
                echo "<b>File did not successfully upload. Check the file size. File must be less than 500kB.<br>";
                include("form_upload.inc");
                exit();
        {

The last character I included, { is wrong, should be }

V_RocKs 06-13-2005 05:05 PM

WHEN EVER you get this error, it always means that you did not include enough closing brackets for an if or looping statement of some kind. So check your }'s or lack thereof.


All times are GMT -7. The time now is 01:04 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123