Few Parsing errors..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Discussnow
Forum Newbie
Posts: 3
Joined: Sat Nov 15, 2008 3:46 pm

Few Parsing errors..

Post by Discussnow »

Code: Select all

<html>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<title> 
Link/Anchor Text Analyzer 
</title>
<body>  
Paste Website <br>
<textarea name="para" type="text" row="1" col="1">Here</textarea><br>
<input name="send" type="submit" value="Submit!">
<input type="reset" value="Cancel">
</body>
<?php
$url= $_GET['para'];
$data = file_get_contents('https://siteexplorer.search.yahoo.com/search?p=$url');
$regex = '/<td class="info">    <a href="(.+?)"/';
preg_match($regex,$data,$match);
var_dump($match);
echo $match;
?>
</html>
Any help would be appreciated!
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: Few Parsing errors..

Post by Syntac »

And the errors are...?
Discussnow
Forum Newbie
Posts: 3
Joined: Sat Nov 15, 2008 3:46 pm

Re: Few Parsing errors..

Post by Discussnow »

Syntac wrote:And the errors are...?
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/toiletch/public_html/49ercru.com/Scraper.php on line 14

Warning: file_get_contents(https://siteexplorer.search.yahoo.com/search?p=$url) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/toiletch/public_html/49ercru.com/Scraper.php on line 14
array(0) { } Array
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: Few Parsing errors..

Post by Syntac »

The errors are really quite simple. Your PHP configuration prevents you from accessing files on different servers. Also, file_get_contents() couldn't use the "https" wrapper, probably due to URL file access being disabled.
Post Reply