TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-26-2012, 08:02 AM   #1 (permalink)
The Visitor
 
Join Date: Jun 2012
Posts: 2
Thanks: 0
salina is on a distinguished road
Default plz help me, form update got error when i post at my server linux

<?php
Header("Cache-Control: must-revalidate");
$offset = 60 * 60 * 24 * 3;
$ExpireString = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
Header($ExpireString);

session_start();
if ($_SESSION['nokp'] == NULL)
{
die("Sila log masuk menggunakan skrin utama !!");
}
$idStaf=strtoupper($_SESSION['nokp']);
require 'dbConnect.php';

$query02 = "SELECT * FROM pengguna WHERE nokp = '$idStaf'";
$result02 = mysql_query($query02) or die(mysql_error());
$nt02 = mysql_fetch_array($result02, MYSQL_ASSOC);
$paras = $nt02['kod_paras'];

if($paras == '1') {
include("./headerHQ.php");
} else if ($paras == '2'){
include("./headerNegeri.php");
}else if ($paras == '3'){
include("./headerDaerah.php");

}


?><HEAD>
<script language="javaScript"
type="text/javascript" src="calendar.js"></script>
<link href="calendar.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</HEAD>
<?


if (isset($_POST['submit'])) { // if form has been submitted
/* check they filled in what they supposed to,
passwords matched, username
isn't already taken, etc. */

"nama".$_POST['namaAhli']."<br>";
"emel".$_POST['emel']."<br>";



if (!$_POST['namaAhli'] || !$_POST['emel']){
unset($_SESSION['submit']);
?>

<table width='800' height='100' border='0' bordercolor='#F9F8F2' cellpadding='0' cellspacing='0' align='center' bgcolor='#F9F8F2'>
<TR height='50' valign='center'>
<TD style='border-width:0px' colspan='2' class='tbl_title' bgcolor="<?=$tblheader_color?>" align='center'><span style="color: #FFFFFF"><B>KEMASKINI PROFIL </B></span></TD>
</TR>
<TR>

<TR>
<TD style='border-width:0px' colspan='2'><CENTER><BR><BR>R A L A T<BR><HR><BR><BR>
Medan Nama, Emel dan Nombor Telefon hendaklah diisi !<BR>
<BR>
<input type=button value="Kembali" onClick="history.go(-1)"></CENTER></TD>
</TR>
</table>
<?
}
else {
// no HTML tags in username, website, location, password

$regdate = date('m d, Y');

$kemas_pengguna = "UPDATE pengguna SET nama='".$_POST['namaAhli']."', emel='".$_POST['emel']."' WHERE nokp='$idStaf'";
//$kemas_pengguna2 = "UPDATE penggunalogin SET nama='".$_POST['namaAhli']."', emel='".$_POST['emel']."' WHERE nokp='$idStaf'";
//update table pengguna
$result = mysql_query ($kemas_pengguna);
$add_member = $db_object->query($result);

//$result = mysql_query ($kemas_pengguna2);
//$add_member = $db_object->query($kemas_pengguna2);



if (DB::isError($add_member)) {
die($add_member->getMessage());
} else {
?>
<table width='800' height='100' border='0' bordercolor='<?=$tblborder_color?>' cellpadding='0' cellspacing='0' align='center' bgcolor='#FBFBF4'>
<TR height='50' valign='center'>
<TD style='border-width:0px' colspan='2' class='tbl_title' bgcolor="<?=$tblheader_color?>" align='center'><span style="color: #FFFFFF"><B>KEMASKINI PROFIL</B></span></TD>
</TR>
<TR>
<TD style='border-width:0px' colspan='2'><CENTER><BR><BR><BR><U>PENGESAHAN</U><BR><BR><BR>
Rekod pengguna telah dikemaskini.<BR>
<BR>
<input type=button value="Kembali" onClick="history.go(-1)"></CENTER><BR><BR><BR><BR></TD>
</TR>
</table>
<? }
$db_object->disconnect();}
} else { // if form hasn't been submitted ?>
<tr valign="top">
<td width="800">
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" name="formKemasProfil" method="post" onsubmit="return checkFormKemasProfil(this);">
<table width='800' height='247' border='0' bordercolor="#FBFBF4" cellpadding='0' cellspacing='0' align='center' bgcolor="#FBFBF4">
<TR height='50' valign='center'>
<TD height="50" colspan='4' align='center' bgcolor="<?=$tblheader_color?>" class='tbl_title' style='border-width:0px; color: #FFFFFF;'>KEMASKINI PROFIL</TD>
</TR>
<TR height='25'>
<TD width='236' height="21" align=right style='border-width:0px'>&nbsp;</TD>
<TD width="564" colspan="3" align=left class="MandMsg" style='border-width:0px'>Medan bertanda asteriks (*) hendaklah diisi.</TD>
</TR>
<TR>
<TD height="27" align=right class="tbl_kurCon" style='border-width:0px'>No. Kad Pengenalan :&nbsp;</TD>
<TD colspan="3" align=left class="tbl_kurCon" style='border-width:0px'><INPUT DISABLED VALUE="<?=$idStaf ?>" TYPE="text" NAME="nokp" size="12">
&nbsp; </TD>
</TR>
<TR>
<TD height="28" align=right class="tbl_kurCon" style='border-width:0px'>Nama * :&nbsp;</TD>
<TD colspan="3" align=left class="tbl_kurCon" style='border-width:0px'><INPUT VALUE="<?=$nt02['nama'] ?>" TYPE="text" NAME="namaAhli" size="70"></TD>
</TR>
<TR>
<TD height="27" align=right class="tbl_kurCon" style='border-width:0px'>E-Mel * : </TD>
<TD colspan="3" align=left class="tbl_kurCon" style='border-width:0px'><input value="<?=$nt02['emel'] ?>" type="text" name="emel" size="50">
</TD>
</TR>


<TR>
<TD style='border-width:0px'></TD>
<TD colspan="3" align=left class="tbl_kurCon" style='border-width:0px'><BR><BR>
<input type="submit" name="submit" value=":: Kemaskini ::"> <BR>
<BR><BR> </TD>
</TR>
</TABLE>
</FORM>

</td>
</tr>

<?php

}
?>
// error came out like this:

Notice: Undefined variable: db_object in /opt/lampp/htdocs/ePameran/kemaskiniProfilPengguna.php on line 83

Fatal error: Call to a member function query() on a non-object in /opt/lampp/htdocs/ePameran/kemaskiniProfilPengguna.php on line 83
salina is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Beginner Guide #1 Hershey Absolute Beginners 1 11-07-2011 10:42 PM
auto update of a form Can it be done only with PHP crimsont Absolute Beginners 1 07-09-2010 08:59 AM
update table with php form calexandru Absolute Beginners 0 08-04-2009 05:18 PM
Basic php form update mysql script dp2 Absolute Beginners 3 03-11-2009 04:06 PM
fetch data in a form without using post? kororo203 Absolute Beginners 5 05-14-2008 01:37 AM


All times are GMT. The time now is 09:52 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design