merylvingien Posted January 6, 2010 Share Posted January 6, 2010 Hi fellers, i posted a question some time ago, but never got round to following it up as i was busy with other things. I take it that php can search a page and see if a link is contained within the said page? I have this basic code <?php $homepage = file_get_contents('http://www.somesite.com/'); $link = 'www.mysite.com' $pos = strpos($homepage, $link); if ($pos === false) { echo "The string '$link' was not found in the page"; } else { echo "The string '$link' was found in the page"; } ?> I am getting an error with $pos = strpos($homepage, $link); line: unexpected T_VARIABLE Any thoughts would be appreciated Quote Link to comment Share on other sites More sharing options...
simshaun Posted January 6, 2010 Share Posted January 6, 2010 You are missing a semicolon to end $link = 'www.mysite.com' Quote Link to comment Share on other sites More sharing options...
merylvingien Posted January 6, 2010 Author Share Posted January 6, 2010 Doh! Cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.