![]() |
|
#1
|
|||
|
|||
XML feed in PHPI cant get this to work, can anyone help me.
Code: PHP Code:
This is something I need help with. It wont work, its a PHP script to display a weather feed, if anyone can help with this it would be appreciated. I got it off this page martin.f2o.org and modified it accordingly but. The page just brings up ""> ""> ""> ""> ""> ""> repeatedly and the source for it is Code: <p><b>""></b><br /> <b>""></b><br /> <b>""></b><br /> <b>""></b><br /> <b>""></b><br /> Last edited by JdS : 22-Oct-2004 at 06:47.
Reason: Please insert your php code between [php] [/php] tags
|
|
#2
|
||||
|
||||
|
Those forecast locations in the XML feed remind me of Ireland.
Your main error is in the following foreach loop: PHP Code:
For one, you can't have foreach($forecastData as $forecastData)... these must be different variables. In the example on the website that you found the website, their example is listed as using foreach ($items as $item). Notice how we are looping through the multiple $items of the array, to process one $item, within this foreach loop. I also think that you have a typo in the string you are using to create the $html variable. Here is some code that I think will solve the problems: PHP Code:
But this only gives you the very first time for each location. This script works better (see it in action at www.jmrtechnet.com) PHP Code:
I hope this helps. |
|
#3
|
|||
|
|||
|
Thank you very much for your help.
I have managed to get the script working but if I put in to many variables it pulls up this message. Fatal error: Maximum execution time of 30 seconds exceeded in /hsphere/local/home/surfingi/surfingireland.net/forecast.php on line 39 the code Im use is this. Its fine until you add to many variables and then it goes tits up. PHP Code:
|
|
#4
|
|||
|
|||
|
JasonMichael
http://www.jmrtechnet.com/ is showing as cannot find server 10pm UK time. |
|
#5
|
||||
|
||||
|
Hi Darksat,
Try putting this in an .htaccess file in the directory with your script: Code:
This should allow for 2 minutes (120 seconds) to elapse before PHP times out. By putting this value in an .htacess file, you are overriding the default PHP setting in the php.ini file. By default, I think PHP allows for code to execute 30 seconds. |
|
#6
|
||||
|
||||
|
Thanks for that update, misunderstood. I have a pretty good uptime on that site, but once in a great while, that happens.
|
|
#7
|
|||
|
|||
|
Jason thanks for your help but now I have another problem.
I get this error Fatal error: Call to undefined function: xslt_create() in /hsphere/local/home/surfingi/surfingireland.net/newsite/feed/xsl.php on line 13 in this script. PHP Code:
it works on XAMP but not when I ftp to a linux server. I have changed permissions and everything, but I dont think thats the problem. |
|
#8
|
||||
|
||||
|
Create a short script in a filenamed "info.php" like the one below, to see if your hosting provider configured PHP to include the --enable-xslt and --with-xslt-sablot options. Without these options available, your script won't work.
PHP Code:
If *you* happen to be the one owning that Linux server, then you'll need to do some more work configuring it, to get XSLT working. You'll need to install the Sablotron library (from my previous experience, this was a REAL pain). Hopefully, you can easily do an RPM install. I recommend reading the reference to the us2.php.net at the PHP.net website and go over their instructions for doing the installation, as a start. |
|
#9
|
|||
|
|||
|
I dont own the server.
I will try that when I get home, my firewall in work stops me FTPing. cheers. |
Recent GIDBlog
Writing a book by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| XML feed into PHP graph | Darksat | MySQL / PHP Forum | 2 | 27-Sep-2004 09:33 |
| uisng php to display php | dopee | MySQL / PHP Forum | 6 | 14-May-2004 18:40 |
| php software | dopee | MySQL / PHP Forum | 0 | 04-May-2004 11:26 |
| [Linux] Installing PHP --with-mcrypt | JdS | Web Hosting Forum | 0 | 20-Aug-2003 08:40 |
| All the big PHP script collections that matter | jrobbio | MySQL / PHP Forum | 5 | 06-Jun-2003 16:14 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The