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
https://forums.phpfreaks.com/topic/153790-solved-parse-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.