Wie kann ich diesen Code umwandeln so dass er mit
<script language="JavaScript" type="text/javascript" src="datei.js?id=123"></script> augerufen werden kann?
<script language="JavaScript" type="text/javascript" src="datei.js?id=123"></script> augerufen werden kann?
PHP-Code:
<?php
$db = mysql_connect("localhost", "webxx", "xxxxxxxxx") or die("Could not connect.");
if(!$db)
die("no db");
if(!mysql_select_db("webxxxx",$db))
die("No database selected.");
if(!defined('NO_SESS')) define('NO_SESS', 1);
define('SCRIPT_PATH', '');
include SCRIPT_PATH."main.inc";
$view = 'User';
$sql = "SELECT count(id) FROM user";
$res = mysql_query($sql);
$u_sers = mysql_result($res, 0); //anzahl user
$sql = "SELECT username, posts FROM user WHERE id = $id";
$res = mysql_query($sql);
$zeit=time();
$count=0;
$max_hits = 0;
$max_balken_pcx = 400;
$data = mysql_fetch_array( $res );
$title = "testjs";
if ($data[1] > 0) { $breite = ($data[1]*6); }
$bild = imagecreatefrompng("./test.png");
$gruen = imagecolorallocate($bild,7,121,62);
imagefilledrectangle($bild,1,12,$breite,15,$gruen);
imagepng($bild,"./test1.png");
echo"<img src=\"./test1.png\" width=\"62\" height=\"17\" border=\"0\" alt=\"$title\"title=\"$title\">";
imagedestroy($bild);
?>
Kommentar