Home | Products | Consulting | Hosting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: General: Off Topic Conversations:
PHP help

 

 


Lionel
User

Nov 3, 2002, 3:30 PM

Post #1 of 5 (2657 views)
Shortcut
PHP help Can't Post

Why would
<?php
chdir ("/var/www/magazine/");
include ("news.php");
?>
work just fine in cat_index.php

and the same (I just copy and pasted template, simply replacing path), adding some operators will not?

<?php
chdir ("/var/www/magazine/");
include ("news.php?channel=Search&feed=Whatever");
?>

Both work fine with SSI


Dave
Staff / Moderator


Nov 4, 2002, 5:11 PM

Post #2 of 5 (2640 views)
Shortcut
Re: [Lionel] PHP help [In reply to] Can't Post

I don't know much about PHP, but it could be that it's including the file from the filesystem and when you enter ?query on the end it looks for a file like that and can't find one.

Dave Edis - Senior Developer
interactivetools.com


Lionel
User

Nov 4, 2002, 6:36 PM

Post #3 of 5 (2636 views)
Shortcut
Re: [Dave] PHP help [In reply to] Can't Post

No, that's not the case, because the same include works as a SSI, or thru the browser, so the file exists. Thanks anyway.


Dave
Staff / Moderator


Nov 4, 2002, 7:11 PM

Post #4 of 5 (2635 views)
Shortcut
Re: [Lionel] PHP help [In reply to] Can't Post

Maybe "news.php" exists but there is no file called "news.php?channel=Search&feed=Whatever". There's a difference between accessing things though your web server and accessing them straight from the file system.

The docs for the include function are here: http://www.php.net/manual/en/function.include.php

It sounds like it takes URLs, that's what you want to do. The docs actually mention your exact situation:

// Won't work; looks for a file named 'file.php?foo=1&bar=2' on the
// local filesystem.

include 'file.php?foo=1&bar=2';

// Works.

include 'http://www.example.com/file.php?foo=1&bar=2';

Hope that helps. : )

Dave Edis - Senior Developer
interactivetools.com


(This post was edited by Dave on Nov 4, 2002, 7:14 PM)


Lionel
User

Nov 4, 2002, 7:20 PM

Post #5 of 5 (2631 views)
Shortcut
Re: [Dave] PHP help [In reply to] Can't Post

Indeed that works! And you claimed not knowing much about PHP? You little modest guy!

As usual, you guys are most helpful.

Thanks a million.

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Hosting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4