Zubrag.com
February 03, 2012, 08:56:11 pm
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Search
Login
Register
Zubrag.com :: Forum
>
zubrag.com
>
Questions About Our Scripts
>
Thumbnail Generator
>
Custom error image at thumbs creator
Pages: [
1
]
Print
Author
Topic: Custom error image at thumbs creator (Read 7169 times)
danny
Newbie
Posts: 3
Custom error image at thumbs creator
«
on:
March 13, 2007, 01:36:02 pm »
Thank you very much for your wonderful script! Do you know how can I replace an error for a custom image?
For example if the image is not specified or found.
if (isset($_REQUEST['src'])) {
$from_name = urldecode($_REQUEST['src']);
}
else {
die("Source file name must be specified.");
}
Thank you =)
Logged
zubrag
Administrator
Hero Member
Posts: 744
Re: Custom error image at thumbs creator
«
Reply #1 on:
March 13, 2007, 01:47:01 pm »
Do you mean show custom image instead of error message?
Replace
die("Source file name must be specified.");
with
header("Content-type:
image/gif
");
readfile('/here/path/to/your/custom/image.gif');
die();
This is for custom error image of
GIF
type.
If you custom error image is
JPG
then replace
image/gif
with
image/jpeg
.
If you custom error image is
PNG
then replace
image/gif
with
image/png
.
Logged
danny
Newbie
Posts: 3
Re: Custom error image at thumbs creator
«
Reply #2 on:
March 13, 2007, 02:53:12 pm »
Hi Zubrag, thank you for your reply. yes, I want it show an image when an incomplete action is typed:
http://domain.com/pics/thumb.php?src=
but I get this error...
Warning: getimagesize(): Read error! in /home/host/public_html/pics/thumb.php on line x
Image type not supported
My readfile is the same $images_folder
if (isset($_REQUEST['src'])) {
$from_name = urldecode($_REQUEST['src']);
}
else {
header("Content-type:image/jpg");
readfile('/home/host/public_html/pics/image.jpg/');
die();
}
Best Regards =)
Logged
zubrag
Administrator
Hero Member
Posts: 744
Re: Custom error image at thumbs creator
«
Reply #3 on:
March 14, 2007, 03:52:19 am »
Changed code. Note: also removed / after the image name.
if (isset($_REQUEST['src']) && trim($_REQUEST['src']) != '') {
$from_name = urldecode($_REQUEST['src']);
}
else {
header("Content-type:image/jpg");
readfile('/home/host/public_html/pics/image.jpg');
die();
}
Logged
danny
Newbie
Posts: 3
Re: Custom error image at thumbs creator
«
Reply #4 on:
March 14, 2007, 10:30:01 am »
Hi !
I made the changes but I got this error:
Parse error: syntax error, unexpected ')' in /home/host/public_html/pics/thumb.php on line 68
if (isset($_REQUEST['src']) && trim($_REQUEST['src']) !=) {
$from_name = urldecode($_REQUEST['src']);
}
Thanks !
Logged
zubrag
Administrator
Hero Member
Posts: 744
Re: Custom error image at thumbs creator
«
Reply #5 on:
March 14, 2007, 11:32:20 am »
You missed two single quotes before closing bracket. It should be
if (isset($_REQUEST['src']) && trim($_REQUEST['src']) != '') {
Logged
Pages: [
1
]
Print
Jump to:
Please select a destination:
-----------------------------
zubrag.com
-----------------------------
=> News
=> Questions About Our Scripts
===> Password Protect
===> Password Protect Advanced
===> cPanel Scripts
===> Thumbnail Generator
===> Website Thumbnail Generator
===> Smart File Download
===> Anti Spam Image Generator
===> Watermark
=> Wish List / Suggestions
=> Bugs / Known Issues
-----------------------------
Webmasters Lounge
-----------------------------
=> Tips and Tricks
=> Webmasters: General Discussion
-----------------------------
Programmers Lounge
-----------------------------
=> PHP / MySql / Smarty Questions
=> Tips and Tricks
=> Programmers: General Discussion
-----------------------------
General Category
-----------------------------
=> General Discussion
Loading...