Php includes


#1

Hi all… I saw the other post about includes, but i dont think it helped me…

this is my problem… i have a forum and i’m pulling posts from it using includes… my include line goes like:

<?php include("http://www.domain.com/x/mo_latest_posts.php"); ?>

i get this on the page where that include is found: Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.island/npznpz/domain.com/x3.php on line 1459

Warning: include(http://www.domain.com/x/mo_latest_posts.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.island/npznpz/domain.com/x3.php on line 1459

Warning: include() [function.include]: Failed opening ‘http://www.domain.com/x/mo_latest_posts.php’ for inclusion (include_path=’.:/usr/local/php5/lib/php’) in /home/.island/npznpz/domain.com/x3.php on line 1459

as u can see - i’m pullin a php page and its on a php page…

anyhelp would appreciated… thanx


#2

I posted one solution that I use that uses curl:

http://discussion.dreamhost.com/showthreaded.pl?Cat=&Board=forum_troubleshooting&Number=46754&Search=true&Forum=forum_troubleshooting&Words=sdayman curl&Match=Or&Searchpage=0&Limit=25&Old=allposts&Main=46146

-Scott


#3

thanx 4 the reply… it actually worked - somewhat… lol…

the posts i was trying to pull form the forums are getting pulled, but now i get theses errors:

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of runtime function name. If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/.island/npznpz/domain.com/x/ips_kernel/class_db_mysql.php on line 101

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of runtime function name. If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/.island/npznpz/domain.com/x/ips_kernel/class_db_mysql.php on line 171

any ideas?


#4

and why wouldn’t it work like that? with just:

<?php include("http://www.domain.com/x/mo_latest_posts.php"); ?>

i just transfer from another host and it worked there fine… only reason i’m complaining is bc it aint workin… lol. but yea, all help is appreciated


#5

[quote]and why wouldn’t it work like that? with just:

<?php include("http://www.domain.com/x/mo_latest_posts.php"); ?>[/quote]

Because allow_url_fopen is disabled.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#6

ah… i see…


#7

i am now using

<?php include($_SERVER['DOCUMENT_ROOT']."/x/latest_posts.php"); ?>

which also works… but i still get these errors:

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of runtime function name. If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/.island/npznpz/domain.com/x/ips_kernel/class_db_mysql.php on line 101

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of runtime function name. If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/.island/npznpz/domain.com/x/ips_kernel/class_db_mysql.php on line 171

looking the page the error mentions, i can’t figure out what’s wrong…

line 101 is:

$this->sql = new sql_queries( &$this );

line 171 is:

$this->$classname = new $classname( &$this );

all help is appreciated and thanx 2 those have…


#8

Remove the ‘&’ in front of $this.

It has to do with PHP4 vs PHP5 compatibility. That’s a PHP4 script and wasn’t updated for PHP5 compatibility.


yerba# rm -rf /etc
yerba#


#9

WOW… thanks!!!


#10

ok… first of all… thank you 4 helping out. now i wonder if u can help me with this…

everything works, but i get this error on the top of the page:

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /home/.island/npznpz/domain.com/x3.php on line 1462

line 1462 is:

now what would that have to do with anything… lol…

and if i put that line on 1463, the error still pops up as line 1462…

i’m really confused right now… lol… again, all help is appreciated…


#11

The error is probably on an earlier line.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#12

i don’t think so…

<?php include($_SERVER['DOCUMENT_ROOT']."/x/latest_posts.php"); ?>
Date
Line # 1462

^^^^^ theres a little snippit of the lines surrounding…

u can find the full page at http://www.nandopresentz.com/test.php if u want… thanx again…


#13

It appears you are trying to include a file that doesn’t exist. When I browse to that file, I get a 404 error. In fact, the directory “x” doesn’t exist at all.


Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]


#14

nm… it was my mistake… i got it now… THANKS 4 EVERYTHING…