Jump to content

Recommended Posts

I need some help building a function that searches a specified page on an external site for a line of code (link), then returns true or false depending on whether it is there or not.

 

I know it is possible because directorys use this function.

 

I am willing to pay $10 though paypal or moneybookers to the first one who can help me

 

Thanks for reading

 

Tommy Arnold

 

Link to comment
https://forums.phpfreaks.com/topic/85343-solved-10-paypal-for-quick-help/
Share on other sites

View the source, does that link sit on its own on 1 line

 

See, you will need to use regex to dig out that link, in which case you will need to give regex some rules to search by

 

But if the website changes there code often, then it can screw things up

 

For example today that link might be on line 923, where as tommorow it may be on line 966

Yeh.. but its getting that function

 

Unless it is piblically available, you will need or have someone write it

 

Which is why its important to know how there source is wrote

 

A function will need to know how and what to read in order to select the criteria you are looking for

 

Regex, line numbers, what ever...

 

Unles there is some super pre made function that can do it...

Ok well i have someone working on it now from the digital point forum

 

But thanks for trying!

 

Surely the following will work, won't it?

 

<?php

$content = file_get_contents("http://www.google.co.uk"); // Loads the source code into a string

if (stristr($content, '<a href="www.mysite.com">just a link</a>')) /* If that link is in the string it returns true, if not, it returns false. */ { 
return true;
}
else {
return false;
}

?>

 

Sam

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.