 |
Results from the most recent live auction are here.
21 members in the live chat room. Join Chat!
| |
05-31-2006, 11:15 AM
|
· #1 | | NamePros Regular Join Date: Mar 2005
Posts: 821
NP$: 1108.00 ( Donate)
| PHP include problem 50NP$ to solve Hi,
I am using the code:
in a file called: test.php EDIT: SOLVED
there is no other code in the page other the one above, but if i put the url into the browser it works fine, what am I doing wrong.
If someone can help me get this working i will pay 50NP$
Thanks
Last edited by ridesign1 : 05-31-2006 at 05:12 PM.
|
| |
05-31-2006, 11:30 AM
|
· #2 | | Eating Pie Name: Steve Location: Canada Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 ( Donate)
| Hello,
First include can only include internal files (files on YOUR server). So that will not work. Now what are you trying to do?
- Steve |
| |
05-31-2006, 11:40 AM
|
· #3 | | Soon to be RICHdoggie! Name: Tom Location: UK Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 ( Donate)
| oh I see - you can't do that.
you will need to use frames. It seems as if there is something that won't parse in that external file.
You should never include external files anyway, even though it is trade doubler. Someone could easilly hack your server if you include a malicious file of theirs. |
| |
05-31-2006, 11:44 AM
|
· #4 | | Eating Pie Name: Steve Location: Canada Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 ( Donate)
| Try to refrain from the frames. All they do is cause alot of problems.
- Steve |
| |
05-31-2006, 11:51 AM
|
· #5 | | NamePros Regular Join Date: Mar 2005
Posts: 821
NP$: 1108.00 ( Donate)
| hi, thanks for your reply.
trade doubler allow users to use their file, (According to their manual) but i can't get it to work, also no one in trade doubler has any idea about it.
you can include external files can't you? i can do yahoo.
If you paste the url into your browser, you should see a product i am trying to get that html by using the include function.
can you suggest any other way of doing this?
Last edited by ridesign1 : 05-31-2006 at 11:55 AM.
|
| |
05-31-2006, 11:55 AM
|
· #6 | | Eating Pie Name: Steve Location: Canada Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 ( Donate)
| Include Cannot include external files UNLESS your hosting company has it turned on in PHP.INI in which case you should get a knew one. This is a HUGE secruity issue. As poordoggie said. People can include files which can cause serious dmg to your account and website.
Now with that over. What do you mean by using their files? I believe what you are trying to do is include a js file on anothers site on your site?
Like a banner exchange site or something?
Could you explain some mroe please?
- Steve
Try this Code:
<script src="http://pf.tradedoubler.com/pf/pf?a=1027441&description=(new)&xslUrl=http://img.tradedoubler.com/images/xsl/xsl12.xsl&maxResults=1&firstResult=0&oe="></script>
If that doesn't work you may want to try Code: <iframe src="http://pf.tradedoubler.com/pf/pf?a=1027441&description=(new)&xslUrl=http://img.tradedoubler.com/images/xsl/xsl12.xsl&maxResults=1&firstResult=0&oe="></iframe>
Let me know if those work for you.
- Steve |
| |
05-31-2006, 12:03 PM
|
· #7 | | NamePros Regular Join Date: Mar 2005
Posts: 821
NP$: 1108.00 ( Donate)
| I am trying to use a data feed they provide me of the product and display it on my site.
But i don't want to use the iframe, as it is not spiderable as part of my site.
I think it is a xml file, which gets formatted
http://pf.tradedoubler.com/pf/pf?a=1027441&description=(new)&maxResults=1&firstResult=0&oe=
hope that makes sense
let me know what you can suggest.
----
if i do include("http://yahoo.com");
it displays on my site, does this mean my host has enabled it in php.ini
i thought hostingzoom was a big reliable company- am i incorrect? |
| |
05-31-2006, 12:10 PM
|
· #8 | | DNOA Member Name: Shoei Location: Montreal, Quebec, Canada Join Date: Feb 2006
Posts: 324
NP$: 65.00 ( Donate)
| |
| |
05-31-2006, 12:12 PM
|
· #9 | | NamePros Regular Join Date: Mar 2005
Posts: 821
NP$: 1108.00 ( Donate)
| the 2nd one works which is what they provide:
trade doubler put in thier manual:
If your site is running on PHP you can use the PHP function ‘include’ with the same URL that is generated for iframe src in show code. This will only work if your web host allows include of external http resources. |
| |
05-31-2006, 04:28 PM
|
· #10 | | Soon to be RICHdoggie! Name: Tom Location: UK Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 ( Donate)
| if it is XML you can parse it as such, but if you run it in a browser it seems to be formatted, and therefore dosen't seem to be XML (I haven't looked at the source though). I think that your server cannot use external includes.
options:
1. Ask your host to turn that feature on, don't think they will though, especially if it is a shared server
2. Use frames - they don't cause that many problems, and if you use <noframe> tags you can easilly substitute it for something for older browsers (an image maybe)
3. If it is XML you can easilly find an XML parser online somewhere and "rebuild" it into your website somewhere
good luck
Just thought - you could do something like this: PHP Code: $handle = fopen("http://pf.tradedoubler.com/pf/pf?a=1027441&description=(new)&xslUrl=http://img.tradedoubler.com/images/xsl/xsl12.xsl&maxResults=1&firstResult=0&oe=","rb");
$content = "";
while (!feof($handle)) {
$content .= fread($handle, 8192);
}
fclose($handle);
echo $content;
That should work. That will open the URL for the feed and then take the code from it and just echo it onto your site. Put that code where you want the feed to display and it should show up.
Tom |
| |
05-31-2006, 05:05 PM
|
· #11 | | NamePros Regular Location: mysitememberships.com Join Date: Jul 2005
Posts: 925
NP$: 4800.90 ( Donate)
| question:
if u get a server with external include activated, and u put in to include a .php file (with extensive scripting), wud u get the php code or a server parsed version? since when u include it puts the source rather than execute the code.
if so, wudnt this be a big security risk for ppl with private scripts running?or even ppl who have database connection info in their scripts... |
| |
05-31-2006, 05:10 PM
|
· #12 | | NamePros Regular Join Date: Mar 2005
Posts: 821
NP$: 1108.00 ( Donate)
| thanks that works,
I spent a whole day and still couldn't do it
thanks alot 
NP$ sent |
| |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |