Re: form javascript and php error
| From: | dav | Date: | Thu, 08 Nov 2001 07:49:17 +0000 |
| Subject: | Re: form javascript and php error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73847@lists.php.net to get a copy of this message | ||
I think this is your client/server discussion:
1) When you click load an image called test.php
one clicks
2) Load the test.php
3) SERVER tells client: What is coming now it's an image (it's the header)
4) SERVER sends to client a REDIRECTION (not an image)
5) The client says: Hey, you should have sent an image, not a redirectio,
result: image broken.
SOLUTION:
Showpic function should fopen the remote image and copy byte-to-byte it to
the output so that the client receive image data and not a redirection to an
image
"Bas Jobsen" <bas@startpunt.cc> ha scritto nel messaggio
news:002901c167f6$a89f1c20$9600000a@lan...
> Hello,
>
> I have got this php file:
> --
> <form method='post'>
> <input type='submit' value='SEND'>
> </form>
> <script type="text/javascript" language="JavaScript">
> <!--
> d=document;
> d.write("<img src='test.php'>");
> </script>
> --
> and test.php:
> --
> <?
> function showpic()
> {
> header ("location:
> http://www.linkotheek.nl/images/logo.gif");
> exit;
> }
> showpic();
> exit;
> ?>
> --
>
> pressing the submit button will give my a broken image.
>
> I don't understand why?
>
> Thanks,
>
> Bas
>
>
>
>