NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io


1
2
3
4
5
6
7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE `page` (
`id` int(12) NOT NULL auto_increment,
`page` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
INSERT INTO `page` VALUES (1, 'Örnek Sayfamız');
Şimdi de .html sayfalarımızı php yapacağız. Bunun için sadece .html uzantısı yerine .php yapmamız gerekecek. (Bu işlem sonucunda sayfanıza php kodlar çalışacaktır.)
Sayfamızın güncellenecek yerindeki kodları kesip bir yere kaydedelim(İçerisine gereksiz kısmı almayın). Sonra boş kalan kısım için şu kodu ekliyoruz.
PHP- Kodu:
<?php
//Mysql Bağlantısı Yapıyoruz
$host = "localhost"; //Genelde localhosttur
$kullanici = "root"; // Mysql kullanıcı adınız
$sifre = "123456"; // Mysql şifreniz
$db = ""; // 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'");
// Mysqldan veri çekiyoruz....
@$id = 1; //Mysqldan çekmek istediğimiz sayfamızın idsi
$sorgu = mysql_query("select * from page where id = '".$id."'");
$yaz = mysql_fetch_array($sorgu);
echo '
'.$yaz['page'].'';
?>
Bu işlemi yaptıktan sonra sayfanın güncel olacak yerinde Örnek Sayfamız yazcaktır. Yazmıyor ise mysql bilgilerinde yanlışlık vardır veya mysql sorgusunu yapmamışsınızdır.
Şimdi sırada admin paneli sayfamız var. Aşağıdaki kodları admin.php olarak kaydedin.
PHP- Kodu:
<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
//Mysql Bağlantısı Yapıyoruz
$host = "localhost"; //Genelde localhosttur
$kullanici = "root"; // Mysql kullanıcı adınız
$sifre = "123456"; // Mysql şifreniz
$db = ""; // 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>
';
?>
Aşağıdaki kodu ise admin2.php olarak kaydedelim.
PHP- Kodu:
<?php
$host = "localhost"; //Genelde localhosttur
$kullanici = "root"; // Mysql kullanıcı adınız
$sifre = "123456"; // Mysql şifreniz
$db = ""; // 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";
?>
admin.php kurulu olduğu yere ekteki TinyMCE.rar dosyasının içindekileri de atalım.
Kendi admin panelimizi yapmış olduk.
Sayfa düzenlemesi için admin.php?id=1 olarak gireceğiz.(1 kısmı sayfamızın idsi)
Birden fazla sayfayı admin panelinden düzenlemek istiyorsanız php myadminden yeni veri ekleyip, daha sonra ilk aşamadaki kodda yani (
Sayfamızın güncellenecek yerindeki kodları kesip bir yere kaydedelim(İçerisine gereksiz kısmı almayın). Sonra boş kalan kısım için şu kodu ekliyoruz.) kısmının altındaki koddaki işlemi yapıyoruz ve id kısmını sayfamızın idsini giriyoruz. Örneğin ikinci sayfamız için orayı "@$id = 2;"
şeklinde düzenliyoruz.
+Karakter Hatası Düzeltilmiştir.
TinyMCE Download
Makale tamamen tarafımca yazılmıştır.
Beğen
1 kişi bunu beğendi.
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.