in reply to Re: Can i call a handmade perl module within a php file?
in thread Can i call a handmade perl module within a php file?
...and after the creation of the module i will have to invoke it as follows(iam sure i have errors)<?php function counter($pagename,$db,$host) { preg_match("{([^/\\]+?)(?:\.[^/\\.]+)?$}", $pagename, $matches); l +ist($pagename) = $matches; //======= Insert or Update pagecounter appropriately, then display + it ======== @$db->do('INSERT INTO counters (pagename, pagecounter) VALUES (?, +0)', null, $pagename); if ($host != 'webmaster') $db->do('UPDATE counters SET pagecounter + = pagecounter + 1 WHERE pagename = ?', null, $pagename); list($counter) = $db->selectrow_array('SELECT pagecounter FROM cou +nters WHERE pagename = ?', null, $pagename); return $counter; } ?>
This became php coding now but it started as a perl question and ended like this (sorry for this)$file = $_SERVER['SCRIPT_FILENAME']; $host = $_SERVER['SERVER_ADDR']; $db = mysql_pconnect("mysql1.000webhost.com", "a3310457_counter", "a33 +10457_akis", "*****"); #i changed host and details here $counter = counter( $file, $db, $host );
|
|---|