Forum Sementara Putera.com

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Forum Sementara Putera.com

Bersama kita perkemaskan forum ini sementara forum asal dalam pemulihan.

Forum putera dah kembali. Masalah sudah berjaya diselesaikan. Sila lawati http://forum.putera.com/tanya


5 posters

    boleh tolong dlm editing gune phpmaker?

    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Wed May 20, 2009 5:23 pm

    saya sedang buat database "jawatankuasa" di sebuah fakulti,

    ada dua table shj,
    1)jwtnkuasa_function, ada 3 fields;

    - jwtnkuasa_id
    - jwtnkuasa_name
    - jwtnkuasa_function

    2)jwtnkuasa_committee, ada 5 fields;

    - jwtnkuasa_id
    - committee_id
    - full_name
    - position_in_committee
    - staff_id

    masalah saye.. nak buat drop down box yang bleh pilih, then click search n keluar just exactly the answer, yg saye buat skang ade prob Sad
    ayoi
    ayoi
    Moderators
    Moderators


    Gender : Male Number of posts : 1090
    Age : 94
    Registration date : 04/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by ayoi Wed May 20, 2009 5:53 pm

    kalau setakat assigment letak code dia kat senang senang user lain test kat mana error tu
    mfaizal2008
    mfaizal2008
    Ahli Baharu
    Ahli Baharu


    Gender : Male Number of posts : 217
    Age : 44
    Location : Cyberjaya
    Job/hobbies : Technician
    Registration date : 01/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by mfaizal2008 Wed May 20, 2009 6:30 pm

    miss_hufflepuff pls PM saya... Sy akan cuba bantu... atau emel: mfaizal@gmail.com
    avatar
    Farlee
    Ahli Baharu
    Ahli Baharu


    Gender : Male Number of posts : 38
    Age : 40
    Location : Kuala Lumpur, Kuala Terengganu (Malaysia)
    Job/hobbies : Looking at Computer
    Registration date : 16/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by Farlee Thu May 21, 2009 4:08 pm

    mcm nk buat laman web je....?

    Blajar koding HTML dulu, baru PHP and finally, SQL. Follow the sequence.
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty ni code asal

    Post by miss_hufflepuff Fri May 22, 2009 12:12 pm

    kt bawah ni coding asal dr php, sy nak tukar text field sebelum search button tu kepada drop down box..ade sesape leh tolong? :

    <html>
    <head>
    <title></title>
    <link href="committee.css" rel="stylesheet" type="text/css" />
    <meta name="generator" content="PHPMaker v5.0.0.2" />
    </head>
    <body>
    <script type="text/javascript">
    <!--
    var EW_DATE_SEPARATOR; // Default date separator
    EW_DATE_SEPARATOR = "/";
    if (EW_DATE_SEPARATOR == '') EW_DATE_SEPARATOR = '/';
    EW_UPLOAD_ALLOWED_FILE_EXT = "gif,jpg,jpeg,bmp,png,doc,xls,pdf,zip"; // Allowed upload file extension
    var EW_FIELD_SEP = ', '; // Default field separator
    var EW_TABLE_CLASSNAME = "ewTable"; // Note: changed the class name as needed

    // Ajax settings
    EW_LOOKUP_FILE_NAME = "ewlookup50.php"; // lookup file name
    EW_ADD_OPTION_FILE_NAME = "ewaddopt50.php"; // add option file name

    // Auto suggest settings
    var EW_AST_SELECT_LIST_ITEM = 0;
    var EW_AST_TEXT_BOX_ID;
    var EW_AST_CANCEL_SUBMIT;
    var EW_AST_OLD_TEXT_BOX_VALUE = "";
    var EW_AST_MAX_NEW_VALUE_LENGTH = 5; // Only get data if value length <= this setting

    // Multipage settings
    var ew_PageIndex = 0;
    var ew_MaxPageIndex = 0;
    var ew_MinPageIndex = 0;
    var ew_MultiPageElements = new Array();

    //-->
    </script>
    <script type="text/javascript" src="ewp50.js"></script>
    <script type="text/javascript" src="userfn50.js"></script>
    <script language="JavaScript" type="text/javascript">
    <!--

    // Write your client script here, no need to add script tags.
    // To include another .js script, use:
    // ew_ClientScriptInclude("my_javascript.js");
    //-->

    </script>

    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
    <!-- header (begin) -->
    <tr class="ewHeaderRow"><!-- *** Note: Only licensed users are allowed to change the logo *** -->
    <td height="50"><img src="phpmkrlogo5.png" alt="" border="0"></td>
    </tr>
    <!-- header (end) -->
    <!-- content (begin) -->
    <tr>
    <td height="100%" valign="top">

    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <!-- left column (begin) -->
    <td valign="top" class="ewMenuColumn">
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr><td><span class="phpmaker"><a href="jwtankuasa_functionlist.php?cmd=resetall">jwtankuasa function</a></span></td></tr>
    <tr><td><span class="phpmaker"><a href="jwtnkuasa_committeelist.php?cmd=resetall">jwtnkuasa committee</a></span></td></tr>
    </table>
    <table height="100%" border="0" cellspacing="0" cellpadding="0">

    <tr><td class="ewMenuColumn"><!-- Area below Left Nav -->&nbsp;</td></tr>
    </table>
    </td>
    <!-- left column (end) -->
    <!-- right column (begin) -->
    <td valign="top" class="ewContentColumn">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr><td><span class="phpmaker"><b></b></span></td></tr>
    </table>
    <script type="text/javascript">
    <!--
    var EW_PAGE_ID = "list"; // Page id

    //-->
    </script>
    <script type="text/javascript">
    <!--
    var firstrowoffset = 1; // First data row start at
    var lastrowoffset = 0; // Last data row end at
    var EW_LIST_TABLE_NAME = 'ewlistmain'; // Table name for list page
    var rowclass = 'ewTableRow'; // Row class
    var rowaltclass = 'ewTableAltRow'; // Row alternate class
    var rowmoverclass = 'ewTableHighlightRow'; // Row mouse over class
    var rowselectedclass = 'ewTableSelectRow'; // Row selected class
    var roweditclass = 'ewTableEditRow'; // Row edit class

    //-->

    </script>
    <script type="text/javascript">
    <!--

    // js for DHtml Editor
    //-->

    </script>
    <script type="text/javascript">
    <!--

    // js for Popup Calendar
    //-->

    </script>
    <script language="JavaScript" type="text/javascript">
    <!--

    // Write your client script here, no need to add script tags.
    // To include another .js script, use:
    // ew_ClientScriptInclude("my_javascript.js");
    //-->

    </script>
    <p><span class="phpmaker" style="white-space: nowrap;">TABLE: jwtankuasa function
    </span></p>
    <form name="fjwtankuasa_functionlistsrch" id="fjwtankuasa_functionlistsrch" action="jwtankuasa_functionlist.php" >
    <table class="ewBasicSearch">
    <tr>
    <td><span class="phpmaker">
    <input type="text" name="psearch" id="psearch" size="20" value="">

    <input type="Submit" name="Submit" id="Submit" value="Search (*)">&nbsp;
    <a href="jwtankuasa_functionlist.php?cmd=reset">Show all</a>&nbsp;
    </span></td>
    </tr>
    <tr>
    <td><span class="phpmaker"><input type="radio" name="psearchtype" id="psearchtype" value="" checked>Exact phrase&nbsp;&nbsp;<input type="radio" name="psearchtype" id="psearchtype" value="AND" >All words&nbsp;&nbsp;<input type="radio" name="psearchtype" id="psearchtype" value="OR" >Any word</span></td>
    </tr>

    </table>
    </form>
    <form method="post" name="fjwtankuasa_functionlist" id="fjwtankuasa_functionlist">
    <table>
    <tr><td><span class="phpmaker">
    <a href="jwtankuasa_functionadd.php">Add</a>&nbsp;&nbsp;
    </span></td></tr>
    </table>
    <table id="ewlistmain" class="ewTable">
    <!-- Table header -->
    <tr class="ewTableHeader">
    <td valign="top">

    <a href="jwtankuasa_functionlist.php?order=function&ordertype=ASC">function&nbsp;(*)</a>
    </td>
    <td valign="top">
    <a href="jwtankuasa_functionlist.php?order=jwtnkuasa_name&ordertype=ASC">jwtnkuasa name&nbsp;(*)</a>
    </td>
    <td nowrap>&nbsp;</td>
    <td nowrap>&nbsp;</td>
    <td nowrap>&nbsp;</td>

    <td nowrap>&nbsp;</td>
    </tr>

    <!-- footer (begin) -->
    <tr>
    <td>

    <table width="100%" border="0" cellspacing="0" cellpadding="4">
    <tr class="ewFooterRow">
    <td>&nbsp;<!-- *** Note: Only licensed users are allowed to remove or change the following copyright statement. *** -->
    <font class="ewFooterText">&copy;2008 e.World Technology Ltd. All rights reserved.</font>
    <!-- Place other links, for example, disclaimer, here -->
    </td>
    </tr>
    </table>
    </td>

    </tr>
    <!-- footer (end) -->
    </table>
    <script language="JavaScript" type="text/javascript">
    <!--

    // Write your global startup script here
    // document.write("page loaded");
    //-->

    </script>
    </body>
    </html>
    Laughing Laughing
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty ermmm

    Post by miss_hufflepuff Fri May 22, 2009 5:33 pm

    saya mmg dr dlu coding sya bermasalah time nk bukak kt browser, php file la yg tak leh bukak direct, slalu mesti kuar pop up tanye nak bukak gune pe.. pilih gune browser tp still tak leh bukak,ni sy bg satu contoh coding sy dlu..


    Code:
    <?php
    include_once("session.php");
    $db_name ="db";
    $table_name = "student";


    $connection = @mysql_connect("localhost","root","") or die (mysql_error());

    $db = @mysql_select_db ($db_name, $connection) or die (mysql_error());

    $sql = "SELECT student_id, student_name FROM $table_name";

    $result = @mysql_query($sql, $connection) or die (mysql_error());

    while($row = mysql_fetch_array ($result))
    {
       $id=$row['student_id'];
       $name=$row['student_name'];
       
       $display.="<tr><td><a href = view_all_detail.php ? id=$id>$id</a></td><td>$name</td></tr>";
    }
    mysql_close($connection);
    ?>

    <html>
    <head>
    <title>View All</title>
    </head>
    <body>
    <table border = 1>
    <?php echo "$display"; ?>
    </table>
    <p><a href="menu_sample.php">back</a></p>
    </body>
    </html>

    suppose tade prob ngan coding kan? ke ader??
    ayoi
    ayoi
    Moderators
    Moderators


    Gender : Male Number of posts : 1090
    Age : 94
    Registration date : 04/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by ayoi Fri May 22, 2009 6:56 pm

    huhu biasa la ni kalau guna sample code musti ada funtion tak betul...

    takpe nanti member putera tolong.


    ** dah lama tak guna php.. dah lupa daratan.

    *Go for java.. hehehe...
    johnburn
    johnburn
    Moderators
    Moderators


    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by johnburn Fri May 22, 2009 11:04 pm

    miss_hufflepuff wrote:kt bawah ni coding asal dr php, sy nak tukar text field sebelum search button tu kepada drop down box..ade sesape leh tolong?

    Drop down box bkn bleh wat gini je ke?
    Code:

    <select>
    <option>text</option>
    <option>text</option>
    <option>text</option>
    <option>text</option>
    </select>

    miss_hufflepuff wrote:saya mmg dr dlu coding sya bermasalah time nk bukak kt browser, php file la yg tak leh bukak direct, slalu mesti kuar pop up tanye nak bukak gune pe.. pilih gune browser tp still tak leh bukak,ni sy bg satu contoh coding sy dlu..

    ape mksud xleh bkak tu? xbleh excute ke? php ni server side script so kne excute kat server. bleh try pkai xampp atau wamp sbb die bundle skali ngan server apache.

    ayoi wrote:huhu biasa la ni kalau guna sample code musti ada funtion tak betul...

    takpe nanti member putera tolong.


    ** dah lama tak guna php.. dah lupa daratan.

    *Go for java.. hehehe...
    so why bother replying?
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Sun May 24, 2009 12:13 am

    ayoi wrote:huhu biasa la ni kalau guna sample code musti ada funtion tak betul...

    takpe nanti member putera tolong.


    ** dah lama tak guna php.. dah lupa daratan.

    *Go for java.. hehehe...

    php pun bru lagik gune, blaja java penah blaja tp tak brape... hehe..
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Sun May 24, 2009 12:16 am

    johnburn wrote:
    miss_hufflepuff wrote:kt bawah ni coding asal dr php, sy nak tukar text field sebelum search button tu kepada drop down box..ade sesape leh tolong?

    Drop down box bkn bleh wat gini je ke?
    Code:

    <select>
    <option>text</option>
    <option>text</option>
    <option>text</option>
    <option>text</option>
    </select>

    miss_hufflepuff wrote:saya mmg dr dlu coding sya bermasalah time nk bukak kt browser, php file la yg tak leh bukak direct, slalu mesti kuar pop up tanye nak bukak gune pe.. pilih gune browser tp still tak leh bukak,ni sy bg satu contoh coding sy dlu..

    ape mksud xleh bkak tu? xbleh excute ke? php ni server side script so kne excute kat server. bleh try pkai xampp atau wamp sbb die bundle skali ngan server apache.

    ayoi wrote:huhu biasa la ni kalau guna sample code musti ada funtion tak betul...

    takpe nanti member putera tolong.


    ** dah lama tak guna php.. dah lupa daratan.

    *Go for java.. hehehe...
    so why bother replying?

    saya mmg gune xampp, dlu mase blaja gune wamp, suppose same je tade masalah, dlu ok leh execute, but now tatau la..
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Sun May 24, 2009 12:23 am

    johnburn.. ye saye wat mcm tu.. maksud sy php nye.. sori saya mmg kureng sket php, sy penah wat dlu satu db lebey kuang mcm ni, but no drop down la, tp skang ble try blik tak leh pule hehe, takpela sy try masukkan contoh coding tu nanti kt sini, nak mintak sape2 yg pandai tolong tgkkan pe yg silap eh..
    johnburn
    johnburn
    Moderators
    Moderators


    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by johnburn Sun May 24, 2009 7:55 am

    Kl sertakan skali ngan script die lg mudah nk tgk.
    Jugak bg detail skit nk bt ape.
    Dropdown tu untk ape, nk soh die jd cmne sume la.
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Mon May 25, 2009 11:54 am

    nak mintak tolong tgkkan all these codes eh.. tak tau nape tak leh execute bile try bukak di browser, dah gune xampp,ni pasal db student..dlu penah wat ni, menjadi i mean leh execute kt browser, skang cube tak leh lak.. sy nak jdkan ni contoh tuk wat db jawatankuasa sy tu, application nyer lebeh kuang jer,nk bg yg tu mcm byk sgt.. kang korang pening lak hehe.. syukran, nandre, arigato, shesheni, time kasih..


    ni table login_sample.php
    Code:
    <?
    if((!$_POST['un']) || (!$_POST['pass']))
    {
       header("Location: file:///C:/Program%20Files/xampp/htdocs/cikziziannyercontoh/login_sample.html");
       exit;
    }

    $db_name = "db";
    $table_name = "login";
    $connection = @mysql_connect("localhost", "root", "") or die (mysql_error());

    $db = @mysql_select_db($db_name, $conncection) or die (mysql_error());
    $sql = "SELECT * FROM WHERE $table_name WHERE username = '$_POST[un]' AND password = '$_POST[pass]'";
    $result = @mysql_query($sql, $connection) or die (mysql_error());
    $num = @mysql_num_rows($result);

    mysql_close($connection);

    if($num != 0)
    {
       session_start();
       session_register('valid');
       $_SESSION[valid] = "yes";
       
       header("Location: menu_sample.php");
       exit;
    }
    else
       $msg ="<p>PLEASE TRY AGAIN!</p>";
    ?>

    <html>
    <head>
    <title>login_sample</title>
    </head>
    <body>
    <?php echo "$msg";
    ?>
    </body>
    </html>


    ni table login_sample.html
    Code:
    <html>
    <head>
    <title>Login form</title>
    </head>

    <body bgcolor="#FF9966">
    <center>
    <form method = "post" action="login_sample.php">
    <h1>User Name : &nbsp;&nbsp;
      <input type = "text" name = "un">
      <br>
      Password  : &nbsp;&nbsp;&nbsp;&nbsp;
      <input type = "password" name = "pass"><br>
      <input type = "Submit" name = "b_login" value = "LOGIN">&nbsp;&nbsp;&nbsp;
      <input type = "reset" name = "b_reset" value = "RESET">

    </h1>
    </center>
    </form>
    </body>
    </html>

    ni table insert_sample.html
    Code:
    <html>
    <head>
    <title>Insertion form</title>
    </head>

    <body>
    <form method = "post" action = "insert.php">
    <table border = "1">
       <tr>
        <td>ID</td>
        <td><input type ="text" name ="id"></td>
       </tr>
       
       <tr>
        <td>Name</td>
        <td><input type = "text" name = "nama">&nbsp;</td>
       </tr>
    </table>
    <input type = "submit" name = "subtn" value = "Add">
    <input type = "reset" name = "rebtn" value = "Reset">

    </form>
    </body>
    </html>

    ni insert.php
    Code:
    <?php
    include_once("session.php");

    $db_name = "db";
    $table_name = "student";

    $connection = @mysql_connect("localhost", "root", "") or die (mysql_error());
    $db = @mysql_select_db($db_name, $connection) or die (mysql_error());
    $sql = "INSERT INTO $table_name(student_id, student_name)";
    VALUES('$_POST[id]','$_POST[nama]');
    $result = @mysql_query($sql,$connection) or die (mysql_error());

    mysql_close($connection);
    ?>

    <html>
    <head>
    </head>
    <body>
    <table border = "1">
     <tr>
       <td>ID</td>
       <td><?php echo "$_POST[id]"; ?></td>
     </tr>
     <tr>
       <td>Name</td>
       <td><?php echo "$_POST[nama]"; ?></td>
     </tr>
    </table>
    <P> <a href = "menu_sample.php">back</a></P>
    </body>
    </html>

    ni table menu_sample.php

    Code:
    <?php
    include_once("session.php");
    //session_start();
    //if($_SESSION['valid'] ! = "yes")
    //{
    //   header("Location: login_sample.html");
    //   exit;
    //}
    ?>

    <html>
    <head>
    <title>Untitled Document</title>
    <body>
    <h1>MENU</h1>
    <ul>
    <li><a href = "insert_sample.html">INSERT</a></li>
    <li><a href = "view_all.php">VIEW</a></li>
    <li><a href = "view_all_update.php">UPDATE</a></li>
    <li><a href = "view_all_delete.php">DELETE</a></li>
    </ul>
    <a href = logout.php>logout</a>
    </body>
    </html>

    ni table view.php

    Code:
    <?php
    include_once("session.php");
    $db_name ="db";
    $table_name = "student";


    $connection = @mysql_connect("localhost","root","") or die (mysql_error());

    $db = @mysql_select_db ($db_name, $connection) or die (mysql_error());

    $sql = "SELECT student_id, student_name FROM $table_name";

    $result = @mysql_query($sql, $connection) or die (mysql_error());

    while($row = mysql_fetch_array ($result))
    {
       $id=$row['student_id'];
       $name=$row['student_name'];
       
       $display.="<tr><td><a href = view_all_detail.php ? id=$id>$id</a></td><td>$name</td></tr>";
    }
    mysql_close($connection);
    ?>

    <html>
    <head>
    <title>View All</title>
    </head>
    <body>
    <table border = 1>
    <?php echo "$display"; ?>
    </table>
    <p><a href="menu_sample.php">back</a></p>
    </body>
    </html>

    ni table view_all_detail.php (kt sini sy ingat nak apply drop down box, maknenye, kite pilih nama student atau id student tu n then dia akan kuarkan infonye, contoh kite pilih id n dia kuar nama or vice versa la..just nak kan gambaran basic, maybe dr sini sy leh teruskan tuk database jawatankuasa saye)

    Code:
    <?php
    include once("session.php");
    $db_name = "db";
    $table_name = "student";

    $connection = @mysql_connect("localhost", "root", "") or die (mysql_error());

    $db = @mysql_select_db($db_name, $connection) or die (mysql_error());

    $id = $_GET[id];

    $sql = "SELECT * FROM $table_name WHERE student_id = '$id'";

    $result = @mysql_query($sql, $connection) or die (mysql_error());

    while($row = mysql_fetch_array($result))
    {
       $id = $row['student_id'];
       $name = $row['student_name'];

    }

    $display .= "<TABLE BORDER = 1><tr><th>ID</th><th>NAME</th></tr><tr><td>$id</td><td>$name</td></tr></TABLE>";
    mysql_close($connection);
    ?>

    <html>
    <head>
    <title>View details</title>
    </head>
    <body>
    <?php echo "$display"; ?>
    </TABLE>
    <P> <a href = "view_all.php">back </a></P>
    </body>
    </html>

    ni table view_all_update.php
    Code:
    <?php
    include once("session.php");


    $db_name = "db";
    $table_name = "student";

    $connection = @mysql_connect("localhost", "root", "") or die (mysql_error());

    $db = @mysql_select_db($db_name, $connection) or die (mysql_error());


    $sql = "SELECT student_id, student_name FROM $table_name";

    $result = @mysql_query($sql, $connection) or die (mysql_error());

    while($row = mysql_fetch_array($result))
    {
       $id = $row['student_id'];
       $name = $row['student_name';

       $display .= "<tr><td><a href = view_detail_update.php?id=$id>$id</a></td><td>$name</td></tr>";

    }

    mysql_close($connection);
    ?>

    <html>
    <head>
    <title>Untitled Document</title>
    </head>
    <body>

    <TABLE BORDER =1>

    <?php echo "$display"; ?>

    </TABLE>

    <P> <a href = "menu_sample.php">back </a></P>
    </body>
    </html>

    ni table view_detail_delete.php

    Code:
    <?php
    include once("session.php");


    $db_name = "db";
    $table_name = "student";

    $connection = @mysql_connect("localhost", "root", "") or die (mysql_error());

    $db = @mysql_select_db($db_name, $connection) or die (mysql_error());

    $id = $_GET[id];

    $sql = "SELECT * FROM $table_name WHERE student_id = '$id'";

    $result = @mysql_query($sql, $connection) or die (mysql_error());

    while($row = mysql_fetch_array($result))
    {
       $id = $row['student_id'];
       $name = $row['student_name'];

    }

    $display .="<form method = \"post\"action = \"delete_record.php?id=$id\"><TABLE BORDER = 1><tr><td>ID : </td><td> $id </td></tr> <tr><td>NAME : </td> <td>$name</td></tr></TABLE><br> <input type = \"Submit\" value=\"DELETE\"></form>";
    mysql_close($connection);
    ?>

    <html>
    <head>
    <title>Untitiled Document</title>
    </head>
    <body>
    <?php echo "$display"; ?>
    </TABLE>
    <P> <a href = "view_all_update.php">back </a></P>
    </body>
    </html>

    ni table view_detail_update.php

    Code:
    <?php
    include once("session.php");


    $db_name = "db";
    $table_name = "student";

    $connection = @mysql_connect("localhost", "root", "") or die (mysql_error());

    $db = @mysql_select_db($db_name, $connection) or die (mysql_error());

    $id = $_GET[id];

    $sql = "SELECT * FROM $table_name WHERE student_id = '$id'";

    $result = @mysql_query($sql, $connection) or die (mysql_error());

    while($row = mysql_fetch_array($result))
    {
       $id = $row['student_id'];
       $name = $row['student_name';
    }

    $display .= "<form method = \"post\"action=\"update_record.php?id=$id\"><TABLE BORDER =1><tr><td>ID : </td><td>$id</td></tr><tr><td>NAME : </td><td><input type = \"text\"name =\"nama\"value =\"$name\"></td></tr></TABLE><br><input type = \"Submit\" value = \"UPDATE\"></form>";

    mysql_close($connection);
    ?>

    <html>
    <head>
    <title>Untitled Document</title>
    </head>
    <body>


    <?php echo "$display"; ?>

    <P> <a href = "view_all_update.php">back </a></P>
    </body>
    </html>

    ni table view_all_delete.php

    Code:
    <?php
    include once("session.php");
    $db_name = "db";

    $table_name = "student";

    $connection = @mysql_connect("localhost", "root", "") or die (mysql_error());

    $db = @mysql_select_db($db_name, $connection) or die (mysql_error());

    $sql = "SELECT student_id, student_name FROM $table_name";

    $result = @mysql_query($sql, $connection) or die (mysql_error());

    while($row = mysql_fetch_array($result))
    {
       $id = $row['student_id'];
       $name = $row['student_name'];

       $display .= "<tr><td><a href = view_detail_delete.php?id=$id>$id</a></td><td>$name</td></tr>";
    }
    mysql_close($connection);
    ?>

    <html>
    <head>
    <title>View details</title>
    </head>


    <body>

    <TABLE BORDER = 1>
    <?php echo "$display"; ?>
    </TABLE>


    <P> <a href = "menu.php">back </a></P>
    </body>
    </html>

    ni table update_record.php

    Code:
    <?php
    include once("session.php");


    $db_name = "db";
    $table_name = "student";

    $connection = @mysql_connect("localhost", "root", "") or die (mysql_error());

    $db = @mysql_select_db($db_name, $connection) or die (mysql_error());

    $id = $_GET[id];

    $sql = "UPDATE $table_name SET student_name = '$_POST[nama]' WHERE student_id = '$id'";

    $result = @mysql_query($sql, $connection) or die (mysql_error());

    echo "the record has been updated!<a href = \"view_all.php\">view again</a>">;

    ?>

    ni table delete_record.php

    Code:
    <?php
    include once("session.php");


    $db_name = "db";
    $table_name = "student";

    $connection = @mysql_connect("localhost", "root", "") or die (mysql_error());

    $db = @mysql_select_db($db_name, $connection) or die (mysql_error());

    $id = $_GET[id];

    $sql = "DELETE FROM $table_name WHERE student_id = '$id'";

    $result = @mysql_query($sql, $connection) or die (mysql_error());

    mysql_close($connection);
    ?>

    <html>
    <head>
    <title>Deleting</title>
    </head>
    <body>
    <P><? echo "$id"; ?> has been deleted!</P>
    <P> <a href = "view_all_delete.php">back </a></P>
    </body>
    </html>

    ni table session.php
    Code:
    <?php
    session_start();
    if($_SESSION['valid'] ! = "yes")
    {
       header("Location : login_sample.html");
       exit;
    }
    ?>

    ni table tes_sql.php

    Code:
    <?php

       $db_name = "db";
       $table_name = "student";

       $connection = @mysql_connect("localhost", "azizia", "aaa");// or die (mysql_error());

       if($conn==false)
       {
          echo "<br>database error";
          die("<br>Mysql error:".mysql_error());
       }

       $db = @mysql_select_db($dbname, $conn) or die (mysql_error());

       $sql = "SELECT * FROM $table_name";

       $rst = @mysql_query($sql, $conn) or die (mysql_error());

       $num = @mysql_num_rows($rst);

       $out = "";

       while($row=mysql_fetch_array($rst))
       {
       $id = $row["student_id"];
       $name = $row["student_name"];

       $out.="<br>$id &nbsp&nbsp&nbsp $name";

       }
       mysql_close($conn);
    ?>

    <html>
    <head>
    <h5>ID &nbsp&nbsp&nbsp NAME<h5>

    <?php echo "$out";?>
    </body>
    </html>

    ni table logout.php

    Code:
    <?php

       $db_name = "db";
       $table_name = "student";

       $connection = @mysql_connect("localhost", "azizia", "aaa");// or die (mysql_error());

       if($conn==false)
       {
          echo "<br>database error";
          die("<br>Mysql error:".mysql_error());
       }

       $db = @mysql_select_db($dbname, $conn) or die (mysql_error());

       $sql = "SELECT * FROM $table_name";

       $rst = @mysql_query($sql, $conn) or die (mysql_error());

       $num = @mysql_num_rows($rst);

       $out = "";

       while($row=mysql_fetch_array($rst))
       {
       $id = $row["student_id"];
       $name = $row["student_name"];

       $out.="<br>$id &nbsp&nbsp&nbsp $name";

       }
       mysql_close($conn);
    ?>

    <html>
    <head>
    <h5>ID &nbsp&nbsp&nbsp NAME<h5>

    <?php echo "$out";?>
    </body>
    </html>
    johnburn
    johnburn
    Moderators
    Moderators


    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by johnburn Mon May 25, 2009 4:22 pm

    Xpham ape mslh
    Ade kuar ape2 error ke?
    Kl ade screenshot lg ok
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Mon May 25, 2009 5:03 pm

    johnburn wrote:Xpham ape mslh
    Ade kuar ape2 error ke?
    Kl ade screenshot lg ok

    mcm ni, ok bile saya log in kan gune form tu, then dia trus kuar pop up suh saye bukak fail php tu gune browser or gune program lain.. em tu nape jd cmtu..bile saya pilih firefox or ie sekalipun, dia still x mo display kt browser... ape yg silap eh
    johnburn
    johnburn
    Moderators
    Moderators


    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by johnburn Mon May 25, 2009 5:47 pm

    Dh pastikan ke file2 tu sume dok dlm directory yg btol (xampp\htdocs)?
    Bleh bukak start page xampp x? (http://localhost/xampp)
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Tue May 26, 2009 9:46 am

    johnburn wrote:Dh pastikan ke file2 tu sume dok dlm directory yg btol (xampp\htdocs)?
    Bleh bukak start page xampp x? (http://localhost/xampp)

    dah saya mmg letak dlm tu, n da bukak xampp and database dia skalik..
    mfaizal2008
    mfaizal2008
    Ahli Baharu
    Ahli Baharu


    Gender : Male Number of posts : 217
    Age : 44
    Location : Cyberjaya
    Job/hobbies : Technician
    Registration date : 01/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by mfaizal2008 Tue May 26, 2009 9:56 am

    pastikan IIS Server STOP dulu sebelum run Apache Server, IIS Server berkongsi Port yg sama dgn Apache Server...
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Tue May 26, 2009 9:58 am

    mfaizal2008 wrote:pastikan IIS Server STOP dulu sebelum run Apache Server, IIS Server berkongsi Port yg sama dgn Apache Server...

    bleh bg detail lagi cane nak wat? sy ingat ade prob ngan coding sbb kalu run coding yg phpmaker wat no prob leh bukak je php file tu kt browser...
    mfaizal2008
    mfaizal2008
    Ahli Baharu
    Ahli Baharu


    Gender : Male Number of posts : 217
    Age : 44
    Location : Cyberjaya
    Job/hobbies : Technician
    Registration date : 01/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by mfaizal2008 Tue May 26, 2009 10:01 am

    mula-2 pergi Start Menu -> Control Panel -> Administrator Tools -> cari IIS Server, masuk kat dlm dia... kat tree view tu, sampai butang STOP kat menu atas keluar, pastu STOP... Kalo xde IIS server terpasang, cuba STOP dulu APACHE Server melalui XAMPP Control Panel pastu RESTART semula... Tgk jika ada sebarang error keluar...
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Tue May 26, 2009 10:11 am

    mfaizal2008 wrote:mula-2 pergi Start Menu -> Control Panel -> Administrator Tools -> cari IIS Server, masuk kat dlm dia... kat tree view tu, sampai butang STOP kat menu atas keluar, pastu STOP... Kalo xde IIS server terpasang, cuba STOP dulu APACHE Server melalui XAMPP Control Panel pastu RESTART semula... Tgk jika ada sebarang error keluar...

    yg first da wat, yg secong pun dah.. takde gak IIS server.. cane eh.. sori..
    mfaizal2008
    mfaizal2008
    Ahli Baharu
    Ahli Baharu


    Gender : Male Number of posts : 217
    Age : 44
    Location : Cyberjaya
    Job/hobbies : Technician
    Registration date : 01/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by mfaizal2008 Tue May 26, 2009 10:16 am

    em maknanya x pasang IIS la komp tu, pelik gak: cuba masuk http://localhost, apa yg keluar?
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Tue May 26, 2009 10:21 am

    mfaizal2008 wrote:em maknanya x pasang IIS la komp tu, pelik gak: cuba masuk http://localhost, apa yg keluar?

    http://localhost erm kuar la sy nye username n password needed, then login masuk nampak xampp..cane nak pasang IIS? bukan skali dtg ngan xampp ke?
    mfaizal2008
    mfaizal2008
    Ahli Baharu
    Ahli Baharu


    Gender : Male Number of posts : 217
    Age : 44
    Location : Cyberjaya
    Job/hobbies : Technician
    Registration date : 01/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by mfaizal2008 Tue May 26, 2009 10:30 am

    OK IIS tu mcm Apache gak, web server, tp IIS ni sedia terpasang dlm Windows XP Pro dgn Vista Ultimate... So Apache dgn IIS ni xleh jalan serentak, sbb berkongsi port, so kalo IIS tgh running, Apache x leh la run... Maknanya IIS kenalah stop... Baru Apache leh run... So td bila awk dpt masuk XAMPP, maknanya Apache awk ok, cuma mungkin masalah page awk, check balik nama folder awk sumbat web page PHP awk tu... pastu check page Index.php tu ada syntax error atau tak...
    avatar
    miss_hufflepuff
    Ahli Baharu
    Ahli Baharu


    Number of posts : 25
    Age : 38
    Registration date : 27/03/2009

    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by miss_hufflepuff Tue May 26, 2009 10:39 am

    mfaizal2008 wrote:OK IIS tu mcm Apache gak, web server, tp IIS ni sedia terpasang dlm Windows XP Pro dgn Vista Ultimate... So Apache dgn IIS ni xleh jalan serentak, sbb berkongsi port, so kalo IIS tgh running, Apache x leh la run... Maknanya IIS kenalah stop... Baru Apache leh run... So td bila awk dpt masuk XAMPP, maknanya Apache awk ok, cuma mungkin masalah page awk, check balik nama folder awk sumbat web page PHP awk tu... pastu check page Index.php tu ada syntax error atau tak...

    hurm pening gak neh, folder ok dah.. mmg kene taruk kt xampp/htdocs kan.. pastu index.php pon rasenye ok sbb bile saye tulis kt browser http://localhost/committee(nama fail sy sumbat coding2 sy)/index.php, akan kuar page yg betul sepatutnyer kuar.. ni contoh index.php, bile execute dia akan display page jwtankuasa_functionlist.php tula..

    Code:
    <?php
    define("EW_PAGE_ID", "index", TRUE); // Page ID
    ?>
    <?php
    session_start(); // Initialize session data
    ob_start(); // Turn on output buffering
    ?>
    <?php include "ewcfg50.php" ?>
    <?php include "ewmysql50.php" ?>
    <?php include "phpfn50.php" ?>
    <?php include "jwtnkuasa_committeeinfo.php" ?>
    <?php include "userfn50.php" ?>
    <?php
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
    header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache"); // HTTP/1.0
    ?>
    <?php

    // Open connection to the database
    $conn = ew_Connect();
    ?>
    <?php

    // Common page loading event (in userfn*.php)
    Page_Loading();
    ?>
    <?php
    Page_Terminate("jwtankuasa_functionlist.php"); // Exit and go to default page
    ?>
    <?php

    // If control is passed here, simply terminate the page without redirect
    Page_Terminate();

    // -----------------------------------------------------------------
    //  Subroutine Page_Terminate
    //  - called when exit page
    //  - clean up connection and objects
    //  - if url specified, redirect to url, otherwise end response
    function Page_Terminate($url = "") {
       global $conn;

       // Global page unloaded event (in userfn*.php)
       Page_Unloaded();

        // Close Connection
       $conn->Close();

       // Go to url if specified
       if ($url <> "") {
          ob_end_clean();
          header("Location: $url");
       }
       exit();
    }
    ?>
    <?php
    ?>

    Sponsored content


    boleh tolong dlm editing gune phpmaker? Empty Re: boleh tolong dlm editing gune phpmaker?

    Post by Sponsored content


      Current date/time is Mon Nov 18, 2024 7:39 am