By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,180 Members | 1,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,180 IT Pros & Developers. It's quick & easy.

include asp in php

P: n/a
Hello,

I'm writing a shoppingcart program in PHP. The website of our suplliers
webpage i written in ASP. He has very detailed info about his products, that
I want to include in my PHP page, I used include, require, readfile, even
something called Snoopy, but with everything that I try, I can't seem to get
the image inculed in the file. I just get the square with the cross in it,
like when you insert an image that doesn't exist.

Can anyone help me with this please?
Jul 17 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
On Fri, 6 Feb 2004 13:07:16 +0100, "Recoura Tim" <ti*@e-port.be>
wrote:
Hello,

I'm writing a shoppingcart program in PHP. The website of our suplliers
webpage i written in ASP. He has very detailed info about his products, that
I want to include in my PHP page, I used include, require, readfile, even
something called Snoopy, but with everything that I try, I can't seem to get
the image inculed in the file. I just get the square with the cross in it,
like when you insert an image that doesn't exist.


If your supplier's ASP script is outputting an image, you should just
be able to use plain HTML:

<img src='http://www.example.com/script.asp' alt='Widget XYZ'>

If your supplier's ASP outputs other data that you want to process,
you should be able to make a HTTP request to your supplier's server
and parse the output.

If you need access to the ASP source code, you'll need to ask your
supplier for it.

--
David ( @priz.co.uk )
Jul 17 '05 #2

P: n/a
>
Hello,

I'm writing a shoppingcart program in PHP. The website of our suplliers
webpage i written in ASP. He has very detailed info about his products, thatI want to include in my PHP page, I used include, require, readfile, even
something called Snoopy, but with everything that I try, I can't seem to getthe image inculed in the file. I just get the square with the cross in it,like when you insert an image that doesn't exist.
If your supplier's ASP script is outputting an image, you should just
be able to use plain HTML:

<img src='http://www.example.com/script.asp' alt='Widget XYZ'>


That won't work either, if i usethe url in a webbrowser and everything is
fine, but when i use it in my script it won't work

If your supplier's ASP outputs other data that you want to process,
you should be able to make a HTTP request to your supplier's server
and parse the output.

if I'm correct include ('url.asp'); does an HTTP request to this page,
but it won't output the image

I read something about using header(); but I didn't found out how exactly to
use it, or more specific, how i should parse the html that is sent back.
If you need access to the ASP source code, you'll need to ask your
supplier for it.

--
David ( @priz.co.uk )

Jul 17 '05 #3

P: n/a
It's more a HTML problem, if the output of your supplier is an image, so you just insert it as an image.

Savut

"Recoura Tim" <ti*@e-port.be> wrote in message news:40**********************@news.skynet.be...
Hello,

I'm writing a shoppingcart program in PHP. The website of our suplliers
webpage i written in ASP. He has very detailed info about his products, that
I want to include in my PHP page, I used include, require, readfile, even
something called Snoopy, but with everything that I try, I can't seem to get
the image inculed in the file. I just get the square with the cross in it,
like when you insert an image that doesn't exist.

Can anyone help me with this please?

Jul 17 '05 #4

P: n/a
> Hello,

I'm writing a shoppingcart program in PHP. The website of our suplliers
webpage i written in ASP. He has very detailed info about his products, that I want to include in my PHP page, I used include, require, readfile, even
something called Snoopy, but with everything that I try, I can't seem to get the image inculed in the file. I just get the square with the cross in it,
like when you insert an image that doesn't exist.

Can anyone help me with this please?


I found a solution that works, it might not be the prettiest way to program,
but it gets the job done.

I use Iframes (html) the only "problem" that I have now is that it doesn't
seem to automaticaly resize the height of the frame, I just put "height =
3000" in the iframe, but now i have the possibility to have a lot of white
space on the bottom, or worse not made it big enough and have an extra
scrollbar on my page, and i don't want to make it noscroll, because then i
might loose some info on the page.

