Advertisement

08.27.2008 at 12:29PM PDT, ID: 23683249
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

php Image white space

Asked by walker6o9 in PHP Scripting Language

Tags:

I'm using a php script to load in image files.  For some reason, there is a white border around the images that I can't seem to get rid of. Is there a way to get rid of it?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
<?php
 
 
$SCRIPT_NAME=$SERVER_VARS['PHP_SELF'];
$pic=$HTTP_GET_VARS['pic'];
 
$handle=opendir('.');
 
$pics=array();
$count=0;
$bg="#cccccc";
 
while (($file = readdir($handle))!==false) {
                
        if (substr($file,-4) == ".jpg" || substr($file,-4) == ".gif" || substr($file,-4) == ".png" || substr($file,-4) == ".JPG" || substr($file,-4) == ".GIF" || substr($file,-4) == ".PNG"){
        
                $pics[$count] = $file;
                $count++;
        
        }
}
closedir($handle); 
 
 
sort($pics);
reset($pics);
 
 
$nextpicindex = (array_search($pic, $pics) + 1) % count($pics);
$nextpic = $pics[$nextpicindex]; 
// check to see if $pic is populated
// if not, and $pics has some filenames, set $pic to the first one
if (!$pic && (count($pics)>0)) { $pic=$pics[0]; }
 
 $name="";
//      if there is already a pic selected...
if ($pic && !preg_match("/javascript/",$pic)){
      //      if the text should be displayed
            // Capitalize filename for display andf print it
            $name=ucfirst(substr($pic,0,-4));
 }
 ?>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
<html>
 
<title><?php echo "Image: ".$name."    Number: ". ($nextpicindex-1)."/".sizeof($pics);?></title>
 
 
<?php
//	if there is already a pic selected...
if ($pic && !preg_match("/javascript/",$pic)){
	//	if the text should be displayed
		// Capitalize filename for display andf print it
		$name=ucfirst(substr($pic,0,-4));
		//echo "\n\t\t<!-- imagename -->\n\t\t<b>".$name;
		//echo " ".$selected."/".sizeof($pics);
	//echo "</b>\n\t\t<!-- imagename end -->\n<p />";
	// Display table with for+next arrows, and a black line around the image
   //echo "\t\t<!-- table with image -->\n\t\t<table width=1 border=0 cellspacing=0 cellpadding=1 bgcolor=\"#000000\">\n\t\t\t<tr>\n\t\t\t\t<td bgcolor=\"".$bg."\">";
	
	
		echo"<a href=\"index.php?pic=" . urlencode($nextpic) . "\"><image src=\"".$pic."\" alt=\"".$name."\"</a>";
	
	//echo"</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<!-- table with image end -->\n\t\t<!-- Textlinks--->\n\t\t";
}
	
		for ($f=0;$f<=sizeof($pics)-1;$f++){if ($pic==$pics[$f]){$selected = $f+1;}}
 
	echo "\t\t<!-- dropdown -->\n\t\t<form name=\"mainform\">\n\t\t\t<select name=\"pic\">\n";
	//	loop over all pics
	for ($f=0;$f<=sizeof($pics)-1;$f++){
		//	Capitalize filename for display
		$name=ucfirst(substr($pics[$f],0,-4));
		// if the pic is the selected one set selected status
		if ($pic==$pics[$f]){echo "\t\t\t\t<option value=\"".$pics[$f]."\" selected>".$name."</option>\n";}
		//	or simply render another option
		else{echo "\t\t\t\t<option value=\"".$pics[$f]."\">".$name."</option>\n";}
		}
	// close select statement and display show button with predefined text.
	echo "\t\t\t</select>\n\t\t\t&nbsp;<input type=\"submit\" value=\"show\">\n\t\t</form>\n\t\t<!-- end dropdown --><p />";
 
	
?>
 
</html>
[+][-]08.27.2008 at 12:56PM PDT, ID: 22328567

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.29.2008 at 02:47PM PDT, ID: 22349528

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 06:46AM PDT, ID: 22367229

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 09:43AM PDT, ID: 22369001

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 09:46AM PDT, ID: 22369017

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 09:51AM PDT, ID: 22369064

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 10:40AM PDT, ID: 22369555

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 10:50AM PDT, ID: 22369651

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 10:51AM PDT, ID: 22369665

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 11:00AM PDT, ID: 22369748

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 11:17AM PDT, ID: 22369909

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 03:57PM PDT, ID: 22372500

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 04:24PM PDT, ID: 22372650

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: php
Sign Up Now!
Solution Provided By: glassgiant
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.03.2008 at 10:43AM PDT, ID: 22379675

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 11:08AM PDT, ID: 22380041

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 11:25AM PDT, ID: 22380253

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 03:05PM PDT, ID: 22382473

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 03:06PM PDT, ID: 22382480

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628