I'm picking up a site from a previous developer and we're wondering why, after moving the site onto new servers, does the map on http://69.94.34.32/map-of-hostels-in-the-lake-district.php not display the pins populated by the xml file http://69.94.34.32/xmloutputuk.php as it used to do?
Here it is on the old servers where it does work: [The map] & [The XML]
Straight after the move, loading the XML file in your browser gave you the following error:
"This page contains the following errors:
error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error."
...which is why we rebuilt the xml file to make sure that's not the issue. But now we've got the xml file working again (by identifying and commenting out the problem pieces) the map pins still aren't displaying.
We're aware our new servers are PHP5 whilst the old ones were on PHP4, so might that be the issue? In which case what do we need to change?
Thanks in advance for your help
AHA! Fixed it by including the following script in the header:
<script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.9/src/markerclusterer_packed.js"></script>
which was a suggestion posted in this thread.
At a glance, I'd say that the migration from PHP4 to PHP5 is, most likely, the culprit.
In this thread, they mention that in PHP5, the DOM XML manipulation functions were replaced by the DOMDocument class, have a look.
Related
I have an application separated into 4 files of PHP.
the main PHP code and win/lose/exit pages of the application.
when I implement the code into a node, on drupal, the main PHP file presented with no problem at all.
while I click on exit, linked to other node containing the exit.php code, the layout of the page get messed up.
If you need the code just let me know, it seems more of problem with linking between drupal nodes containing PHP code.
Thanks in advance for any help given.
It sounds like you have written the php code almost as a standalone application and you are then including this in the drupal node by writing PHP. Is this the case?
If it is why did you not chose to write it as a module?
I have a very strange problem and i don't know what to do about it. My site seems to work just fine all browsers other than internet explorer, so i've been trying to figure out why.
I've narrowed it down to the a file that I'm including in my site, this file is a php class that has a number of different functions like login getters and setters and so on.
I took all the php code out of my pages and it renders fine, so i added the php back in line by line and released that it stopped working when i used this:
require_once 'classes/Membership2.php';
Does anyone know why some php code will be messing with the style of my website.
For more detail on the matter, i have a number of divs that are centered, they all have curved edges as well as shadows. So by taking away the php i can see that IE is loading the page properly, no incompatibilities or anything like that.
Has anyone had a problem like this before? While i'm waiting for an aswesome or two i'll be removing functions and part of the code till i can narrow it down. (I would give code, but the file has a lot of lines of code.)
Thanks for the help.
Oh yeah and I'm testing on Internet Explorer 9 and every other browser is the latest version or close enough.
Okay so i've done some more digging into this, i've found that if i delete all the code in the class (All the functions) and leave just and empty class in the include file it still doesn't work. Okay, so in my view that means the functions aren't whats making this problem. So i deleted EVERYTHING, so now the include points to a blank php file. This worked and the page rendered as it should but obviously there is no functionality, i can't login or anything like that. I decided to add a constructor instead of leaving it as default, this function does nothing but return true; and it made the site mess up again.
Does this info change anything? Also i'm reiterating the fact that i do not get this error or any other browser but Internet Explorer 9 (Haven't tried any other IE version).
Thanks again for the help.
Okay, so i've solved the problem. At the start of my PHP class i have used
<!-- blah blah blah -->
forgetting that there is only PHP in this document and no HTML. So when i include the file it just outputs that into my source code and and messes things up, should have used the PHP commenting style.
Still strange that EVERY browser other than IE just ignores this and goes about its business, even the site that #blankabout suggested didn't give me any error (Although i assure thats because its part of the included PHP file and not the HTML itself).
as #fajran says to you, save both outputs with "view source code" on the browser and compare them to find the diference. To compare outputs use winmerge or similar tool. Once you now which text it generating the trouble, modify it inside the include file.
Given that your php, because it runs on the server, should never actually reach the browser, it may very well be some unterminated HTML or similar that is causing the problem. Perhaps the PHP is causing a break in the HTML that is unexpected.
Hi StackOverflow friends.
Running Drupal 6.22 php 5.3
I have been looking around now for a while, but haven't managd to find a solution to my problem.
I am hoping someone may be able to help me out with this.
I need to write an xml file from my data held in an array.
I have written this code and it works fine without problems.
I have invoked this to run on every cron run to ensure my data is upto date,
however I am no getting a second folder my_file.xml.imported and this is causing me problems.
I am using xml2node and hotfolders to import this data into my specified content type.
What bothers me most is that I had this working last week, all I have done since is put an extra "filter" on my data being written to the xml file.
Does anyone know what this .imported file type is and how I can stop it from happening?
So I finally figured this out, hopefully if someone else comes across this problem, this may help them.
The .imported file is created by the xml2node module after the xml file has been processed and put into the drupal queue.
When xml2node then searches again for xml files, it deletes all the .imported files so that your server does not get overloaded with useless once off files.
I am honestly not sure where the issue lays but here is my problem:
I have a single file: card.gif. When I check firebug or Google pagespeed, I learn the file is called twice during the page fetch once as normal file name and a second time with a random number (that does not change). Example:
card.gif
card.gif?1316720450953
I have scoured my actual source code, the image is only called once. It is not called in a CSS file. To be honest I have no idea what is the issue, some thought that when I originally installed mod_pagespeed that it appended ID's to each image in cache for any future overwrites but I can't be certain.
Has anybody ever had this issue before?
In the end - Dagon's comments above led me to believe that things like Firebug and Pagespeed may not always be correct. I do show two images being loaded in the timelines for both plugins but it is very difficult for me to decifer otherwise. If another answer is provided contradicting this, I am more than happy to test that theory.
This is probably something really simple, however I am quite new to PHP, and havent done any HTML in years.
I need to get a PHP variable filled with an array of figures into Google Charts. My code for this so far is:
<img src="http://chart.apis.google.com/chart?
&chs=340x175
&chd=t:<?=$filedetail[1]?>
&cht=lc
&chtt=Test
">
However, Google reports an error, as it stops at the ?=$filedetail[1] for some reason. It doesnt seem that reading the variable is the problem, more that the API simply cant read past the start of the PHP tags.
Thanks,
Rob A.
EDIT: I have managed to make Google accept the URL, however now it is not showing anything on the chart, as its filling in the &chd=t: field with instead of the figures within that variable.
The URL reads like this:
http://chart.apis.google.com/chart?&chs=340x175&chd=t:%3C?=$filedetail[1]?%3E&cht=lc&chtt=Test
If oyu say Google is complaining about the ?=$filedetail, chances are you are doing this in a file that is not being parsed by PHP, for example a file that ends with .html or .htm.
You can see whether this is the case by looking into the page's source code in the browser. If you see the PHP command in the source as you wrote it above, the PHP code was never executed.
The easiest way to fix that, if that's the problem, would be to switch to a .php file extension.
In URLs, literal & should be written as &
Edit: And you can't do ?&chs -- it should be ?chs. The line breaks are probably going to break the URL too...