if i use height = 100% it's not what i need
Jul 17 '05 #5

P: n/a
On Fri, 6 Feb 2004 14:26:29 +0100, "Recoura Tim" <ti*@e-port.be>
wrote:
If your supplier's ASP script is outputting an image, you should just
be able to use plain HTML:

<img src='http://www.example.com/script.asp' alt='Widget XYZ'>
That won't work either, if i usethe url in a webbrowser and everything is
fine, but when i use it in my script it won't work

if I'm correct include ('url.asp'); does an HTTP request to this page,
but it won't output the image


From http://uk.php.net/include/ :

<quote>
The include() statement includes and evaluates the specified file.
</quote>

and (you can read ASP for PHP here):

<quote>
If the target server interprets the target file as PHP code, variables
may be passed to the included file using an URL request string as used
with HTTP GET. This is not strictly speaking the same thing as
including the file and having it inherit the parent file's variable
scope; the script is actually being run on the remote server and the
result is then being included into the local script.
</quote>

You don't want to include the image data in your PHP script. include()
inserts the specified file (or output thereof) and evaluates it as
normal.

The way to include images in a PHP script is to output <img> tags and
let the browser make a request for them. PHP generates HTML which is
rendered by the browser. You never see raw image data included within
HTML files.

--
David ( @priz.co.uk )
Jul 17 '05 #6

P: n/a
to insert image, you dont use include() use html even for asp generated image, dont forget the concept of http.

Savut

"Recoura Tim" <ti*@e-port.be> wrote in message news:40***********************@news.skynet.be...
Hello,

I'm writing a shoppingcart program in PHP. The website of our suplliers
webpage i written in ASP. He has very detailed info about his products, thatI want to include in my PHP page, I used include, require, readfile, even
something called Snoopy, but with everything that I try, I can't seem to getthe image inculed in the file. I just get the square with the cross in it,like when you insert an image that doesn't exist.


If your supplier's ASP script is outputting an image, you should just
be able to use plain HTML:

<img src='http://www.example.com/script.asp' alt='Widget XYZ'>


That won't work either, if i usethe url in a webbrowser and everything is
fine, but when i use it in my script it won't work

If your supplier's ASP outputs other data that you want to process,
you should be able to make a HTTP request to your supplier's server
and parse the output.


if I'm correct include ('url.asp'); does an HTTP request to this page,
but it won't output the image

I read something about using header(); but I didn't found out how exactly to
use it, or more specific, how i should parse the html that is sent back.
If you need access to the ASP source code, you'll need to ask your
supplier for it.

--
David ( @priz.co.uk )


Jul 17 '05 #7

P: n/a
Recoura Tim wrote:
Hello,

I'm writing a shoppingcart program in PHP. The website of our
suplliers webpage i written in ASP. He has very detailed info about
his products, that I want to include in my PHP page, I used include,
require, readfile, even something called Snoopy, but with everything
that I try, I can't seem to get the image inculed in the file. I
just get the square with the cross in it, like when you insert an
image that doesn't exist.

Can anyone help me with this please?


I found a solution that works, it might not be the prettiest way to
program, but it gets the job done.

I use Iframes (html) the only "problem" that I have now is that it
doesn't seem to automaticaly resize the height of the frame, I just
put "height = 3000" in the iframe, but now i have the possibility to
have a lot of white space on the bottom, or worse not made it big
enough and have an extra scrollbar on my page, and i don't want to
make it noscroll, because then i might loose some info on the page.

if i use height = 100% it's not what i need


Do you have any idea of how many people have iframes disabled? I know I
do...
Jul 17 '05 #8

P: n/a
And for a shopping cart, how much it's hurt to lost all these sales because they can't see it !!!!
ooch!!!!

Savut

"Agelmar" <if**********@comcast.net> wrote in message news:c0*************@ID-30799.news.uni-berlin.de...
Recoura Tim wrote:
Hello,

