<?php require_once('Connections/baglanti.php'); ?>
<?php require_once('Connections/baglanti.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO makaleler (id, baslik, icerik, kategori, keywords) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['id'], "int"),
GetSQLValueString($_POST['baslik'], "text"),
GetSQLValueString($_POST['icerik'], "text"),
GetSQLValueString($_POST['kategori'], "text"),
GetSQLValueString($_POST['keywords'], "text"));
mysql_select_db($database_baglanti, $baglanti);
$Result1 = mysql_query($insertSQL, $baglanti) or die(mysql_error());
$insertGoTo = "kategoriler.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_baglanti, $baglanti);
$query_goster = "SELECT kategori,max(id) id FROM makaleler GROUP BY kategori";
$goster = mysql_query($query_goster, $baglanti) or die(mysql_error());
$row_goster = mysql_fetch_assoc($goster);
$totalRows_goster = mysql_num_rows($goster);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>kategoriler</title>
</head>
<body>
<p> </p>
<table border="1">
<?php do { ?>
<tr>
<td><a href="baslik.php?kategori=<?php echo $row_goster['kategori']; ?>"><?php echo $row_goster['kategori']; ?></a></td>
</tr>
<?php } while ($row_goster = mysql_fetch_assoc($goster)); ?>
</table>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>
<?php
mysql_free_result($goster);
?>
sayfanın tüm kodları bu dediğiniz kodları nereye yapıştıracağım? 0