Jump to content

[SOLVED] Parse Error


phpSensei

Recommended Posts

On line 6 this class has a parse error. I havnt used PHP in a long time, I trasnfered to VB.net, C++, and now its so funny trying to code. I put IF THEN, I missed semi colons if not totally not using them, so if you are kind enough to take a quick look I would be happy.

 

<?php
class upload{
    // visibilities
Private  $checkpoints = 0; // how many check points has the software gone through
Private  $sitelink  = "http://localhost/classes/upload.class.php"; // We Need This For Hack Attempts
Private  $referrer = $_SERVER['HTTP_REFERRER']; // Our Http Ref
Private  $domain = $sitelink;
    Private  $file = array("filename" =>"","filetype" => "","filesize" => "","filetemp" => "");// Stack of allowed file types

// our main function
function uploader($filename,$filetype,$filesize,$filetemp){
            
			// Assing the variables
                $file["filename"] = $filename;
                $file["filetype"] = $filetype;
			$file["filesize"] = $filesize;
			$file["filetemp"] = $filetemp;

	// Check the referrer
	if (checkHttp($sitelink,$referrer)==true){

	  print "You're Http Referrer is just fine";
			   
	}
}
// hack attemp 1
function checkHttp($sitelink,$htttpreferrer){
   // check if there is any output
   if ($httpreferrer == ""){
       $this->domain = $sitelink;
	   return true;		   
   }else{ 
       $this->domain = parse_url($httpreferrer);
	   return true; 
   }
   if($httpreferrer == $sitelink){
       return true;
   }else{
       return false;
   }
}
// this function can be further expanded, but the main reason I made it is to check for usual security issues
function checkVars($var){
	 // check if variable is empty
	 if (empty($var)){
	    // trigger error
	 }
}

function checkFileSize(){

}

function checkFileType(){

}

function checkDuplicate(){

}

function checkHash(){

}

}

// Testingggg!!! love this part
$file = new upload;
$file = $file->uploader(1,2,3,4);
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.