Jump to content

Find where link takes you using php?


spiceydog

Recommended Posts

I really don't know how you would do this so I thought i'd ask here. I want a php file that looks through my mysql table for links that take you to a specific place.

 

The links value is called "addresses" in the table and I need to include this into the script:

$addresses = split(' ', $row['addresses']);

 

Thanks in advance!

 

EDIT: btw, all of the links have my website in the URL. ex: http://www.website.com/awefawefwefwgwg.php

Link to comment
https://forums.phpfreaks.com/topic/115744-find-where-link-takes-you-using-php/
Share on other sites

Ok, here goes.

 

My question: Is it possible, and if so how, to make a PHP page that searches through a mysql table and looks in a specific value, treats the value as a URL, and goes to it. If the URL redirects to one thing then it does possibility A and if not then it does possibility B.

 

the usual value i am speaking of looks like: http://www.website.com/something.php

 

however the value is sometimes mutiple URLs on multiple lines so I need the script to include something like:

$addresses = split(' ', $row['addresses']);

 

I hope that clerifies what i am asking.

To search the database the sql should look somthing like this:

$sql = "SELECT links FROM tableName WERE links CONTAINS 'website.com/something.php'";

That should give you the contents of every collumn that contains website.com/somthing.php

then you could get either via curl or fopen the file at that link and check for a redirect.

Archived

This topic is now archived and is closed to further replies.

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