Jump to content

sueirnaa

Members
  • Posts

    28
  • Joined

  • Last visited

sueirnaa's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. hi everyone..plz help me how to make/set spacing before and after with 0(zero)..when press enter in Office 2007..it will go to down with single spacing. Actually im using php to word
  2. sueirnaa

    INPUT TEXT IN PHP

    I want to change textarea to input type(textfield)...i got error when i changed to this code <input name="txtalamat" type="text" class="color" id="peranan" value="<?php echo $row1['alamatpusat']; ?>" size="50" /> Here is the original code for this situation <?php if(isset($row1['pusatexam'])){ echo "<textarea rows=10 name=txtalamat1 cols=50 class=fixexTextArea >"; echo $row1['alamatpusat']; echo "</textarea>"; } else { echo "<textarea rows=10 name=txtalamat2 cols=50 class=fixexTextArea >"; echo "</textarea>"; } ?> hope somebody can help me.Thnx
  3. yup..but still doesn't works..here is my code...
  4. no..i didn't found. i tried this code $pdf->Align(Justify); it doesn't works.
  5. plz tell me code for justify text in fpdf...actually i want to generate some report to pdf using fpdf...but i dont know how to justify my text...anyone knows the code?
  6. i got problem with my page. How do i clear memory browser in php script?...when i login to my page..then press button back in browser...it will back to login page..and when i press button forward..it will proceed next page without login..it seems not secure.
  7. hi...anyone can help me how do i send record to textfield as a input from a pop up window.The pop up window displayed record from database.here is code tht i have... form.php<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Surat lantikan</title><link href="../../css/colortextfield.css" rel="stylesheet" type="text/css" /></head><body><form action="cetaksurat.php" method="post" name="form1" class="style1" id="form1"> <table width="741" border="1" align="center" class="surat"> <!--DWLayoutTable--> <tr bgcolor="#999999" class="style1"> <td height="49" colspan="2" valign="top"><div align="center"><font size="4" face="Verdana, Arial, Helvetica, sans-serif"><strong>Pelantikan sebagai Ketua Pengawas</strong></font><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br /> </font><font size="4" face="Verdana, Arial, Helvetica, sans-serif"><strong><font size="2">(Bukan Kakitangan SPA)</font> </strong></font><font size="2" face="Verdana, Arial, Helvetica, sans-serif"></font><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br /> </font></div></td> </tr> <tr class="style1"> <td height="44" colspan="2" valign="top"><font size="2" face="Arial, Helvetica, sans-serif"><font color="#000099" face="Verdana, Arial, Helvetica, sans-serif"><strong>Sila lengkapkan maklumat dibawah</strong> :-<br /> </font></font></td> </tr> <tr class="style1"> <td width="273" height="27" valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"><span class="style1">Rujukan surat : </span></font></strong></td> <td width="452" valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"> <label> <input name="txtrujukan" type="text" class="textfieldcolor" id="txtrujukan" /> </label> </font></strong></td> </tr> <tr class="style1"> <td height="26" valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"><span class="style1">Tarikh surat : </span></font></strong></td> <td valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"> <select name="select"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>20</option> <option>21</option> <option>22</option> <option>23</option> <option>24</option> <option>25</option> <option>26</option> <option>27</option> <option>28</option> <option>29</option> <option>30</option> <option>31</option> </select> hb <select name="select2"> <option>Januari</option> <option>Februari</option> <option>Mac</option> <option>April</option> <option>Mei</option> <option>Jun</option> <option>Julai</option> <option>Ogos</option> <option>September</option> <option>Oktober</option> <option>November</option> <option>Disember</option> </select> Bulan <select name="select3"> <option>2000</option> <option>2001</option> <option>2002</option> <option>2003</option> <option>2004</option> <option>2005</option> <option>2006</option> <option>2007</option> <option>2008</option> <option>2009</option> <option>2010</option> <option>2011</option> <option>2012</option> <option>2013</option> <option>2014</option> <option>2015</option> <option>2016</option> <option>2017</option> <option>2018</option> <option>2019</option> <option>2020</option> </select> Tahun </font></strong></td> </tr> <tr class="style1"> <td height="27" valign="top"><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Gelaran :</strong></font></td> <td valign="top"><select name="selectgelaran" id="selectgelaran"> <option>Tuan</option> <option>Puan</option> <option>Encik</option> <option>Cik</option> </select></td> </tr> <tr class="style1"> <td height="27" valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"><span class="style1">Nama Ketua/Pengawas </span>:</font></strong></td> <td valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"> <input name="txtpengawas" type="text" class="textfieldcolor" id="txtpengawas" /> <A HREF="java script:void(0)"onclick="window.open('../../pengawas/cariannama.php','welcome','width=300,height=200')">Open a new window</A></font></strong></td> </tr> <tr class="style1"> <td height="27" valign="top"><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Melalui : </strong></font></td> <td valign="top"><select name="Selectmelalui" id="Selectmelalui"> <option>Ketua Pengarah</option> <option>Pengarah</option> <option>Setiausaha Bahagian</option> <option>Ketua Bahagian</option> <option>Ketua Seksyen</option> <option>Pengetua</option> <option>Guru Besar</option> </select></td> </tr> <tr class="style1"> <td height="27" valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif">Nama Jabatan :</font></strong></td> <td valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"> <input name="txtjab" type="text" class="textfieldcolor" id="txtjab" /> cari </font></strong></td> </tr> <tr class="style1"> <td height="27" valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"><span class="style1">Alamat bertugas : </span></font></strong></td> <td valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"> <input name="txtalamat" type="text" class="textfieldcolor" id="txtalamat" /> cari </font></strong></td> </tr> <tr class="style1"> <td height="27" valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif">Peperiksaan : </font></strong></td> <td><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"><span class="style3"> <input name="txtpep" type="text" class="textfieldcolor" id="txtpep" /> cari </span></font></strong></td> </tr> <tr class="style1"> <td height="27" valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif">Tarikh Peperiksaan :</font></strong></td> <td><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"> <select name="select4"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>20</option> <option>21</option> <option>22</option> <option>23</option> <option>24</option> <option>25</option> <option>26</option> <option>27</option> <option>28</option> <option>29</option> <option>30</option> <option>31</option> </select> hb <select name="select5"> <option>Januari</option> <option>Februari</option> <option>Mac</option> <option>April</option> <option>Mei</option> <option>Jun</option> <option>Julai</option> <option>Ogos</option> <option>September</option> <option>Oktober</option> <option>November</option> <option>Disember</option> </select> Bulan <select name="select6"> <option>2000</option> <option>2001</option> <option>2002</option> <option>2003</option> <option>2004</option> <option>2005</option> <option>2006</option> <option>2007</option> <option>2008</option> <option>2009</option> <option>2010</option> <option>2011</option> <option>2012</option> <option>2013</option> <option>2014</option> <option>2015</option> <option>2016</option> <option>2017</option> <option>2018</option> <option>2019</option> <option>2020</option> </select> Tahun </font></strong></td> </tr> <tr class="style1"> <td height="27" valign="top"><p class="style1"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif">Nama pusat peperiksaan :</font></strong></p></td> <td><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"><span class="style1"> <input name="txtpusat" type="text" class="textfieldcolor" id="txtpusat" /> cari </span></font></strong></td> </tr> <tr class="style1"> <td height="40" valign="top"><p class="style1"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif">Alamat Pusat :</font></strong></p></td> <td valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"> <input name="txtalamatp" type="text" class="textfieldcolor" id="txtalamatp" /> cari</font></strong></td> </tr> <tr class="style1"> <td height="30" valign="top"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"><span class="style1"> <input type="submit" name="Submit" value="Proses" /> </span></font></strong></td> <td><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></td> </tr> <tr class="style1"> <td height="24"><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></td> <td><strong><font color="#333333" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></td> </tr> </table></form></body></html>popupwindow.php<html><head><script LANGUAGE="JavaScript"><!-- Idea by: Nic Wolfe --><!-- This script and many more are available free online at --><!-- The JavaScript Source!! http://javascript.internet.com --><!-- Beginfunction popUp(URL) {day = new Date();id = day.getTime();eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=400,height=400,left = 483,top = 184');");}// End --></script><title>carian nama</title><style type="text/css"><!--.bordertable { border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: solid; border-top-color: #666666; border-right-color: #666666; border-bottom-color: #666666; border-left-color: #666666;}.bgtable { background-color: #FFFFCC;}.style12 {background-color: #FFFFCC; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; }.text { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; font-variant: normal; color: #333333;}.style13 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333333;}--></style></head><body><?php@$DB = new mysqli(localhost, root, xxxx, xxxx);if (mysqli_connect_errno()){ echo 'Cannot connect to database: ' . mysqli_connect_error();}else{ $Query = 'SELECT * FROM pengawas ORDER BY Nama ASC'; $Result = $DB->query($Query); $NumResults = $Result->num_rows; echo "<b>$NumResults Pengawas dalam rekod</b>";?> <span class="style13">:: untuk sementara waktu boleh copy dan paste :: *masih dalam proses pembangunan </span> <table border="1" class="text"> <tr> <th width="219" class="style12">Nama Pengawas </th> <th width="152" class="style12">No.Kad Pengenalan</th> <th width="198" class="style12">Tempat bertugas </th> <th width="122" class="style12">Bandar</th> </tr><?php while ($Row = $Result->fetch_assoc()) { echo '<tr>'; echo '<td>' . $Row['Nama'] . '</td>'; echo '<td>' . $Row['KP'] . '</td>'; echo '<td>' . $Row['Namajab'] . '</td>'; echo '<td>' . $Row['bandar'] . '</td>'; }?></table><?php $Result->free(); $DB->close();}?></body></html>
  8. it doesn't works..but i changed the update.php. Here is my files.. can download now.If u have phpmyadmin..can paste (peperiksaan folder) to mysql--> data http://www.4shared.com/file/Bw5EvW9a/add-v...ate-delete.htmli hope u can do correction for my page.tq.
  9. i got error msg :Notice: Undefined index: update in D:\xampplite\htdocs\Login\peperiksaan\add-delete-update\update.php on line 5Notice: Undefined index: msg in D:\xampplite\htdocs\Login\peperiksaan\add-delete-update\update.php on line 50but how to define index update ? im so blurred here..if($_GET['update'])
  10. yup..error msg :Notice: Undefined index: update in D:\xampplite\htdocs\Login\peperiksaan\add-delete-update\update.php on line 4 Notice: Undefined index: msg in D:\xampplite\htdocs\Login\peperiksaan\add-delete-update\update.php on line 49how to define index...wht should i do?can someone show me?update.php<?phpinclude_once ("config.php");if($_GET['update']){//$PengawasID = mysql_real_escape_string($_POST['PengawasID']);$Nama = mysql_real_escape_string($_POST['Nama']);$KP = mysql_real_escape_string($_POST['KP']);$Jawatan = mysql_real_escape_string($_POST['Jawatan']);$Gred = mysql_real_escape_string($_POST['Gred']);$Tlantik = mysql_real_escape_string($_POST['Tlantik']);$Tsah = mysql_real_escape_string($_POST['Tsah']);$alamat = mysql_real_escape_string($_POST['alamat']);$poskod = mysql_real_escape_string($_POST['poskod']);$bandar = mysql_real_escape_string($_POST['bandar']);$notel = mysql_real_escape_string($_POST['notel']);$nofax = mysql_real_escape_string($_POST['nofax']);$nohp1 = mysql_real_escape_string($_POST['nohp1']);$query = mysql_query("UPDATE pengawas SET `Nama`= '$Name', `kp`= '$KP',`Jawatan`='$jawatan', `Gred`='$gred', `Tlantik`='$lantik1', `Tsah`= '$sah1',`alamat`= '$alamat', `poskod`= '$poskod', `notel`= '$notel', `nofax`= '$notelp', `nohp1`= '$hp'")or die('Error : ' . mysql_error()); header("Location: update.php?PengawasID=$PengawasID&msg=done"); exit;}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>DBexam</title><style type="text/css"><!--.style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;}.style2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; color: #333333;}--></style></head><body><h2 align="center" class="style2">Kemaskini Maklumat Pengawas </h2><p><?phpif ($_GET['msg']){ echo "<p style=\"color:#FF0000\"><strong>Your content has been updated!</strong></p>";}$show = "SELECT * FROM pengawas WHERE PengawasID='$_GET[PengawasID]'";$result = mysql_query($show);while ($show = mysql_fetch_array ($result)){//$PengawasID = $show['PengawasID'];$Name = $show['Nama'];$kp = $show['KP'];$jawatan = $show['Jawatan'];$gred = $show['Gred'];$lantik1 = $show['Tlantik'];$sah1 = $show['Tsah'];$alamat = $show['alamat'];$poskod = $show['poskod'];$bandar = $show['bandar'];$notel = $show['notel'];$notelp = $show['nofax'];$hp = $show['nohp1'];}?><form action="update.php?update=yes" method="post"> <table width="99%" border="0" cellspacing="1" cellpadding="1"> <tr> <th width="34%" class="text" scope="row"><div align="left" class="style1">Nama:</div></th> <td width="66%"> <input name="name" type="text" id="name" value="<?php echo $Name; ?>"/> </td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">No.Kad Pengenalan :</div></th> <td><input name="kp" type="text" value="<?php echo $KP; ?>" /> <label></label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">Jawatan : </div></th> <td><label> <input name="jawatan" type="text" id="jawatan" value="<?php echo $Jawatan;?>" /> </label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">Gred Jawatan </div></th> <td><label> <input name="gred" type="text" value="<?php echo $Gred;?>" /> </label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">Tarikh dilantik ke jawatan sekarang : </div></th> <td><label> <input name="lantik1" type="text" value="<?php echo $Tlantik;?>" /> </label> <label></label> <label></label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">Tarikh disahkan ke jawatan sekarang :</div></th> <td><label> <input name="sah1" type="text" value="<?php echo $Tsah;?>" /> </label> <label></label> <label></label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">Alamat tempat bertugas : </div></th> <td><label> <input name="alamat" type="text" value="<?php echo $alamat;?>" /> Poskod <input name="poskod" type="text" value="<?php echo $poskod;?>" /> Bandar : <input name="bandar" type="text" value="<?php echo $$bandar;?>" /></label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">No Telefon Pejabat : </div></th> <td><label> <input name="notel" type="text" value="<?php echo $notel;?>" /> </label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">No Faks Pejabat : </div></th> <td><label> <input name="notelp" type="text" value="<?php echo $nofax;?>" /> </label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">No Telefon Bimbit : </div></th> <td><label> <input name="textfield16" value="<?php echo $nohp1;?>" /> </label></td> </tr> <tr> <th scope="row"> </th> <td><input type="submit" name="Submit" value="Update" /> <input type="hidden" value="<?php echo $PengawasID; ?>" name="PengawasID"> </td> </tr> <tr> <th scope="row"> </th> <td> </td> </tr> <tr> <th scope="row"> </th> <td> </td> </tr> <tr> <th scope="row"> </th> <td> </td> </tr> <tr> <th scope="row"> </th> <td> </td> </tr></table></form><p> </p></body></html>
  11. when i put code error reporting..ohw god..so many errorsNotice: Use of undefined constant localhost - assumed 'localhost' in C:\xampplite\htdocs\Login\peperiksaan\add-delete-update\config.php on line 11Notice: Use of undefined constant Nama - assumed 'Nama' in C:\xampplite\htdocs\Login\peperiksaan\add-delete-update\view.php on line 44wht should i do, how to defined constant localhost & others...sorry..im a beginner...
  12. thescientist: while statement not closed? emm I'm not understand, i cannot get you what you are saying.. you better make an example coding so that i can understand.
  13. ok..here is my tabledb_name : peperiksaantable_name :pengawasfield : PengawasID Int(11),auto increment Nama varchar(50) KP varchar(12),primary key Jawatan text Gred Int(11) Tlantik text Tsah text alamat text poskod Int(11) bandar text notel Int(11) nofax Int(11) nohp1 Int(15)my php code..there are 3 files phpconfig.php<?php define('DB_HOST', 'localhost'); define('DB_USER', 'root'); define('DB_PASSWORD', 'xxxxx'); define('DB_DATABASE', 'peperiksaan');$connect = mysql_connect(localhost, root, xxxxx) or die("Cannot connect to the database");mysql_select_db(peperiksaan) or die("Cannot select the database");?>view.php<?phpinclude_once ("config.php");?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><style type="text/css"><!--.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}.style5 {color: #FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }.text { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; color: #333333;}--></style></head><body><h2 align="center" class="style1">Maklumat Pengawas </h2><p> </p><table width="96%" border="0" cellspacing="1" cellpadding="1"> <tr> <th width="18%" bgcolor="#333300"><div align="left" class="style5">Nama</div></th> <th width="17%" bgcolor="#333300"><div align="left" class="style5">No.Kad Pengenalan </div></th> <th width="26%" bgcolor="#333300"><div align="left" class="style5">Jawatan</div></th> <th width="13%" bgcolor="#333300"><div align="left" class="style5">Gred </div></th> <th width="15%" bgcolor="#333300"><div align="left" class="style5">Alamat bertugas </div></th> <th width="11%" bgcolor="#333300"><div align="left" class="style5">Update</div></th> </tr></table><?php$show = "SELECT * FROM pengawas ORDER BY Nama ASC";$result = mysql_query($show);while ($show = mysql_fetch_array ($result)){ //$PengawsID= $show[PengawasID]; $Nama= $show[Nama]; $KP= $show[KP]; $Jawatan= $show[Jawatan]; $Gred= $show[Gred]; $alamat=$show[alamat]; ?><table width="97%" border="0" cellpadding="1" cellspacing="1" class="text"> <tr> <td width="18%"><p align="left"><?php echo $Nama; ?></p></td> <td width="17%"><p align="left"><?php echo $KP; ?></p></td> <td width="25%"><p align="left"><?php echo $Jawatan; ?></p></td> <td width="13%"><p align="left"><?php echo $Gred; ?></p></td> <td width="15%"><p align="left"><?php echo $alamat; ?></p></td> <td width="12%"><p align="left"><a href="update.php?PengawasID=<?php echo $PengawasID; ?>">Update</a></p></td> </tr></table><?php}?><p> </p></body></html>update.php<?phpinclude_once ("config.php");if($_GET['update']){$PengawasID = mysql_real_escape_string($_POST['PengawasID']);$Name = mysql_real_escape_string($_POST['Nama']);$kp = mysql_real_escape_string($_POST['KP']);$jawatan = mysql_real_escape_string($_POST['Jawatan']);$gred = mysql_real_escape_string($_POST['Gred']);$lantik1 = mysql_real_escape_string($_POST['Tlantik']);$sah1 = mysql_real_escape_string($_POST['Tsah']);$alamat = mysql_real_escape_string($_POST['alamat']);$poskod = mysql_real_escape_string($_POST['poskod']);$bandar = mysql_real_escape_string($_POST['bandar']);$notel = mysql_real_escape_string($_POST['notel']);$notelp = mysql_real_escape_string($_POST['nofax']);$hp = mysql_real_escape_string($_POST['nohp1']);$query = mysql_query("UPDATE pengawas SET `Nama`= '$Name', `kp`= '$KP',`Jawatan`='$jawatan', `Gred`='$gred', `Tlantik`='$lantik1', `Tsah`= '$sah1',`alamat`= '$alamat', `poskod`= '$poskod', `notel`= '$notel', `nofax`= '$notelp', `nohp1`= '$hp'")or die('Error : ' . mysql_error()); header("Location: update.php?PengawasID=$PengawasID&msg=done"); exit;}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>DBexam</title><style type="text/css"><!--.style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;}.style2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; color: #333333;}--></style></head><body><h2 align="center" class="style2">Kemaskini Maklumat Pengawas </h2><p><?phpif ($_GET['msg']){ echo "<p style=\"color:#FF0000\"><strong>Your content has been updated!</strong></p>";}//SELECT columns FROM table_name [WHERE condition] [ORDER BY order_type] [LIMIT limit_criteria];$show = "SELECT * FROM pengawas WHERE PengawasID='$_GET[PengawasID]'";$result = mysql_query($show);while ($show = mysql_fetch_array ($result)){$PengawasID = $show[PengawasID];$Name = $show[Nama];$kp = $show[KP];$jawatan = $show[Jawatan];$gred = $show[Gred];$lantik1 = $show[Tlantik];$sah1 = $show[Tsah];$alamat =$show[alamat];$poskod = $show[poskod];$bandar = $show[bandar];$notel = $show[notel];$notelp = $show[nofax];$hp = $show[nohp1];}?><form action="update.php?update=yes" method="post"> <table width="99%" border="0" cellspacing="1" cellpadding="1"> <tr> <th width="34%" class="text" scope="row"><div align="left" class="style1">Nama:</div></th> <td width="66%"> <input name="name" type="text" id="name" value="<?php echo $Nama; ?>"/> </td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">No.Kad Pengenalan :</div></th> <td><input name="kp" type="text" value="<?php echo $KP; ?>" /> <label></label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">Jawatan : </div></th> <td><label> <input name="jawatan" type="text" id="jawatan" value="<?php echo $Jawatan;?>" /> </label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">Gred Jawatan </div></th> <td><label> <input name="gred" type="text" value="<?php echo $Gred;?>" /> </label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">Tarikh dilantik ke jawatan sekarang : </div></th> <td><label> <input name="lantik1" type="text" value="<?php echo $Tlantik;?>" /> </label> <label></label> <label></label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">Tarikh disahkan ke jawatan sekarang :</div></th> <td><label> <input name="sah1" type="text" value="<?php echo $Tsah;?>" /> </label> <label></label> <label></label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">Alamat tempat bertugas : </div></th> <td><label> <input name="alamat" type="text" value="<?php echo $alamat;?>" /> Poskod <input name="poskod" type="text" value="<?php echo $poskod;?>" /> Bandar : <input name="bandar" type="text" value="<?php echo $$bandar;?>" /></label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">No Telefon Pejabat : </div></th> <td><label> <input name="notel" type="text" value="<?php echo $notel;?>" /> </label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">No Faks Pejabat : </div></th> <td><label> <input name="notelp" type="text" value="<?php echo $nofax;?>" /> </label></td> </tr> <tr> <th class="text" scope="row"><div align="left" class="style1">No Telefon Bimbit : </div></th> <td><label> <input name="textfield16" value="<?php echo $nohp1;?>" /> </label></td> </tr> <tr> <th scope="row"> </th> <td><input type="submit" name="Submit" value="Update" /> <input type="hidden" value="<?php echo $PengawasID; ?>" name="PengawasID"> </td> </tr> <tr> <th scope="row"> </th> <td> </td> </tr> <tr> <th scope="row"> </th> <td> </td> </tr> <tr> <th scope="row"> </th> <td> </td> </tr> <tr> <th scope="row"> </th> <td> </td> </tr></table></form><p> </p></body></html>plz i need help!
  14. i 've tried but got error. Then i changed the query SELECT like this $show = "SELECT * FROM pengawas";seems ok.. records appear in the textfield... and something wrong with my update query...not execute it.justsomeguy: Plz check for me... I have been for days but did not make it rightHere is my file : http://www.4shared.com/file/k84RGOQd/sharephp.html
×
×
  • Create New...