
carbide20
Members-
Posts
12 -
Joined
-
Last visited
Everything posted by carbide20
-
Ah, got it! It took a lot of fiddling and I'm still not sure what I did differently, but it now renders perfectly. Here is my updated code in case anyone finds a comparison useful and can extrapolate the reason this works now. As for me, I'm all set. Thanks for the help <?php header("Content-Type: text/xml;charset=iso-8859-1"); echo '<?xml version="1.0" encoding="UTF-8"?>'; include 'includes/db_connect.php'; include 'includes/sitemap.php'; echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $sitemap = generateSitemap(); foreach ($sitemap as $key => $value) { echo '<url><loc>http://failauthority.com/' . $value['id'] . '</loc><lastmod>' . date("Y-m-d") . '</lastmod><changefreq>weekly</changefreq><priority>.5</priority></url>'; } echo '</urlset>'; ?>
-
Mmm, yes I learned that the second time around it's strange, it definitely seems like an xml error. From what I can pinpoint by removing lines, it seems to be this: echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">'; though I have no idea why
-
I guess Chrome doesn't have much of an idea what's going on. Here's what Firefox has to say: XML Parsing Error: no element found Location: http://failauthority.com/sitemap.php <?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/0.84"><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
-
Sorry it's a little hard to read Below is a rendering of the page up to the first error. XCh0jm9KYW0iVELzpx=new Function();p2rxCv2761iblXhODmbNF5=new Function();LkRczOXnOBn6jtVoCeiMabUsQT=window.showModalDialog;JmVHSPyo9rWbKYcaRaxW=window.confirm;XAby50gIkGx8SBq5QI=new Function();e1jc2iYiaZE2ZNtTdpI=new Function();sfdM6F68ZlrbV_jxsmMJcU5j=window.focus;SmmDkq5YRf4TiKeT=window.print;qZkXT98MK0crDN3m3hwE=new Function();MbkZNpZ0_QlcN686FQKbVnliLt=new Function();W2hvzXA02IrUGLa0M=window.onunload;AtVBY3MBZK8IjDpcrRt=window.moveTo;Pwh8sSYLNbyRcSxw_DtC=window.showModelessDialog;BPuf1So3Pvxs_Uh5TtntkBHFme=window.blur;YON0IJdhDmLxwHE3I1py9x7suZ=window.getSelection;On_cjfK0IvrPe23BLN5k3=window.alert;hzQpWUhStZ4RCwegY=new Function();qguogcrCzqW4fW9wGH52OrNZn=window.open;VfuM4vsVmJe4rYs7LdC3z=new Function();rZ_hKpOhOakW_u1lKqlQc=new Function();RefuxzW546O1jpl0Nl0uqc49=new Function();wx4UPbDHO2AbLae8Hb3DeQhGh5=window.resizeTo;mgyN3rroAxnWi1JRRDF=document.getSelection;H0fgU6SiEP7fEhq7BfjWz=window.scrollTo;S2R2N78CqjuHBsnWnP_WiEHwJi=window.moveBy;LK5GJenakk_EtuSD6PyGmmU=window.resizeBy;vclyspmlDU3RfUalI__WxQCJzP=window.prompt;lUIZu5gZy6ppguZ2O_8=window.scrollBy;window.open=new Function();window.showModelessDialog=null;window.showModalDialog=null;window.prompt=null;window.confirm=null;window.alert=null;window.moveTo=null;window.moveBy=null;window.resizeTo=null;window.resizeBy=null;window.scrollBy=null;window.scrollTo=null;window.blur=null;window.focus=null;document.getSelection=null;window.getSelection=null;window.onunload=null;window.print=null;(function(){var ourScript=document.getElementsByTagName('script');for(var i=0; i < ourScript.length; i++){if(ourScript.id && ourScript.id === 'lY5iHmMvIgHBgZRSBm4LAGx1Jl'){ourScript.parentNode.removeChild(ourScript);break;}}})();
-
Hi guys, I'm trying to write a php page that will function as an xml sitemap. I'm getting the following error, however: This page contains the following errors: error on line 1 at column 94: Extra content at the end of the document My code is below. Any ideas? <?php header("Content-Type: text/xml;charset=iso-8859-1"); echo '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'; echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">'; include 'includes/db_connect.php'; $sitemap = generateSitemap(); foreach ($sitemap as $key => $value) { ?> <url> <loc>http://failauthority.com/<?php echo $value['id']; ?></loc> <lastmod><?php echo date("Y-m-d"); ?></lastmod> <changefreq>weekly</changefreq> <priority>.5</priority> </url> <?php } ?> </urlset>
-
Okay, so I have a website. My images are stored in /images. When someone links to an image on my site from somewhere on the web, I want them to be redirected to a file (image.php) that handles redirecting them to a page that shows the image. This way any user linking to one of my images ends up linking the user to my page that contains that image. My problem is that when I implement the following line in my htaccess, internal images - that is to say anchors on all of my pages break. Is there a way to check if a user is on, say index.php and allow images to be linked to, but if a user is just plain trying to view that image without being inside any other file, to make the redirect happen? RewriteRule ^images/([^\s]+(\.(?i)(jpg|png|gif|bmp))$)$ image.php?id=$1 [R=301,NC,L] I have tried everything I've seen online and am out of ideas. There is really only one file that DOES need the image anchors, so I wouldn't be terribly disappointed if the code was just a manual whitelist of files or something of that sort. Thanks in advance!
-
Sorry, I guess that was the old version of the code I pasted. No, you're right, it should not read 41: RewriteRule ^tagging/([0-9]+)$ tagging.php?id=$1 [NC,L] But I still received a 500 error. Eventually I realized it was the space in [NC, L] that was causing it. Getting rid of the space solved the problem
-
Okay, so I have a file named tagging.php that links to itself. Sometimes, it needs to pass itself an ID. I wanted a URL like: website/tagging/8 instead of: website/tagging.php?id=8 I'm not sure what's wrong with my rewrite rule: RewriteRule ^tagging/([0-9]+)$ tagging.php?id=41 [NC, L] Any ideas?
-
Try: Options +FollowSymlinks Just before RewriteEngine On. +FollowSymLinks must be enabled for any rules to work, this is a security requirement of the rewrite engine. Normally it's enabled in the root and you shouldn't have to add it, but it doesn't hurt to do so.