PHP in skin_x
Started by Solltex, Nov 21 2005 08:09 AM
2 replies to this topic
#1
Posted 21 November 2005 - 08:09 AM
I have nice script (ip2country) This script in PHP. Howto add in footer. Footer is html.
#2
Posted 21 November 2005 - 02:05 PM
You can't add PHP code into the skins. You will have to put your PHP code in whatever source file calls the appropriate skin template and pass the result of the PHP code into that skin template as a variable.
Michael McCune - IPS Marketplace Moderator
My Stuff: My Forum · My Resources · My Tutorials
Contact Me: Email · Facebook · Twitter
My Stuff: My Forum · My Resources · My Tutorials
Contact Me: Email · Facebook · Twitter
#3
Posted 21 November 2005 - 02:33 PM
Help me add this PHP, here this PHP:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head><title>IP</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<style type="text/css">
body{color:#C0C0C0;background-color:#191B21;align=center}
div{padding:2px;font-size:11px;font-family:Verdana,sans-serif}
input{font-family:Verdana,sans-serif;font-size:11px;border:1px #666666 solid}
</style></head><body onload="document.forms[0].ip.focus()">
<div>
<?php
include "ip2c.inc";
include"geoipcity.inc";
$gi = geoip_open("GeoIPCity.dat",GEOIP_STANDARD);
$record = geoip_record_by_addr($gi,$REMOTE_ADDR=$HTTP_SERVER_VARS['REMOTE_ADDR']);
print $record->country_code . " ";
print $record->city . "\n";
geoip_close($gi);
?>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head><title>IP</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<style type="text/css">
body{color:#C0C0C0;background-color:#191B21;align=center}
div{padding:2px;font-size:11px;font-family:Verdana,sans-serif}
input{font-family:Verdana,sans-serif;font-size:11px;border:1px #666666 solid}
</style></head><body onload="document.forms[0].ip.focus()">
<div>
<?php
include "ip2c.inc";
include"geoipcity.inc";
$gi = geoip_open("GeoIPCity.dat",GEOIP_STANDARD);
$record = geoip_record_by_addr($gi,$REMOTE_ADDR=$HTTP_SERVER_VARS['REMOTE_ADDR']);
print $record->country_code . " ";
print $record->city . "\n";
geoip_close($gi);
?>
</div>
</body>
</html>
















