Sabtu, 29 Juni 2013

//Para suhu mohon pencerhannya, ane mau buat aksi...

Gunawan 4:22pm Jun 29
//
Para suhu mohon pencerhannya, ane mau buat aksi_edit dari sbuah artikel tp pas ane coba submit malah "id_nya" ga dapet?

//
<?php
$id=@$_GET['id'];
?>
<LINK href="../style/style.css" type="text/css" rel="stylesheet">
<?php

include"konek.php";

if (isset($_POST['submit'])){
$judul = $_POST['judul_artikel'];
$isi = $_POST['isi_artikel'];
$foto = @$_FILES['gambar_artikel'];

$sql = 'UPDATE `artikel` SET
jdl_artikel="'.$judul.'",
isi_artikel="'.$isi.'",
'.($foto['name']!=''?',gmb_artikel="'.$foto['name'].'"':'').'
WHERE id_artikel ="'.$id.'"';

if(mysql_query($sql)){
$type=0;
move_uploaded_file($foto['tmp_name'],'upload/'.$foto['name']);
?>

<script language="javascript">
alert("Data telah tersimpan");
top.location="index2.php?";
</script>
<?php
}
else{
$type=1;
echo $sql;
?>
<script language="javascript">
alert("Data gagal disimpan");
top.location="index2.php?";
</script>
<?php
}
?>
<?php
}
?>

Gunawan 4:31pm Jun 29
up ip

Gunawan 30 Jun, 2013


-
Source: http://www.facebook.com/groups/35688476100/?id=10151725095536101
--
Manage subscription | Powered by rssforward.com

Tidak ada komentar:

Posting Komentar