Jump to content

denoteone

Members
  • Posts

    383
  • Joined

  • Last visited

    Never

About denoteone

  • Birthday 08/04/1980

Contact Methods

  • AIM
    Denoteone1
  • Website URL
    http://www.nerdyllama.com
  • Yahoo
    denotoene

Profile Information

  • Gender
    Male
  • Location
    Dayton Ohio

denoteone's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. I got it. My ini_set("display_errors","2"); ERROR_REPORTING(E_ALL); was adding a notice to the header of the XSL style sheet. I removed it and it is working fine.
  2. Trying to use firebug to see what is going wrong since I am only getting the XSLT error and no php error.
  3. Ok so I am calling the same page to set the .XSL style sheet but am getting the dreaded "Error loading stylesheet: Parsing an XSLT stylesheet failed." so the url calls the script that gets the xml file based on the GET variable and it adds the style sheet by calling the same page with a new GET variable. below is my script is this possible? <?PHP ini_set("display_errors","2"); ERROR_REPORTING(E_ALL); header('Content-type: text/xml'); $view = $_GET['view']; if(isset($_GET['xsl_style'])) { $style = '<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Title</th> <th>Artist</th> </tr> <xsl:for-each select="catalog/cd"> <tr> <td><xsl:value-of select="title"/></td> <td><xsl:value-of select="artist"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>'; echo $style; }else{ $xml_data = "http://www.website.com/STRATA/" . $view .".xml"; $handle = fopen($xml_data, 'r'); $Data = fread($handle, 10000); fclose($handle); $old ='<?xml version="1.0" encoding="ISO-8859-1"?>'; $new ='<?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet href="http://www.website.com/STRATA/get_view.php?xsl_style='. $view .'" type="text/xsl"?>'; $final_xml = str_replace($old, $new, $Data); echo $final_xml; } ?>
  4. ok I wasnt setting the header header('Content-type: text/xml');
  5. My variable which should be storing XML data and echos it to the screen is echoing the data as a string without the XML structure Below is my code but it is still not working: $view = $_GET['view']; $xml_data = "http://www.website.com/STRATA/" . $view .".xml"; $handle = fopen($xml_data, 'r'); $Data = fread($handle, 10000); fclose($handle); echo $Data;
  6. Technically that should work right? I mean all its doing is calling the same script twice. Then I can break the script up with an if statement based on the GET variable. Does that sound right?
  7. Trying to get everything in one file. I have an external data source that has 3 different XML files located on it. I am writing a php script that sits on my server and based on the GET variable I want to read a specific XML file and add a specific XSL style sheet to it then echo it to the browser. What I cant have is 3 different .XSL files siting on my server or the data source. So if there is some way I can save the XSL info as a variable and somehow apply all from my one PHP script that would be great. So far this is what I have: <?PHP $view = $_GET['view']; $xml_data = "http://externalserver.com/" . $view .".xml"; $handle = fopen($xml_data, 'r'); $Data = fread($handle, 512); fclose($handle); $old ='<?xml version="1.0" encoding="utf-8"?>'; //Right here is my biggest challange I dont wont the style sheets on the same server or any others for that matter since the server I am running this script on can not get out to the internet since it is behind a firewall. I was thinking of creating the XSL files on the fly and then saving them next to this script. But I would like to keep everything in just 1 file if at all possible. $new ='<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="style.xsl" type="text/xsl"?>'; $final_xml = str_replace($old, $new, $Data); echo $final_xml; ?> the url would be http://www.myserver.com/getxml.php?view=weather
  8. Actually the xml does not have the <?xml-stylesheet href="filename.xsl" type="text/xsl"?> info in it when I pull it. So I am going to have the php insert the style sheet info. then echo the XML to the page. I am testing it now.
  9. I should have looked into XSL before. My life just got a little easier. Thanks! Next question. the XML I am outputting depends a lot on the users interaction. What I was thinking to do was based on the Users selection I would use PHP to call the raw XML file. I can then use PHP to insert the correct XSL style sheet (based on the users selection) and then echo that data to the display? how does that sound?
  10. well I am going to apply css styles and format the data to fit into a html layout that I built. I should have mentioned that.
  11. Trying to figure out what's best practice when it comes to parsing XML and echoing it into a pretty little table. should I save all the data in a array and then loop through the array? Or should I just echo the data directly from the XML file? Any thoughts would be welcomed.
  12. I am trying to connect to a MS database on a linux machine using odbc_connect(); I had a new box setup with the ODBC drivers installed and PHP 5.1.6 compiled with ODBC when I run inof.php I see in Configure Command --with-unixODBC=shared,/usr But when I try to do a simple connect I get: Fatal error: Call to undefined function odbc_connect() any obvious thoughts of what I may have missed?
  13. I am thinking I need to use CURLOPT_CAPATH instead of CURLOPT_CAINFO and then just put the cert in a directory.
  14. I am trying to pull page data from a web server using SSL with cURL. The owner of the web server gave me their CA certificate. When I run the code below all I get is a blanks screen (no errors) Is there anyway I can show were the script is breaking down? ini_set("display_errors","2"); ERROR_REPORTING(E_ALL); $url = "https://www.clientswebserver.com/"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1); curl_setopt($ch, CURLOPT_CAINFO, "/var/www/pathtoCAcert/curl-ca-bundle.crt"); $response = curl_exec($ch); curl_close($ch); print $response; The original CA cert I got was not named curl-ca-bundle.crt but I was told to rename it
  15. OK so the server I am connecting to gave me the CA Root certificate I am going to use cURL but don't want to download the certificate when I browse to the page because that will expire. Is there any other way of me connecting via https using the ca certificate?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.