| | |
fetching metadata of web page
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
hi all,
i have problem i am fetching meta data information of web page so that on the basis of those information i can put search option to my site.i have populate.php which fetch metadata and store relevant information in mysql.
but when i am running populate.php it's giving me error to me
i have to pass a url with populate.php?url=www.some.com
Warning: get_meta_tags[function.get-meta-tags]: failed to open stream: No such file or directory in
Warning: Invalid argument supplied for foreach() in /home/jaguide/public_html/populate.php on line 40
i have problem i am fetching meta data information of web page so that on the basis of those information i can put search option to my site.i have populate.php which fetch metadata and store relevant information in mysql.
but when i am running populate.php it's giving me error to me
i have to pass a url with populate.php?url=www.some.com
Warning: get_meta_tags[function.get-meta-tags]: failed to open stream: No such file or directory in
Warning: Invalid argument supplied for foreach() in /home/jaguide/public_html/populate.php on line 40
php Syntax (Toggle Plain Text)
$url=$_GET['url']; $url = addslashes($url); $tags=get_meta_tags($url);//echo $tags; if (sizeof($tags) == 0){ echo '<tr><td>No META information was found!</td></tr>'; } else { if(!$url) { //die( "You need to define a URL to process." ); } else if(substr($url,0,7) != "http://" ) { $url = "http://$url"; } /* Does this URL already have a record in the page-table? */ $result = mysql_query("SELECT table FROM page WHERE page_url = \"$url\""); $row = mysql_fetch_array($result); if( $row['page_id'] ) { /* If yes, use the old page_id: */ $page_id = $row['page_id']; } else { $desc=""; foreach($tags as $key=>$value) if($key=="description") $desc=$value; mysql_query("INSERT INTO table(page_url,description) VALUES (\"$url\", '".$desc."' )"); $page_id = mysql_insert_id(); } foreach($tags as $key=>$desc) { if($key=="keywords") { $result = mysql_query("SELECT word_id FROM word WHERE word_word = '$value'"); $row = mysql_fetch_array($result); if( $row['word_id'] ) { /* If yes, use the old word_id: */ $word_id = $row['word_id']; } else { /* If not, create one: */ mysql_query("INSERT INTO table(word_word) VALUES (\"$value\")"); $word_id = mysql_insert_id(); } /* And finally, register the occurrence of the word: */ mysql_query("INSERT INTO table (word_id,page_id) VALUES ($word_id,$page_id)"); // print "Indexing: $cur_word<br>"; } } }
Last edited by peter_budo; Aug 11th, 2009 at 2:45 pm. Reason: Please use [code][/code] istead of <code></code>
![]() |
Similar Threads
- Change Web Page Font Size on the Fly (Windows tips 'n' tweaks)
- Use of Image control on Web Page (ASP.NET)
- Want help making program access a web page automatic. (C)
- DEfault web page has been jacked by a passthrough (Viruses, Spyware and other Nasties)
- Unable to open web page (Web Browsers)
- Printing Web Page (Windows 95 / 98 / Me)
- unable to access my web page (Domains and DNS)
- Opening a Web Page in a New Window (Windows tips 'n' tweaks)
- Win XP Explorer - Web Page View (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: Help with image color modification
- Next Thread: Displaying contact form inputs properly in the email
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date development directory display download dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parse parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql structure syntax system table thesishelp tutorial update upload url validation validator variable video web xml youtube





