Jump to content

Recommended Posts

I'm trying to make a plugboard (success) that allows the input of common button sizes (88x31, 100x35, 468x60 [success]) and displays them based on the get variable (FAIL). But my problem is, it's not following the GET, it just prints everything:

$myFile is the file (that part works fine)

 
if($_GET[ads]="small"){
$file_handle = fopen($myFile, "rb");
	while (!feof($file_handle) ) {
		$line_of_text = fgets($file_handle);
		$parts = explode('|', $line_of_text);	
		if($parts[4] == "0" && $parts[0]== 31){
			$alt= $parts[2];
			if($parts[2]==""){$alt=$parts[3];}
			echo " <a href=\"".$parts[3]."\"><img src=\"".$parts[1]."\" alt=\"".$alt."\" target=\"_blank\"></a>";
		}
	}
}
if($_GET[ads]="medium"){
$file_handle = fopen($myFile, "rb");
	while (!feof($file_handle) ) {
		$line_of_text = fgets($file_handle);
		$parts = explode('|', $line_of_text);	
		if($parts[4] == "0" && $parts[0]== 35){
			$alt= $parts[2];
			if($parts[2]==""){$alt=$parts[3];}
			echo "<a href=\"".$parts[3]."\"><img src=\"".$parts[1]."\" alt=\"".$alt."\" target=\"_blank\"></a>";
		}
	}
}
if($_GET[ads]="large"){
$file_handle = fopen($myFile, "rb");
	while (!feof($file_handle) ) {
		$line_of_text = fgets($file_handle);
		$parts = explode('|', $line_of_text);	
		if($parts[4] == "0" && $parts[0]== 35){
			$alt= $parts[2];
			if($parts[2]==""){$alt=$parts[3];}
			echo "<a href=\"".$parts[3]."\"><img src=\"".$parts[1]."\" alt=\"".$alt."\" target=\"_blank\"></a>";
		}
	}
}

 

Does anyone see why this would not work?  :shrug: Any help would be greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/180475-problem-with-get-variable-and-fopen/
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.