I'm writing a shoppingcart program in PHP. The website of our
suplliers webpage i written in ASP. He has very detailed info about
his products, that I want to include in my PHP page, I used include,
require, readfile, even something called Snoopy, but with everything
that I try, I can't seem to get the image inculed in the file. I
just get the square with the cross in it, like when you insert an
image that doesn't exist.

Can anyone help me with this please?


I found a solution that works, it might not be the prettiest way to
program, but it gets the job done.

I use Iframes (html) the only "problem" that I have now is that it
doesn't seem to automaticaly resize the height of the frame, I just
put "height = 3000" in the iframe, but now i have the possibility to
have a lot of white space on the bottom, or worse not made it big
enough and have an extra scrollbar on my page, and i don't want to
make it noscroll, because then i might loose some info on the page.

if i use height = 100% it's not what i need


Do you have any idea of how many people have iframes disabled? I know I
do...

Jul 17 '05 #9

P: n/a
Yeah, me too, I bet at least 40-50% of the people dont have iframe support on their browser, It's doesn't work on Netscape, Opera,
Mozilla, Konqueror and many more... As far as I know, there is only IE that support iframe, and he will surely remove it soon on the
next versions.

Savut

"Agelmar" <if**********@comcast.net> wrote in message news:c0*************@ID-30799.news.uni-berlin.de...
Recoura Tim wrote:
Hello,

I'm writing a shoppingcart program in PHP. The website of our
suplliers webpage i written in ASP. He has very detailed info about
his products, that I want to include in my PHP page, I used include,
require, readfile, even something called Snoopy, but with everything
that I try, I can't seem to get the image inculed in the file. I
just get the square with the cross in it, like when you insert an
image that doesn't exist.

Can anyone help me with this please?


I found a solution that works, it might not be the prettiest way to
program, but it gets the job done.

I use Iframes (html) the only "problem" that I have now is that it
doesn't seem to automaticaly resize the height of the frame, I just
put "height = 3000" in the iframe, but now i have the possibility to
have a lot of white space on the bottom, or worse not made it big
enough and have an extra scrollbar on my page, and i don't want to
make it noscroll, because then i might loose some info on the page.

if i use height = 100% it's not what i need


Do you have any idea of how many people have iframes disabled? I know I
do...

Jul 17 '05 #10

P: n/a
On Fri, 6 Feb 2004 10:25:06 -0500, "Savut" <we***@hotmail.com> wrote:
Yeah, me too, I bet at least 40-50% of the people dont have iframe support on their browser, It's doesn't work on Netscape, Opera,
Mozilla, Konqueror and many more... As far as I know, there is only IE that support iframe, and he will surely remove it soon on the
next versions.


Why do you think MS will remove IFrame support from IE?

Using an Iframe seems to be a rather bumpy solution to what appears to
be a simple problem. I don't see why using <img> wouldn't work. Unless
there's something the OP hasn't mentioned, or I have misunderstood the
problem.

Surely whatever is in the IFrame could just be included as part of the
page anyway?

--
David ( @priz.co.uk )
Jul 17 '05 #11

P: n/a
On Fri, 6 Feb 2004 13:07:16 +0100, "Recoura Tim" <ti*@e-port.be>
wrote:
Hello,

I'm writing a shoppingcart program in PHP. The website of our suplliers
webpage i written in ASP. He has very detailed info about his products, that
I want to include in my PHP page, I used include, require, readfile, even
something called Snoopy, but with everything that I try, I can't seem to get
the image inculed in the file. I just get the square with the cross in it,
like when you insert an image that doesn't exist.


Are you sending the correct Content-Type headers (image/jpeg etc)?

You need to let the browser know that the data is an image.

--
David ( @priz.co.uk )
Jul 17 '05 #12

