Welcome to Geeklog, Anonymous Friday, January 10 2025 @ 05:40 am EST
Geeklog Forums
Warning messages appearing on top
Status: offline
jordydme
Forum User
Full Member
Registered: 11/03/05
Posts: 135
Hi,
Lately my sight has abeen intermitantly displaying code at the top. I read the FAQ's and deleted white space at the end of lib-custom but still no luck, the code still persists. Below is the entire code that appears.
Warning: Cannot modify header information - headers already sent by (output started at /home/jordydme/geeklog_data/system/lib-custom.php:513) in /home/jordydme/public_html/geeklog/lib-common.php(985) : eval()'d code on line 1
Here is a block of code I copied from my lib-custom that includes the above mentioned line 513.
// urlencode spaces in file name
$uinfo[photo] = str_replace(' ','%20',$uinfo[photo]);
// get and size picture
$uphoto_url = $pathtoimages . $uinfo[photo];
$uphoto_size = getimagesize($uphoto_url); // returns an array
// skip the rest if unable to access the photo
if (!empty($uphoto_size)) {
$uphoto_width = $uphoto_size[0];
$uphoto_height = $uphoto_size[1];
// determine which dimension is larger
if ($uphoto_height > $uphoto_width) {
$largest = "uphoto_height";
}
elseif ($uphoto_width > $uphoto_height) {
$largest = "uphoto_width";
}
else { // they are equal
$largest = "uphoto_height";
}
Any insite would be welcomed.
Thanks,
Jordy
Lately my sight has abeen intermitantly displaying code at the top. I read the FAQ's and deleted white space at the end of lib-custom but still no luck, the code still persists. Below is the entire code that appears.
Text Formatted Code
Warning: getimagesize(/home/jordydme/public_html/geeklog/images/userphotos/Eddie%20Torres.jpg): failed to open stream: No such file or directory in /home/jordydme/geeklog_data/system/lib-custom.php on line 513Warning: Cannot modify header information - headers already sent by (output started at /home/jordydme/geeklog_data/system/lib-custom.php:513) in /home/jordydme/public_html/geeklog/lib-common.php(985) : eval()'d code on line 1
Here is a block of code I copied from my lib-custom that includes the above mentioned line 513.
Text Formatted Code
// urlencode spaces in file name
$uinfo[photo] = str_replace(' ','%20',$uinfo[photo]);
// get and size picture
$uphoto_url = $pathtoimages . $uinfo[photo];
$uphoto_size = getimagesize($uphoto_url); // returns an array
// skip the rest if unable to access the photo
if (!empty($uphoto_size)) {
$uphoto_width = $uphoto_size[0];
$uphoto_height = $uphoto_size[1];
// determine which dimension is larger
if ($uphoto_height > $uphoto_width) {
$largest = "uphoto_height";
}
elseif ($uphoto_width > $uphoto_height) {
$largest = "uphoto_width";
}
else { // they are equal
$largest = "uphoto_height";
}
Any insite would be welcomed.
Thanks,
Jordy
9
10
Quote
Status: Banned
machinari
Forum User
Full Member
Registered: 03/22/04
Posts: 1512
it's pretty clear, and the server doesn't lie.
the function, getimagesize() cannot find the file it is looking for according to the path/filename it has been supplied. You'll need to check to see if that file physically exists on the server where that function is looking. If it exists there, then check the name and spelling of the file name. Also check to ensure that the file can be accessed, i.e., proper permissions are set on the file and the directory that it resides in.
as for the second error, "cannot modify header info", that is just caused by the first error. once you fix the first one, your second one will go away by itself. it has nothing to do with whitespace in this case.
the function, getimagesize() cannot find the file it is looking for according to the path/filename it has been supplied. You'll need to check to see if that file physically exists on the server where that function is looking. If it exists there, then check the name and spelling of the file name. Also check to ensure that the file can be accessed, i.e., proper permissions are set on the file and the directory that it resides in.
as for the second error, "cannot modify header info", that is just caused by the first error. once you fix the first one, your second one will go away by itself. it has nothing to do with whitespace in this case.
10
8
Quote
Status: Banned
machinari
Forum User
Full Member
Registered: 03/22/04
Posts: 1512
you could also try wrapping your variable filename in double quotes, eg:
Text Formatted Code
getimagesize("$uphoto_url")
11
12
Quote
Status: offline
jordydme
Forum User
Full Member
Registered: 11/03/05
Posts: 135
I was confused because the image in question is appearing fine in that user's profile. The server does appear to be finding the image file however, let me ask you this: Is is possible that because this user chose a username with a space and the photo file name also has that space, could that have something to do with it? I remember hearing somehting about not having spaces in usernames.
Thanks,
jordy
Thanks,
jordy
8
11
Quote
Status: Banned
machinari
Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Quote by jordydme: I was confused because the image in question is appearing fine in that user's profile.
the image may be the same one used in both places, but the code handling that image is not the same. your uphoto script seems to be giving your the problem while the script handling the image for the profile is probably Geeklogs default script, right? If so, then the problem remains with the uphoto script.If you think it is the space, then rename the file and try again, but the str_replace really should have done the job.
9
7
Quote
All times are EST. The time is now 05:40 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content