Selasa, 12 November 2013

PHP Indonesia - Facebook: mas dmna salahnya????????????? ini proses inputnya...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Find Unique T-shirts

Explore the most popular t-shirts on Cafepress. Discover great designs celebrating anything you can think of.
From our sponsors
mas dmna salahnya????????????? ini proses inputnya...
Nov 12th 2013, 13:16, by Last Mint

Last Mint 1:16pm Nov 12
mas dmna salahnya?????????????
ini proses inputnya

<?php
include("koneksi.php");
if
(empty($Judul) or empty ($Berita))
{
echo"data berita belum lengkap";
}

strip_tags($Berita);

$foto=$_FILES['foto']['name'];

$tanggal=date("d M Y");

$bulan=date("M");

$tambahData=mysql_query("insert into berita set
judul='$Judul',
isiBerita='$Berita',
gambar='$foto',
tanggal='$tanggal',
bulan='$bulan'
");

copy($HTTP_POST_FILES['foto']['tmp_name'],"image/".$_FILES['foto']['name']);
if ($tambahData)
//
{

header("location:admin.php?p=berita&tambahBerita=ok");
}
else
{
echo "Berita gagal di input<br>";
echo mysql_error();
}
?>

/////////ini proses editnya

<?php
//input data ke database
//1.koneksi ke mysql
mysql_connect("localhost","root","123456");

//2.pilih database yang akan di pakai
mysql_select_db("elearningsmk");

//scurity
$Berita=strip_tags($Berita);

$foto=$_FILES['foto']['name'];

$tanggal=date("d M Y");

//3.ubah data ke dalam tabel
$ubah=mysql_query("update berita set
judul='$Judul',
isiBerita='$Berita',
gambar='$foto',
tanggal='$tanggal',
bulan='$bulan'
where id=$ganti");

copy($HTTP_POST_FILES['foto']['tmp_name'],"image/".$_FILES['foto']['name']);
//4. mengecek keberhasilan langkah 3
if($ubah) //if=jika
{

header("location:admin.php?p=berita&gantiBerita=ok");
}
else // selin itu
{
echo"data gagal di edit<br>".mysql_error();/// mysql_error===menepilkan kesalahan sql
}
?>

malsahnya ketika tulisan kita di edit jadi justtify?????
kotak semua gak mau nyusun jadi paragraf

Rizki Abriansyah 1:23pm Nov 12
duh pusing bacanya :3

Last Mint 1:29pm Nov 12
hehhehe.....................??? fungsi editnya jalan namun hasilnya gak pas. di halaman beritanya. padahan udah pake ckeditor

Novan Ary 1:35pm Nov 12
strip_tags nya gan? bakal escape semua tag html. kalo pake ckeditor kn stringnya di sisipi tag html dn css. kalo di filter sama strip_tags bakal hilang juga tag html yg d inject ckeditor. mohon koreksi kalo salah

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar