Click to See Complete Forum and Search --> : Redirect question
Korax
October 12th, 2006, 07:18 AM
Hello,
I have quite weird question.
Is it possible to redirect from a binary page to some other page.
Source page has Content-type: image/gif.
Image is readed using binary fopen() and fread() and then outputed on the screen using echo... Problem is that after showing the image some next steps should be done, but script "stops" on this point... :(
Is there any way to solve this? Sorry, if it's very lame question...
WML/PHP4 combination is used. So, meta tags, Javascript can't be used...
PHP's header("Location: ...") function doesn't work also... :(
Webserver is IIS.
Thanks in advance!
PeejAvery
October 12th, 2006, 08:39 AM
So you are trying to redirect a page that is only showing an image? Is it just the path to the image such as ... http://www.domain.com/path/image.gif?
Can you possible provide some code with what you are using?
Korax
October 13th, 2006, 07:15 AM
Yes, I'm trying to redirect from a page, which shows only image.
Here is the code, I'm using:
...
ob_end_clean();
if (connection_status() != 0) return FALSE;
header("Content-Type: image/gif");
header("Content-Length: " . (string)(filesize($name)));
header("Content-Disposition: inline; filename=" . $name);
header("Content-Transfer-Encoding: binary\r\n");
$bBreak = false;
$content = "";
if ($file = fopen($name, 'rb')) {
while(!feof($file) and (connection_status() == 0)) {
$content = fread($file, 1024 * 8);
echo $content;
flush();
if($content === FALSE) {
$bBreak = true;
break;
}
}
fclose($file);
}
if((connection_status() == 0) and !connection_aborted() and !$bBreak)
return TRUE;
else
return FALSE;
...
Some of the code was skipped.
If you have some hint, I'll be very thankful.
PeejAvery
October 13th, 2006, 08:33 AM
WML/PHP4 combination is used. So, meta tags, Javascript can't be used...
PHP's header("Location: ...") function doesn't work also... :(
Well, that pretty much puts you down to nothing. Since PHP is used, is there a reason why you are not echoing a JavaScript redirect?
Korax
October 16th, 2006, 07:30 AM
Well, that pretty much puts you down to nothing. Since PHP is used, is there a reason why you are not echoing a JavaScript redirect?
Because WML doesn't support Javascript. :(
PeejAvery
October 16th, 2006, 11:25 AM
Because WML doesn't support Javascript. :(
But you can redirect using HTML as well. Can't you echo HTML?
<meta http-equiv="Refresh" content="5;url=http://www.google.com">
Korax
October 17th, 2006, 02:27 PM
Well, I repeat one more time. The page is done in WML, not in HTML and meta tags can't be used... I wrote it in the first message of this thread.
But you can redirect using HTML as well. Can't you echo HTML?
<meta http-equiv="Refresh" content="5;url=http://www.google.com">
PeejAvery
October 17th, 2006, 04:24 PM
Well, I repeat one more time. The page is done in WML, not in HTML and meta tags can't be used... I wrote it in the first message of this thread.
If META tags cannot be used, why are they part of WML?
WML META tag (http://www.w3schools.com/wap/tag_meta.asp)
szpilman
October 17th, 2006, 10:37 PM
hi KORAX, please do allow me to answer it :)
maybe this one do not answer directly to ur question, but this one is just another suggestion how to do the redirection.
what about making such thing (i dont remember much those WML tags, but i have learned it before at a glnce :) )
<IMG src="file_that_shows_image.php?image=imageexample.gif">
<br>
<a href="link_to_another_page.php">GO TO HERE</a>
above code just another way how u can show an image produced from PHP into a page, and then add a link below the image to redirect to another page.
is this what u mean ? please confirm it isnot ... :)
thnx
rgrds,
szpilman
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.