Jump to content

Is it just me, or does the file(); function not work on the remote server?


bobleny

Recommended Posts

Hmm, been a while since I've posted....

Hi, me again!

 

Hey, I'm having a small issue with this script on my server and I don't know why.

There may be a better way of doing this, but this is all I could come up with.

 

The objective is to validate the xhtml of my site on the fly. I simply want to navigate the hundreds of pages on my site and have the server tell me if that page is valid.

 

I'm using AJAX to do this, but the general idea is something like this:

<?php
$loc = $_GET['loc'];
$file = file($loc);
echo "Line 6: ". $file[6] ."<br />";
echo $loc ."<br />";
?>

 

The problem is that I am not getting anything back from the w3c site. If the script was working, line 6 should read either [Valid] or [invalid].

 

I really don't think the problem is the script its self, I think it has something to do with my sites server because the script will sort of work from my desktop server. However since I can't send the validator a localhost address, it won't validate.

 

So, does anyone have a better way of doing this, and or an explanation as to why it won't work from my sites server?

 

Thanks!

Link to comment
Share on other sites

Thanks for the quick reply!

 

Does "--with-curlwrappers" mean url wrappers is turned off?

Can url wrappers do harm? Oh, maybe they disable it to help prevent bandwidth attacks on sites?

 

 

Oh, I did find a work around to the problem at least. I would have told you about it sooner, but the power went out.... :'(

The server on my desktop and the server for my site "should" be identical, so I modified the script so it would chop up the url and add the site url prefix.

 

Too bad I can't get it to work on the server though. I would set it up with my database so my site could alert me of validation errors. All well....

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.