spiceydog Posted July 20, 2008 Share Posted July 20, 2008 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 More sharing options...
trq Posted July 20, 2008 Share Posted July 20, 2008 I want a php file that looks through my mysql table for links that take you to a specific place btw, all of the links have my website in the URL Don't they all take you to your website then? As you can see, your question is very unclear. Link to comment https://forums.phpfreaks.com/topic/115744-find-where-link-takes-you-using-php/#findComment-595006 Share on other sites More sharing options...
spiceydog Posted July 20, 2008 Author Share Posted July 20, 2008 Ahh yah i guess that's so. sorry. No the pages are dynamic basically and change once a month. its a really complex process but due to the fact there on different websites/databases this way needs to work... Link to comment https://forums.phpfreaks.com/topic/115744-find-where-link-takes-you-using-php/#findComment-595013 Share on other sites More sharing options...
trq Posted July 20, 2008 Share Posted July 20, 2008 So... have you got a question formulated yet? We (I) still have no idea what your asking. Link to comment https://forums.phpfreaks.com/topic/115744-find-where-link-takes-you-using-php/#findComment-595015 Share on other sites More sharing options...
spiceydog Posted July 20, 2008 Author Share Posted July 20, 2008 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. Link to comment https://forums.phpfreaks.com/topic/115744-find-where-link-takes-you-using-php/#findComment-595021 Share on other sites More sharing options...
unkwntech Posted July 21, 2008 Share Posted July 21, 2008 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. Link to comment https://forums.phpfreaks.com/topic/115744-find-where-link-takes-you-using-php/#findComment-595091 Share on other sites More sharing options...
spiceydog Posted July 21, 2008 Author Share Posted July 21, 2008 fopen is perfect! thank you! but how can i get it to recognize what is written on the page? Like if it says "message1" then it should do something different than if it says "message2". Link to comment https://forums.phpfreaks.com/topic/115744-find-where-link-takes-you-using-php/#findComment-595158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.