php help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mkx
    Confirmed User
    • Nov 2003
    • 4001

    #1

    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
    Too lazy to set a custom title
    • Oct 2002
    • 30135

    #2
    did you set your permissions ( chmod) at the proper level?
    I know that Asspimple is stoopid ... As he says, it is a FACT !

    But I can't figure out how he can breathe or type , at the same time ....

    Comment

    • mkx
      Confirmed User
      • Nov 2003
      • 4001

      #3
      yes the folders are at 777

      Comment

      • kernelpanic
        Too lazy to set a custom title
        • Jan 2005
        • 2961

        #4
        fucked up quotes on or around 30


        ZangoCash - Turn Your Traffic Into Ca$h.
        $.40 Per Install - No Tier

        Comment

        • ddfGandalf
          Confirmed User
          • Feb 2005
          • 534

          #5
          icqed you

          Comment

          • mkx
            Confirmed User
            • Nov 2003
            • 4001

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

            Comment

            • V_RocKs
              Damn Right I Kiss Ass!
              • Nov 2003
              • 32449

              #7
              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 }

              Comment

              • V_RocKs
                Damn Right I Kiss Ass!
                • Nov 2003
                • 32449

                #8
                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.

                Comment

                Working...