Can PHP scan a webpage or particular table and proceed with an if statement?
Basically I was after a similiar sort of adwords or adsense way of showing content if certain text is found on the webpage?
example:
domain.com/music.php
My webpage will use the word "music" as a variable to query MySQL for other variables to use in the webpage to process additional queries. So I guess it is a template system already.
After the whole template has been decided and about to be shown in the browser echo something...
This script is a version that is very close but only this script does the effect based on the referer url.
I was looking for something based on content.
$qurl = $_SERVER['HTTP_REFERER'];
$keywords = array('yahoo' => 'yahoo.html',
'google' => 'google.html',
'php' => 'phpbuilder.html'
);
foreach($keywords as $word => $redirect) {
if(strpos($qurl, $word) === TRUE) {
echo '$redirect';
break;
}}
this is where I go for a technical description...
$qurl = $parsedwebpagedocument;
$keywords = array('yahoo' => 'yahoo.html',
$keywords = array('yahoo' => 'yahoo.html',
'google' => 'google.html',
'php' => 'phpbuilder.html'
);
foreach($keywords as $word => $redirect) {
if(strpos($qurl, $word) === TRUE) {
echo '$redirect';
break;
}}
To be more precise Im looking only to work with a parse of the document or a particular area or table with no need to actually work with the whole document.