Connecting Tech Pros Worldwide Forums | Help | Site Map

include asp in php

Recoura Tim
Guest
 
Posts: n/a
#1: Jul 17 '05
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?



David Mackenzie
Guest
 
Posts: n/a
#2: Jul 17 '05

re: include asp in php


On Fri, 6 Feb 2004 13:07:16 +0100, "Recoura Tim" <tim@e-port.be>
wrote:
[color=blue]
>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.[/color]

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 )
Recoura Tim
Guest
 
Posts: n/a
#3: Jul 17 '05

re: include asp in php


>[color=blue][color=green]
> >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,[/color][/color]
that[color=blue][color=green]
> >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[/color][/color]
get[color=blue][color=green]
> >the image inculed in the file. I just get the square with the cross in[/color][/color]
it,[color=blue][color=green]
> >like when you insert an image that doesn't exist.[/color]
>
> 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'>[/color]

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
[color=blue]
>
> 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.
>[/color]

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.
[color=blue]
> If you need access to the ASP source code, you'll need to ask your
> supplier for it.
>
> --
> David ( @priz.co.uk )[/color]


Savut
Guest
 
Posts: n/a
#4: Jul 17 '05

re: include asp in php


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" <tim@e-port.be> wrote in message news:402383c6$0$7042$ba620e4c@news.skynet.be...[color=blue]
> 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?
>
>[/color]


Recoura Tim
Guest
 
Posts: n/a
#5: Jul 17 '05

re: include asp in php


> Hello,[color=blue]
>
> 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,[/color]
that[color=blue]
> 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[/color]
get[color=blue]
> 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?
>[/color]

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


David Mackenzie
Guest
 
Posts: n/a
#6: Jul 17 '05

re: include asp in php


On Fri, 6 Feb 2004 14:26:29 +0100, "Recoura Tim" <tim@e-port.be>
wrote:
[color=blue][color=green]
>> 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'>[/color]
>
>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[/color]
[color=blue]
>if I'm correct include ('url.asp'); does an HTTP request to this page,
>but it won't output the image[/color]

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 )
Savut
Guest
 
Posts: n/a
#7: Jul 17 '05

re: include asp in php


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

Savut

"Recoura Tim" <tim@e-port.be> wrote in message news:40239630$0$13256$ba620e4c@news.skynet.be...[color=blue][color=green]
> >[color=darkred]
> > >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,[/color][/color]
> that[color=green][color=darkred]
> > >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[/color][/color]
> get[color=green][color=darkred]
> > >the image inculed in the file. I just get the square with the cross in[/color][/color]
> it,[color=green][color=darkred]
> > >like when you insert an image that doesn't exist.[/color]
> >
> > 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'>[/color]
>
> 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
>[color=green]
> >
> > 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.
> >[/color]
>
> 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.
>[color=green]
> > If you need access to the ASP source code, you'll need to ask your
> > supplier for it.
> >
> > --
> > David ( @priz.co.uk )[/color]
>
>[/color]


Agelmar
Guest
 
Posts: n/a
#8: Jul 17 '05

re: include asp in php


Recoura Tim wrote:[color=blue][color=green]
>> 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?
>>[/color]
>
> 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[/color]

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


Savut
Guest
 
Posts: n/a
#9: Jul 17 '05

re: include asp in php


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

Savut

"Agelmar" <ifetteNOSPAM@comcast.net> wrote in message news:c0089g$10809g$1@ID-30799.news.uni-berlin.de...[color=blue]
> Recoura Tim wrote:[color=green][color=darkred]
> >> 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?
> >>[/color]
> >
> > 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[/color]
>
> Do you have any idea of how many people have iframes disabled? I know I
> do...
>
>[/color]


Savut
Guest
 
Posts: n/a
#10: Jul 17 '05

re: include asp in php


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" <ifetteNOSPAM@comcast.net> wrote in message news:c0089g$10809g$1@ID-30799.news.uni-berlin.de...[color=blue]
> Recoura Tim wrote:[color=green][color=darkred]
> >> 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?
> >>[/color]
> >
> > 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[/color]
>
> Do you have any idea of how many people have iframes disabled? I know I
> do...
>
>[/color]


David Mackenzie
Guest
 
Posts: n/a
#11: Jul 17 '05

re: include asp in php


On Fri, 6 Feb 2004 10:25:06 -0500, "Savut" <webki@hotmail.com> wrote:
[color=blue]
>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.[/color]

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 )
David Mackenzie
Guest
 
Posts: n/a
#12: Jul 17 '05

re: include asp in php


On Fri, 6 Feb 2004 13:07:16 +0100, "Recoura Tim" <tim@e-port.be>
wrote:
[color=blue]
>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.[/color]

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 )
David Mackenzie
Guest
 
Posts: n/a
#13: Jul 17 '05

re: include asp in php


On Fri, 06 Feb 2004 16:07:32 +0000, David Mackenzie <me@privacy.net>
wrote:
[color=blue]
>On Fri, 6 Feb 2004 10:25:06 -0500, "Savut" <webki@hotmail.com> wrote:
>[color=green]
>>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.[/color]
>
>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?[/color]

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 )
Savut
Guest
 
Posts: n/a
#14: Jul 17 '05

re: include asp in php


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:g2f720lkjautq2nvna62vam31v9rm6m0vj@4ax.com...[color=blue]
> On Fri, 06 Feb 2004 16:07:32 +0000, David Mackenzie <me@privacy.net>
> wrote:
> [color=green]
> >On Fri, 6 Feb 2004 10:25:06 -0500, "Savut" <webki@hotmail.com> wrote:
> >[color=darkred]
> >>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.[/color]
> >
> >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?[/color]
>
> 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 )[/color]
Phil Powell
Guest
 
Posts: n/a
#15: Jul 17 '05

re: include asp in php


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:<1q67201hk0k71mdfgo4ib5m4o8su463n8b@4ax.com>. ..[color=blue]
> On Fri, 6 Feb 2004 14:26:29 +0100, "Recoura Tim" <tim@e-port.be>
> wrote:
>[color=green][color=darkred]
> >> 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'>[/color]
> >
> >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[/color]
>[color=green]
> >if I'm correct include ('url.asp'); does an HTTP request to this page,
> >but it won't output the image[/color]
>
> 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[/color]

passed to the included file using an URL request string as used[color=blue]
> 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.[/color]
Closed Thread