1 |
On Sat, 2011-01-15 at 13:21 -0600, Michael Sullivan wrote: |
2 |
> On Sat, 2011-01-15 at 12:31 -0500, Mark Shields wrote: |
3 |
> > On Fri, Jan 14, 2011 at 10:53 PM, Michael Sullivan |
4 |
> > <msulli1355@×××××.com> wrote: |
5 |
> > On Fri, 2011-01-14 at 22:37 -0500, Mark Shields wrote: |
6 |
> > <trimmed> |
7 |
> > > |
8 |
> > > |
9 |
> > > |
10 |
> > > |
11 |
> > > It's no problem. Gmail realized you had already sent the |
12 |
> > same message |
13 |
> > > and collapsed the whole reply as "quoted text" :) |
14 |
> > > |
15 |
> > > |
16 |
> > > Try running this: |
17 |
> > > |
18 |
> > > |
19 |
> > > # echo "phpinfo();" | xargs php -r |
20 |
> > > |
21 |
> > > |
22 |
> > > What does it output? anything? |
23 |
> > |
24 |
> > |
25 |
> > It outputs a lot of stuff. More than my gnome-terminal buffer |
26 |
> > could |
27 |
> > display (as in I issue a reset before I issue the command you |
28 |
> > sent and I |
29 |
> > can't see the command when I scroll all the way up.) Anything |
30 |
> > in |
31 |
> > particular I should be looking for? Anything I should grep |
32 |
> > for? |
33 |
> > |
34 |
> > |
35 |
> > |
36 |
> > |
37 |
> > I just wanted to see if php-cli works. And it does. |
38 |
> > |
39 |
> > |
40 |
> > I would recommend re-emerging php at this point, then run etc-update |
41 |
> > or dispatch-conf. |
42 |
> > |
43 |
> |
44 |
> I did all three and restarted apache and went to the page. Still only |
45 |
> see code... |
46 |
|
47 |
I've done some further research/testing and discovered that it's only my picture page that's not executing: |
48 |
|
49 |
From http://carter.espersunited.com/~michael/test.php: |
50 |
|
51 |
Warning: Unknown: failed to open stream: Permission denied in Unknown on |
52 |
line 0 |
53 |
|
54 |
Fatal error: Unknown: Failed opening required |
55 |
'/home/michael/public_html/test.php' (include_path='.:/usr/share/php5:/usr/share/php') in Unknown on line 0 |
56 |
|
57 |
PHP executed. It returned errors, but it executed, now from one |
58 |
directory down: |
59 |
|
60 |
From http://carter.espersunited.com/~michael/camera/index.php: |
61 |
|
62 |
\n"; print " \n"; print " \n"; print " \n"; print "\n"; print "\n"; |
63 |
print "\n"; print " |
64 |
\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " |
65 |
\n"; print " |
66 |
$title |
67 |
\n"; print " |
68 |
\n"; print " |
69 |
\n |
70 |
\n"; print " |
71 |
\n"; $dirname = "."; $dh = opendir($dirname); print " |
72 |
\n"; while ( gettype($file = readdir($dh)) != boolean) { if |
73 |
(is_dir("$dirname/$file") && strlen($file) == 6) { #We are in a |
74 |
directory $strMonth = substr($file, 0, 2); $strDay = substr($file, 2, |
75 |
2); $strYear = substr($file, 4, 2); $file = $strYear.$strMonth.$strDay; |
76 |
$dirarray[] = $file; } } closedir($dh); $value = $_POST['Set']; if (! |
77 |
isset($value)) $value="current"; rsort($dirarray, SORT_STRING); if |
78 |
($value == "Current") $value = "current"; if ($value == "current") |
79 |
include("current.php"); if ($value=="All") { foreach ($dirarray as |
80 |
$file) { $strMonth = substr($file, 2, 2); $strDay = substr($file, 4, 2); |
81 |
$strYear = substr($file, 0, 2); $file = $strMonth.$strDay.$strYear; |
82 |
makeTable($dirname, $file); } } if ($value !="current" && $value != |
83 |
"All") makeTable($dirname, $value); showList(); print " |
84 |
\n"; print " \n"; print "\n"; function makeTable($dirname, $file) |
85 |
{ global $text; global $bgcolor; #The name of this directory is in |
86 |
mmddyy format. We need to spit it into its individual parts and print it |
87 |
(mm/dd/yy) $strMonth = substr($file, 0, 2); $strDay = substr($file, 2, |
88 |
2); $strYear = substr($file, 4); print "\n"; print " \n"; print " \n"; |
89 |
print "\n"; print " |
90 |
\n"; print " |
91 |
Added $strMonth"."/".$strDay."/".$strYear." |
92 |
\n"; print " |
93 |
\n"; $subdirname = $file; $eh = opendir($subdirname); #We need to make a |
94 |
table for the thumbnails to appear in... print " \n"; print "\n"; $count |
95 |
= 1; while (gettype($subfile = readdir($eh)) != boolean) { $ext = |
96 |
substr($subfile, strlen($subfile) - 3, 3); $ext = strtolower($ext); if |
97 |
(!is_dir("$dirname/$subdirname/$subfile") && $ext == "jpg") { print |
98 |
"\n"; $count++; if ($count > 5) { print "\n"; print "\n"; $count = |
99 |
1; } } } print " "; print " |
100 |
\n"; print " |
101 |
\n"; } function makeList($file) { print " $file\n"; } function |
102 |
showList() { global $dirarray; global $dirname; print "\n"; print " \n"; |
103 |
print "\n"; } ?> |
104 |
\n"; //print "$subfile |
105 |
\n"; $subfilename = htmlspecialchars($subfile, ENT_QUOTES); $filename = |
106 |
$dirname."/".$subdirname."/mini/mini-".$subfilename; print "\n"; print |
107 |
"\"$subfile\"\n"; print "\n"; print " |
108 |
|
109 |
It occurs to me that I might have an error in the script itself. I have |
110 |
posted the entire script here: |
111 |
|
112 |
michael@carter ~/public_html/camera $ cat index.php |
113 |
<? |
114 |
$title = "My Pictures"; |
115 |
$bgcolor = "#339966"; |
116 |
$text = "#FFFF00"; |
117 |
|
118 |
print "<html>\n"; |
119 |
print " <head>\n"; |
120 |
print " <title>$title</title>\n"; |
121 |
print " </head>\n"; |
122 |
print "\n"; |
123 |
print "<body background='../images/pawborder.gif' bgcolor='$bgcolor' |
124 |
text='$text'>\n"; |
125 |
print "\n"; |
126 |
print "<center>\n"; |
127 |
print "<table cellspacing='0' cellpadding='0' bgcolor='$bgcolor'>\n"; |
128 |
print " <tr>\n"; |
129 |
print " <td align='center'>\n"; |
130 |
print " <h1>$title</h1>\n"; |
131 |
print " </td>\n"; |
132 |
print " </tr>\n"; |
133 |
print "</table>\n"; |
134 |
print "<br>\n<br>\n"; |
135 |
print "</center>\n"; |
136 |
|
137 |
|
138 |
$dirname = "."; |
139 |
$dh = opendir($dirname); |
140 |
print "<center>\n"; |
141 |
while ( gettype($file = readdir($dh)) != boolean) |
142 |
{ |
143 |
if (is_dir("$dirname/$file") && strlen($file) == 6) |
144 |
{ #We are in a directory |
145 |
$strMonth = substr($file, 0, 2); |
146 |
$strDay = substr($file, 2, 2); |
147 |
$strYear = substr($file, 4, 2); |
148 |
$file = $strYear.$strMonth.$strDay; |
149 |
|
150 |
$dirarray[] = $file; |
151 |
} |
152 |
} |
153 |
closedir($dh); |
154 |
|
155 |
$value = $_POST['Set']; |
156 |
if (!isset($value)) $value="current"; |
157 |
rsort($dirarray, SORT_STRING); |
158 |
if ($value == "Current") $value = "current"; |
159 |
if ($value == "current") include("current.php"); |
160 |
|
161 |
if ($value=="All") |
162 |
{ |
163 |
foreach ($dirarray as $file) |
164 |
{ |
165 |
$strMonth = substr($file, 2, 2); |
166 |
$strDay = substr($file, 4, 2); |
167 |
$strYear = substr($file, 0, 2); |
168 |
$file = $strMonth.$strDay.$strYear; |
169 |
|
170 |
makeTable($dirname, $file); |
171 |
} |
172 |
} |
173 |
if ($value !="current" && $value != "All") makeTable($dirname, $value); |
174 |
|
175 |
showList(); |
176 |
print " </center>\n"; |
177 |
print " </body>\n"; |
178 |
print "</html>\n"; |
179 |
|
180 |
|
181 |
function makeTable($dirname, $file) |
182 |
{ |
183 |
global $text; |
184 |
global $bgcolor; |
185 |
#The name of this directory is in mmddyy format. We need to spit |
186 |
it into its individual parts and print it (mm/dd/yy) |
187 |
$strMonth = substr($file, 0, 2); |
188 |
$strDay = substr($file, 2, 2); |
189 |
$strYear = substr($file, 4); |
190 |
print "<table cellspacing='0' cellpadding='0' bgcolor='$bgcolor' |
191 |
border='3'>\n"; |
192 |
|
193 |
print " <tr>\n"; |
194 |
print " <td align='center'>\n"; |
195 |
|
196 |
print " <h3>Added |
197 |
$strMonth"."/".$strDay."/".$strYear."</h3>\n"; |
198 |
print "</td>\n"; |
199 |
print "</tr>\n"; |
200 |
print "</table>\n"; |
201 |
$subdirname = $file; |
202 |
$eh = opendir($subdirname); |
203 |
|
204 |
#We need to make a table for the thumbnails to appear in... |
205 |
print " <table cellspacing='0' cellpadding='0'>\n"; |
206 |
|
207 |
print "<tr>\n"; |
208 |
$count = 1; |
209 |
while (gettype($subfile = readdir($eh)) != boolean) |
210 |
{ |
211 |
$ext = substr($subfile, strlen($subfile) - 3, 3); |
212 |
$ext = strtolower($ext); |
213 |
if (!is_dir("$dirname/$subdirname/$subfile") && $ext == "jpg") |
214 |
{ |
215 |
print "<td>\n"; |
216 |
//print "$subfile<br>\n"; |
217 |
$subfilename = htmlspecialchars($subfile, ENT_QUOTES); |
218 |
$filename = $dirname."/".$subdirname."/mini/mini-".$subfilename; |
219 |
print "<a href='".$dirname."/".$subdirname."/".$subfilename."'>\n"; |
220 |
print "<img src='$filename' width=100 height=100 alt=\"$subfile |
221 |
\">\n"; |
222 |
print "</a>\n"; |
223 |
print "</td>\n"; |
224 |
$count++; |
225 |
if ($count > 5) |
226 |
{ |
227 |
print "</tr>\n"; |
228 |
print "<tr>\n"; |
229 |
$count = 1; |
230 |
} |
231 |
} |
232 |
} |
233 |
print " </tr>"; |
234 |
print " </table\n"; |
235 |
print " <br>\n"; |
236 |
print " <br>\n"; |
237 |
} |
238 |
|
239 |
function makeList($file) |
240 |
{ |
241 |
print " <option>$file</option>\n"; |
242 |
} |
243 |
|
244 |
function showList() |
245 |
{ |
246 |
global $dirarray; |
247 |
global $dirname; |
248 |
print "<form action='index.php' method='post'>\n"; |
249 |
print " <select name='Set'>\n"; |
250 |
print " <option>All</option>\n"; |
251 |
print " <option selected>Current</option>\n"; |
252 |
foreach ($dirarray as $file) |
253 |
{ |
254 |
$strMonth = substr($file, 2, 2); |
255 |
$strDay = substr($file, 4, 2); |
256 |
$strYear = substr($file, 0, 2); |
257 |
$file = $strMonth.$strDay.$strYear; |
258 |
|
259 |
makeList($file); |
260 |
} |
261 |
print " <br><br><input type='submit' value='Select'>\n"; |
262 |
print "</form>\n"; |
263 |
|
264 |
} |
265 |
?> |
266 |
|
267 |
Do you see anything here that would cause PHP to output its code instead |
268 |
of executing it? |