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
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
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
Old 06-26-2012, 12:44 PM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

In this line:
PHP Code:
$add_member $db_object->query($result); 
There is a $db_object variable, but I don't see it defined or implemented any where.
Unless it is in any of these files
PHP Code:
require 'dbConnect.php';
//...
include("./headerHQ.php");
//...
include("./headerNegeri.php");
//..
include("./headerDaerah.php"); 
P.S. Please put code in php tags or highlight tags so that the code is easier to read.
tony is offline  
Reply With Quote
Old 06-29-2012, 03:12 AM   #3 (permalink)
The Visitor
 
Join Date: Jun 2012
Posts: 2
Thanks: 0
salina is on a distinguished road
Default plz help me

Dear tony, now im understand,the code for $add_member = $db_object->query($result); where by this code before this connect directly from my dbconnect.php(form connect to database),however,my linux server not working WHEN IM USED THAT CODE,that why i change the code to other code like the example:

//form dbconnect.php (connect to database)

<?php

// database info

$dbhost = "localhost";
$dbname = "epameran";
$dbuser = "root";
$dbpass = "Passw0rd";

// connect to the database

mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());

?>
implemented
So,that why $db_object variable,undefined. So what script should i change for $add_member = $db_object->query($result); which query should i use,im confused about this..plz help me
salina is offline  
Reply With Quote
Old 08-31-2012, 01:48 AM   #4 (permalink)
The Visitor
 
Join Date: Aug 2012
Posts: 2
Thanks: 0
souvenir is on a distinguished road
Default

When I started this project, I only intended to ge Custom T-Shirts off the ground. But since things were moving and no one was there to take over, I continued. But shortly after the initial excitement started, interest faded to only a few members. I am afraid that I no longer have the Short Sleeve T-Shirts Printing time for this project and must resign.
souvenir is offline  
Reply With Quote
Reply



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 08:17 AM.

 
     

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