Jump to content

TFD3

Members
  • Posts

    112
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TFD3's Achievements

Member

Member (2/5)

0

Reputation

  1. Trying to figure out how to use the include statement in a GD script. When I use the include statement on line 18 in the script below I get an error Parse error: syntax error, unexpected T_STRING in /home/bamastrm/public_html/script/exper/png_create.php on line 18 Any ideas how to correct this? thanks <?php header("Content-Type: image/jpeg"); $im = ImageCreateFromJpeg("template.jpg"); $yellow = ImageColorAllocate($im, 255, 242, 0); $black = ImageColorAllocate($im, 0, 0, 0); $kbmx = "51°"; $start2_x = 231; $start2_y = 222; $kmgm = "51°"; $start_x = 234; $start_y = 226; Imagettftext($im, 25, 0, $start_x, $start_y, $black, 'impact.ttf', " include("temp.php") "); Imagettftext($im, 25, 0, $start2_x, $start2_y, $yellow, 'impact.ttf', ""); Imagejpeg($im, '', 100); ImageDestroy($im); ?>
  2. Ok i played around some more and maybe have found a different way... At the bottom of the script I have added if ($observed == "Overcast") { $icon = "http://www.alabamastormtrackers.com/metar/Rain_Heavy.png"; } echo "<img src=" . "$icon" . ">"; ?> Now the image does display but just in a different location. Is there a way to position the image at the top right portion of the box? http://www.alabamastormtrackers.com/metar/conditions.php
  3. error reporting is on i was just playing with the script. I wonder if it could be because the entire output is not generated by php?
  4. Negative
  5. Ok here is what im doing. Im trying to add a background image using php in css but im not sure if I have it set up right. http://www.alabamastormtrackers.com/metar/conditions.php See where it says (Sky: Heavy Rain) I need a graphic to display IF Heavy Rain is present. Trying to explain this best I can.. This is part of the CSS outside of the PHP script. background: #cccccc url(<?php echo $image; ?>); Here is the IF statement im not sure if I set up right. if ($wxInfo['CONDITIONS'] == Heavy Rain) { $image = "http://www.alabamastormtrackers.com/metar/Rain_Heavy.png"; } Here is the whole script: http://www.alabamastormtrackers.com/metar/script.txt If you run the script your self to test you will also need this: http://www.alabamastormtrackers.com/metar/conditions_metars.txt Here is an EXAMPLE of what it should look like http://www.alabamastormtrackers.com/metar/example.php I have no idea what im missing????? THANKS
  6. OK i got everything copied over to the xml file but the script below adds "Resource id #3" to the beginning of the xml file. HOw can I remove the Resource id #3 ?? <?php $filename = 'tracker.xml'; $data = file_get_contents ('http://www.spotternetwork.org/pro/feed/484337fcc02ce/gm.php'); // Let's make sure the file exists and is writable first. //if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $data will go when we fwrite() it. if (!$handle = fopen($filename, 'w')) { echo "Cannot open file ($filename)"; exit; } // Write $data to our opened file. if (fwrite($handle, $data) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote to file ($filename)"; fclose($handle); //} else { //echo "The file $filename is not writable"; //} ?>
  7. im using this script but it seems im missing something??? <?php $filename = 'tracker.xml'; $data = fopen("http://www.spotternetwork.org/pro/feed/484337fcc02ce/gm.php", "r"); // Let's make sure the file exists and is writable first. //if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $data will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $data) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($data) to file ($filename)"; fclose($handle); //} else { //echo "The file $filename is not writable"; //} ?>
  8. data from the php file http://www.spotternetwork.org/pro/howto-gm.php needs to be written to a new file named tracker.xml Have any examples or ideas?
  9. i finally got it with some outside help. thanks to those who helped me get half way
  10. any possible ideas? i have not touched PHP in a long time. thanks
  11. If this is what your talking about I tired it and still got an error. <?php $homepage = file_get_contents('http://www.weather.gov/alerts-beta/al.php?x=0'); echo '\<?xml-stylesheet href=\'capatom.xsl\' type=\'text/xsl\'?\>'; echo $homepage; ?>
  12. It didnt work: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home2/alabamaw/public_html/rss/test2.php on line 3 <?php $homepage = file_get_contents('http://www.weather.gov/alerts-beta/al.php?x=0'); echo '<?xml-stylesheet href='capatom.xsl' type='text/xsl'?>'; echo $homepage; ?>
  13. OK. I got half of this working. Here is the script that is half complete: <?php - xsl line - $homepage = file_get_contents('http://www.weather.gov/alerts-beta/al.php?x=0'); echo $homepage; ?> I need to add the xsl line in the php script: <?xml-stylesheet href='capatom.xsl' type='text/xsl'?> however I cant just add that under <?php Any ideas on how to include this??
  14. I need to be able to display the output of both of those files using PHP. It would be as if I wanted to use an include statement to display two php pages in one php file.
  15. I have been trying to find a way to add a atom feed and a xsl style file into a php file. I have searched and searched and can not find anything. The atom feed: http://www.weather.gov/alerts-beta/al.atom The xsl style sheet: http://www.alabamaweather.org/rss/capatom.xsl somehow both of those need to go into a php file i.e. warn.php I have tried but keep getting an error. Thanks, Kenny
×
×
  • 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.