SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    May 2004
    Location
    netherlands
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    get_file_contents with get parameter

    I'm trying to generate an xsl file with, and then read it with file_get_contents.
    I give the xml file as an parameter to the xsl file.

    $xslfile = "gen_xsl.php"; // this file generates xsl
    $xslstring = file_get_contents ( $xslfile . "?xmlfile=config.xml");

    xslstring now contains the xsl which I can use for further processing.
    Works on my xp machine, but not on linux, it ignores the get parameter.

    Does anybody know a solution to this?

  2. #2
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Use the full url:
    PHP Code:
     $xslstring file_get_contents'http://site.com/'.$xslfile.'?xmlfile=config.xml' ); 

  3. #3
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess gen_xsl.php is on your server... if so, better avoid subrequest, just include it.

  4. #4
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by sterofrog
    I guess gen_xsl.php is on your server... if so, better avoid subrequest, just include it.
    You don't want to include xslt code into a PHP script.

  5. #5
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    from op

    Quote Originally Posted by willem
    $xslfile = "gen_xsl.php"; // this file generates xsl
    I think gen_xsl.php is a php script, not an xsl stylesheet.

  6. #6
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Yes, but I'd guess it generates and outputs xsl.

  7. #7
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it's a php, it can (should) be included, no matter what it does.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •