Author Topic: XML PHP ?  (Read 2418 times)

0 Members and 1 Guest are viewing this topic.

Offline LeomaTNWX

  • Senior Contributor
  • ****
  • Posts: 271
    • Leoma, Tn Weather
XML PHP ?
« on: June 20, 2009, 11:18:18 PM »
I am getting the error below when I try to use Kens drop down menu setup. Can anyone help?


Warning: fopen() [function.fopen]: Unable to access web/dropdown-menu.xml in /virtual/users/e16105-17163/web/dropdown-menu.php on line 78

Warning: fopen(web/dropdown-menu.xml) [function.fopen]: failed to open stream: No such file or directory in /virtual/users/e16105-17163/web/dropdown-menu.php on line 78
could not open XML input

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: XML PHP ?
« Reply #1 on: June 21, 2009, 01:38:54 AM »
It looks like the important part of the message was:  failed to open stream: No such file or directory

Upload dropdown-menu.xml to your website in the same directory as the dropdown-menu.php exists.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline LeomaTNWX

  • Senior Contributor
  • ****
  • Posts: 271
    • Leoma, Tn Weather
Re: XML PHP ?
« Reply #2 on: June 21, 2009, 08:39:32 AM »
They are both in my" /web" directory.


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: XML PHP ?
« Reply #3 on: June 21, 2009, 10:56:01 AM »
I see it now in http://www.leomaweather.com/dropdown-menu.xml

The issue seems to be that the XML has an extra </image> tag in it:

Quote
XML Parsing Error: mismatched tag. Expected: </menu>.
Location: http://www.leomaweather.com/dropdown-menu.xml
Line Number 39, Column 4:   </item>

Looking at the source of the .xml file
Quote
<menu>
   <item caption="Home" link="/index.php" title="Home Page for Saratoga-weather.org"/>
   <item caption="Live" title="Realtime display of weather conditions, webcam, NOAA Radio">
      <item caption="Weather-Display Live" link="/WD-Live.php"/>
      <item caption="Wunderground Live" link="/rapid-fire.php"/>
      <item caption="Saratoga NetCam" link="/netcam.php"/>
      <item caption="NOAA Weather Radio" link="/radio.php"/>

   </item>

   <item caption="Radar" title="Tennessee Radar Displays"/>
      <item caption="Nashville Tn" link="/Nashville Radar.php"/>
   </item>
   
</menu>

I think you need to delete the '/' in the <item caption="Radar" title="Tennessee Radar Displays"/> to make it valid XML ..  then you'll have a 'Tenessee Radar Displays' menu item with one dropdown of  "Nashville Tn".

When you see the unable to access, just view the XML file in your browser .. it will show you what it thinks is wrong with the XML syntax, then it's up to you to decide what to correct to get the menu structure you want :)

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline LeomaTNWX

  • Senior Contributor
  • ****
  • Posts: 271
    • Leoma, Tn Weather
Re: XML PHP ?
« Reply #4 on: June 21, 2009, 11:45:26 PM »
It's showing up now and the "Home" button is working but the drop down for "radar" is not. Below is the radar part of the code.

<item caption="Radar" title="Tennessee Radar Display">
      <item caption="Nashville Tn" link="/Nashville Radar.php"/>
   </item>
   
</menu>

The page it is used on iswww.leomaweather.com/test.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: XML PHP ?
« Reply #5 on: June 22, 2009, 02:15:48 PM »
Found the issue.  Your page has only
Code: [Select]
<html><head> at the top, and to make the DHTML menu work with dropdowns, you need to specify the doctype and HTML version.

I took a copy of your test.php page, and just replaced the
Code: [Select]
<html><head> with
Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-US">
<head>

and the drop-down menu works as expected :)

Your FrontPage isn't doing you any favors with writing HTML up-to-standards .. I suggest you find a different editor (especially since you're venturing into PHP, and FrontPage has a habit of munging PHP code).

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline LeomaTNWX

  • Senior Contributor
  • ****
  • Posts: 271
    • Leoma, Tn Weather
Re: XML PHP ?
« Reply #6 on: June 22, 2009, 07:05:42 PM »
Thanks Ken I will add it in tonight. I use notepad for the php work I just use Front page to start the page. I do need to learn more about code so I can do it all in notepad.