The reason that I put http://kywordpro.com/txt/1/10/toast.html was so you could see that the test.php was pulling all the descriptions on that page
The reason that I put http://kywordpro.com/txt/1/10/toast.html was so you could see that the test.php was pulling all the descriptions on that page
the test.php page uses this code
but I want to put this on the same page as http://kywordpro.com/txt/1/10/toast.html and it put all the search descriptions and put them in the meta tag.PHP Code:<?php
include 'simple_html_dom.php';
$html = file_get_html('http://kywordpro.com/txt/1/10/toast.html');
foreach($html->find('td[name=desc]') as $e)
echo $e->plaintext;
?>
Does this make sence?
Replace:
With:PHP Code:<meta name="description" content="<?php echo $e->plaintext;?>">
PHP Code:<meta name="description" content="
<?php
include 'simple_html_dom.php';
$html = file_get_html('http://kywordpro.com/txt/1/10/toast.html');
foreach($html->find('td[name=desc]') as $e)
echo $e->plaintext;
?>
">
Jeremy | jfein.net
Nile I think you missed the question.
Go to http://kywordpro.com then in the search type anything you want.
You will notice that the site address will change to http://kywordpro.com/txt/1/10/{YOUR SEARCH TERM}.html
So I cant use $html = file_get_html('http://kywordpro.com/txt/1/10/toast.html'); because the page address changes for every term you search.
I want the search results descriptions to print in my meta tag for that page.
Ok, in the top of your page put:
Then in the meta part, put:PHP Code:include 'simple_html_dom.php';
$html = file_get_html("http://kywordpro.com/txt/1/10/".$q.".html");
$v = array();
foreach($html->find('td[name=desc]') as $e) {
$v[] = $e->plaintext;
}
$v = implode("", $v);
PHP Code:<?php
echo $v;
?>
Last edited by Nile; 03-06-2009 at 10:11 PM.
Jeremy | jfein.net
Bookmarks