P: n/a
On Fri, 06 Feb 2004 16:07:32 +0000, David Mackenzie <me@privacy.net>
wrote:
On Fri, 6 Feb 2004 10:25:06 -0500, "Savut" <we***@hotmail.com> wrote:
Yeah, me too, I bet at least 40-50% of the people dont have iframe support on their browser, It's doesn't work on Netscape, Opera,
Mozilla, Konqueror and many more... As far as I know, there is only IE that support iframe, and he will surely remove it soon on the
next versions.


Why do you think MS will remove IFrame support from IE?

Using an Iframe seems to be a rather bumpy solution to what appears to
be a simple problem. I don't see why using <img> wouldn't work. Unless
there's something the OP hasn't mentioned, or I have misunderstood the
problem.

Surely whatever is in the IFrame could just be included as part of the
page anyway?


Actually, I'll wager the ASP output contains *relative* links to
images which of course don't work when included on a page in a
different domain ;-)

--
David ( @priz.co.uk )
Jul 17 '05 #13

P: n/a
Well actually, only IE and Netscape 6 support iframe, also it was just supported by the w3c in html version 4. It's not wide supported right now and also, iframe is hated by most surfer because of its difficulte to have a full overview of a page. Also both browser handle iframe diffrently. And also it is often disabled by most users. Iframe is now in his pre-deprecated stage, newly doctype like xhtml doesn't support it.

Savut

"David Mackenzie" <me@privacy.net> wrote in message news:g2********************************@4ax.com...
On Fri, 06 Feb 2004 16:07:32 +0000, David Mackenzie <me@privacy.net>
wrote:
On Fri, 6 Feb 2004 10:25:06 -0500, "Savut" <we***@hotmail.com> wrote:
Yeah, me too, I bet at least 40-50% of the people dont have iframe support on their browser, It's doesn't work on Netscape, Opera,
Mozilla, Konqueror and many more... As far as I know, there is only IE that support iframe, and he will surely remove it soon on the
next versions.


Why do you think MS will remove IFrame support from IE?

Using an Iframe seems to be a rather bumpy solution to what appears to
be a simple problem. I don't see why using <img> wouldn't work. Unless
there's something the OP hasn't mentioned, or I have misunderstood the
problem.

Surely whatever is in the IFrame could just be included as part of the
page anyway?


Actually, I'll wager the ASP output contains *relative* links to
images which of course don't work when included on a page in a
different domain ;-)

--
David ( @priz.co.uk )

Jul 17 '05 #14

P: n/a
Did you try Data Scraping?? use the PHP command fopen() to open a URL
for the ASP script and then scrape contents into a discernible image
format.
Also look into the GD Library functions for creating an Image resource
object link.

Phil

David Mackenzie <me@privacy.net> wrote in message news:<1q********************************@4ax.com>. ..
On Fri, 6 Feb 2004 14:26:29 +0100, "Recoura Tim" <ti*@e-port.be>
wrote:
If your supplier's ASP script is outputting an image, you should just
be able to use plain HTML:

<img src='http://www.example.com/script.asp' alt='Widget XYZ'>
That won't work either, if i usethe url in a webbrowser and everything is
fine, but when i use it in my script it won't work

if I'm correct include ('url.asp'); does an HTTP request to this page,
but it won't output the image


From http://uk.php.net/include/ :

<quote>
The include() statement includes and evaluates the specified file.
</quote>

and (you can read ASP for PHP here):

<quote>
If the target server interprets the target file as PHP code, variables
may be


passed to the included file using an URL request string as used with HTTP GET. This is not strictly speaking the same thing as
including the file and having it inherit the parent file's variable
scope; the script is actually being run on the remote server and the
result is then being included into the local script.
</quote>

You don't want to include the image data in your PHP script. include()
inserts the specified file (or output thereof) and evaluates it as
normal.

The way to include images in a PHP script is to output <img> tags and
let the browser make a request for them. PHP generates HTML which is
rendered by the browser. You never see raw image data included within
HTML files.

Jul 17 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.