admin2.php
<?php
$host = "localhost"; //Genelde localhosttur
$kullanici = "root"; // Mysql kullanıcı adınız
$sifre = ""; // Mysql şifreniz
$db = "doer"; // Mysql veri tabanı adı
$baglan = mysql_connect($host,$kullanici,$sifre) or die("Bağlantı başarısız");
mysql_select_db($db);
mysql_query("SET NAMES 'latin5'");
mysql_query("SET CHARACTER SET latin5");
mysql_query("SET COLLATION_CONNECTION = 'latin5_turkish_ci'");
$sql = "SELECT * FROM page WHERE id='$id'";
mysql_query ("UPDATE page SET page='$page' WHERE id='$id'");
mysql_close();
echo "Sayfa Güncellendi";
?>kodlarını içeren bir sayfam var. bu sayfayı admin.php'den çağırıyorum. o sayfada şöyle:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />
<link href="sample.css" rel="stylesheet" type="text/css" />
<!-- TinyMCE -->
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
language : "tr",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<!-- /TinyMCE -->
</head>
<?php
$host = "127.0.0.1"; //Genelde localhosttur
$kullanici = "root"; // Mysql kullanıcı adınız
$sifre = ""; // Mysql Åifreniz
$db = "doer"; // Mysql veri tabanı adı
$baglan = mysql_connect($host,$kullanici,$sifre) or die("BaÄlantı baÅarısız");
mysql_select_db($db);
mysql_query("SET NAMES 'latin5'");
mysql_query("SET CHARACTER SET latin5");
mysql_query("SET COLLATION_CONNECTION = 'latin5_turkish_ci'");
echo '<body>';
@$id = $_GET['id'];
$sorgu = mysql_query("select * from page where id = '".$id."'");
$yaz = mysql_fetch_array($sorgu);
echo '<form method="POST" action="admin2.php">
<center><input name="id" type="text" value= "'.$yaz['id'].'" size="20" style="display:none"><textarea name="page" id="page" cols="150" rows="30">'.$yaz['page'].'</textarea> <input type="submit" value="Güncelle"></center></p>
</form></body>
';
?>kodlar çok güzel çalışıyor fakat güncelle butonuna bastığım anda aşağıdaki hatayı alıyorum admin2.php'de .
Alıntı
Notice: Undefined variable: id in C:\Program Files\EasyPHP-5.3.3\www\doer\admin\admin2.php on line 11
Notice: Undefined variable: page in C:\Program Files\EasyPHP-5.3.3\www\doer\admin\admin2.php on line 12
Notice: Undefined variable: id in C:\Program Files\EasyPHP-5.3.3\www\doer\admin\admin2.php on line 12
Sayfa Güncellendi