il problema e proprio questo,
non so cosa scrivere perche quello che ho provato non va.
Codice PHP:
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
$id = $_GET['id'];
if ((isset($_GET["v"])) && ($_GET["v"] == "r")) {
$updateSQL = sprintf("UPDATE banner SET views = views +1 WHERE id= '$id'",
GetSQLValueString($_POST['views'], "int"),
GetSQLValueString($_POST['id'], "int"));
mysql_select_db($database_gen, $gen);
$Result1 = mysql_query($updateSQL, $gen) or die(mysql_error());
}
?>
<script>
document.write('<a href="....<img src="..');
</script>
questo script php, è parziale.
fai finta che questo scritp php, oltre ad aggiornare la tabella views,seleziona l'url di un immagine e un link verso ui reindirizzre dopo il click sul banner.
ora vorrei che il tutto, quindi l' immagine linkata verso l'url selezionato, venga stampato a video e che si veda nella pagina dove è incluso lo script.
solo che niente. ho provato con un document.write oppure con echo ma non va.