Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- HIding Javascript


jatar_k - 4:47 pm on Jul 10, 2005 (gmt 0)


I think script.php should look something like this

<?
session_start();
if($allow_script)
{
header("Content-type: text/javascript");
?>

var exchRate = 1.20379;
function getUSD(price) {
var USD = price * exchRate;
if (USD.toFixed) { // check whether the browser supports that method
USD = USD.toFixed(2); // (2 is the required number of decimals)
} else {
USD = Math.round(USD*100)/100; // less perfect for older browsers
}
USD = '<b>USD $' + USD + '<\/b>'; // concatenation. escape the slash after the <
document.write(USD); // write the result
}

<?
$allow_script = false;
}
?>


Thread source:: http://www.webmasterworld.com/php/9105.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com