Jump to content

[SOLVED] Fatal error: Only variables can be passed by reference in ...


Recommended Posts

Hey guys,

 

I'm running php 5.2.8 [the newest] on centOS

 

I'm getting :

 

Fatal error: Only variables can be passed by reference in /home/deathbyb/public_html/modules/imports.php on line 58

 

I've never seen this error before, here's line 58

 

	$fh = fsockopen($values["video"], 80, $errno, 300);

 

Any suggestions ?

 

Post line 48-68 for us to better help you.

 

And a google of the error:

 

http://the-stickman.com/web-development/php/php-505-fatal-error-only-variables-can-be-passed-by-reference/

 

That should explain what is happening better.

	$curl = curl_init(); 
	curl_setopt($curl, CURLOPT_URL,$LOGINURL); 
	curl_setopt($curl, CURLOPT_USERAGENT, $agent); 
	curl_setopt($curl, CURLOPT_POST, 1); 
	curl_setopt($curl, CURLOPT_POSTFIELDS,$POSTFIELDS); 
	curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 
	curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); 
	curl_setopt($curl, CURLOPT_REFERER, $reffer); 
	curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path); 
	curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path); 
	$store = curl_exec ($curl); 

	$url = $values["video"];
	$fh = fsockopen($url, 80, $errno, 300);
		if(!$fh) {
			return $errno;
		} else {
			$headers = get_headers($values["video"],1);
			print_r($headers);exit;
		}
			$hdr .= "POST ".$headers["0"]." HTTP/1.0\r\n";
	        $hdr .= "Host: $host\r\n";
	        $hdr .= "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n";
	        $hdr .= "Content-Type: application/x-www-form-urlencoded\r\n";
	        $hdr .= "Content-Length: ".strlen($uri)."\r\n";
	        $hdr .= "Connection: close\r\n\r\n";

 

and believe it or not i did google it, but everything was saying it was a bug in 5.0.5...

okay here is my newest code

 

    	$host_details = parse_url($values["video"]);
    	$host = $host_details["host"];

        $fh = fsockopen($host, 80, $errno, 5);
        if($fh) {
			return "error";
		} else {

 

i know $values["video"] is set...

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.