PHP BLOG - somo la 9: Jinsi ya ku edit poost


PHP BLOG - somo la 9: Jinsi ya ku edit poost


image



Katika somo hil utawenda kujifunza jinsi ya ku edit post kwenye databse



1. kwanza tengeneza faili liite edit.php kisha weka code zifuatazo

<?php
$id = $_GET['id'];
include "config.php";
$Soma = mysqli_query($conn, "SELECT * FROM posts where id =$id");
while ($post = mysqli_fetch_array($Soma)){?>
<html>
<head>
<title>create your post</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.ckeditor.com/4.16.2/standard/ckeditor.js"></script>
<script src="ckeditor.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<form action="post_script.php" method="post" enctype="multipart/form-data">
<label for="title">Title</label><br>
<input type="text" name="title" placeholder="write your post title" id="title" value="<?php echo $post['title'];?>"><br>

<label for="summary">Summary</label><br>
<input type="text" name="summary" placeholder="write your post summary" id="summary" value="<?php echo $post['summary'];?>"><br>

<label for="content">content</label><br>
<textarea name="content" id="content" placeholder="wrte your post content"> <?php echo $post['content'];?></textarea>
<script>CKEDITOR.replace( 'content' );
</script>
<label for="publisher">publisher</label><br>
<input type="text" name="publisher" placeholder="write your post publisher" id="publisher" value="<?php echo $post['publisher'];?>"><br>

<label for="date">Date</label><br>
<input type="date" name="date" placeholder="write your post date" id="date" VALUE="<?php echo $post['post_time'];?>"><br><br>

<label for="update">Update time</label><br>
<input type="date" name="update" placeholder=&quo">...



Je! umeipenda hii post?
Ndio            Hapana            Save post

Imeandikwa na Rajabu Terehe 2023-10-20 Download PDF Share on facebook WhatsApp

RELATED POSTS

picha

Katika somo hili utakwenda kujifunza jinsi ya kutumia PHP kutengeneza
picha

Katika somo hili utakwenda kujifunza kuhusu static method na inavtotumika
picha

Katika somo hili utajwenda kujifunza jinsi ya kuzuia hacking kwenye
picha

Katika somo hili utakwenda kujifunza jinsi ya kuandika function za
picha

Hapa utajifunza jinsi ya kutengeneza table ambayo tutaitumia kwenye blog
picha

Katika course hii utakwenda kujifundisha jinsi ya lutengeneza blog kutoka
picha

Katika somo hili utakwenda kujifunza jinsi jinsi ya ku edit
picha

Katika somo hili utakwenda kujifunza jinsi ya ku upload mafaili
picha

katika post hii utajifunza jinsi ya kutengeneza ukurasa wa dashboard
picha

Katika post hii utakwenda kujifunza jinsi ya kutuma email kwa
picha

Katika somo hili utajifnza jinsi ya ku upload file kwenye
picha

Katika somo hili utakwend kujifunza kuhusu static property na jnsi
picha

Katika somo hili utakwenda kujifunza jinsi ya kukusanya taarifa za
picha

Katika somo hili uatakwenda kujifunza jinsi ya kutumia htaccess ili
picha

Katika somo hili utakwenda kujifunza kazi na matumizi ya construct
picha

Katika somo hili utakwenda kujifunza jinsi ya kuandika constant kwenye