Search Results

Search found 6 results on 1 pages for 'shimatun'.

Page 1/1 | 1 

  • the data can't display in the form....

    - by shimaTun
    i wrote code to view data after user fill the form...but the data can't display.... this the code : <?php include "connectioncomplaint.php"; $userid = $_GET['userid']; $secname = $_GET['secname']; $subject = $_GET['subject']; $comment = $_GET['comment']; //Tarik data dari sini $queryDetail = " SELECT * FROM campuscomplaint " . " WHERE userid = '". $userid . "' AND secname = '". secname . "' "; $resultDetail = mysql_query($queryDetail); $detail = mysql_fetch_array($resultDetail); ?> and this code for form: <tr> <td height="400" colspan="7" bgcolor="#FFFFFF"> <table width="67%" align="center" border="1" bordercolor="#ABD519" cellpadding="2" cellspacing="2"> <tr bordercolor="#0000FF" bgcolor="#000033"> <td colspan="2" align="center" valign="top" bgcolor="#ABD519"> --- Complaint Detail --- &nbsp;</td> </tr> <tr bordercolor="#FFFFFF"> <td width="40%" class="register">User ID:</td> <td width="62%" class="register"><?php echo $detail['userid']; ?></td></tr> <tr bordercolor="#FFFFFF"> <td width="40%" class="register">Section Name:</td> <td width="62%" class="register"><?php echo $detail['secname']; ?></td></tr> <tr> <td width="40%" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register">Subject:</td> <td width="62%" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register"><?php echo $detail['subject']; ?></td></tr> <tr> <td width="40%" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register">Comment:</td> <td width="62%" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register"><?php echo $detail['comment']; ?></td></tr> <tr bordercolor="#0000FF" bgcolor="#ABD519"> <td colspan="2" align="center" valign="top">&nbsp;</td> </tr> </table> how to view data from dbase?.... help me...

    Read the article

  • why the data can't dispaly in the form???

    - by shimaTun
    I've created a code to view the data. the data can't display at the form... the code : <?php //======================================================================================================================= PROCESS DATA ======================================================= START. include "connectioncomplaint.php"; ?> <?php $subject = $_GET['type']; $comment = $_GET['id']; //echo 'test : ' . $name; //Tarik data dari sini $queryDetail = " SELECT * FROM campuscomplaint " . " WHERE subject = '" . $subject . "' AND comment = '" . $comment . "' "; //echo 'QUERY DETAIL :' . $queryDetail . '<br>' ; $resultDetail = mysql_query($queryDetail); //echo 'RESULT DETAIL :' . $resultDetail + 0 . '<br>' ; $detail = mysql_fetch_array($resultDetail); //echo $detail . '<br>'; //echo 'detail subject is : ' . $detail['subject'] . '<br>'; //echo 'detail comment is : ' . $detail['comment'] . '<br>'; //echo $detail[$x] . '<br>'; ?> code for form: <tr> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5">From:</td> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><input type="text" name="to" size="40" maxlength="80" value="<?php echo $detail['userid']; ?>"/></td> </tr> <tr> <td width="38%" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5">Subject:</td> <td width="62%" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><input type="text" name="subject" size="40" maxlength="80" value="<?php echo $detail['subject']; ?>"/></td> </tr> <tr> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5">Comment:</td> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><textarea name="comment" rows="5" cols="40"><?php echo $detail['message']; ?></textarea></td> </tr> <tr> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><p>&nbsp;</p> <p>&nbsp;</p></td> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><input type="submit" name="submit" value="Submit Comment" onClick="return OnButton1();"/></td> </tr>

    Read the article

  • change password.......

    - by shimaTun
    I've created a code to change a password. Now it seem contain an error. When I fill in the form to change password, and click save the error message: You forgot enter your userid! Please try again. I really don’t know what the error message means. Please guys. Help me fix it. Here's is the code: <?php # change password.php //set the page title and include the html header. $page_title = 'Change Your Password'; //include('templates/header.inc'); if(isset($_POST['submit'])){//handle the form require_once('connectioncomplaint.php');//connect to the db. //include "connectioncomplaint.php"; //create a function for escaping the data. function escape_data($data){ global $dbc;//need the connection. if(ini_get('magic_quotes_gpc')){ $data=stripslashes($data); } return mysql_real_escape_string($data); }//end function $message=NULL;//create the empty new variable. //check for a username if(empty($_POST['userid'])){ $u=FALSE; $message .='<p> You forgot enter your userid!</p>'; }else{ $u=escape_data($_POST['userid']); } //check for existing password if(empty($_POST['password'])){ $p=FALSE; $message .='<p>You forgot to enter your existing password!</p>'; }else{ $p=escape_data($_POST['password']); } //check for a password and match againts the comfirmed password. if(empty($_POST['password1'])) { $np=FALSE; $message .='<p> you forgot to enter your new password!</p>'; }else{ if($_POST['password1'] == $_POST['password2']){ $np=escape_data($_POST['password1']); }else{ $np=FALSE; $message .='<p> your new password did not match the confirmed new password!</p>'; } } if($u && $p && $np){//if everything's ok. $query="SELECT userid FROM access WHERE (userid='$u' AND password=PASSWORD('$p'))"; $result=@mysql_query($query); $num=mysql_num_rows($result); if($num == 1){ $row=mysql_fetch_array($result, MYSQL_NUM); //make the query $query="UPDATE access SET password=PASSWORD('$np') WHERE userid=$row[0]"; $result=@mysql_query($query);//run the query. if(mysql_affected_rows() == 1) {//if it run ok. //send an email,if desired. echo '<p><b>your password has been changed.</b></p>'; //include('templates/footer.inc');//include the HTML footer. exit();//quit the script. }else{//if it did not run OK. $message= '<p>Your password could not be change due to a system error.We apolpgize for any inconvenience.</p><p>' .mysql_error() .'</p>'; } }else{ $message= '<p> Your username and password do not match our records.</p>'; } mysql_close();//close the database connection. }else{ $message .='<p>Please try again.</p>'; } }//end of the submit conditional. //print the error message if there is one. if(isset($message)){ echo'<font color="red">' , $message, '</font>'; } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

    Read the article

  • why the data can't dispaly in the form???(error-mysql_fetch_array():)

    - by shimaTun
    I've created a code to view the data. Now it seem contain an error. When I run this page this error display: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\e-Complaint(FYP)\userView.php on line 93 the code : <?php //======================================================================================================================= PROCESS DATA ======================================================= START. include "connectioncomplaint.php"; ?> <?php $subject = $_GET['type']; $comment = $_GET['id']; //echo 'test : ' . $name; //Tarik data dari sini $queryDetail = " SELECT * FROM campuscomplaint " . " WHERE subject = '" . $subject . "' AND comment = '" . $comment . "' "; //echo 'QUERY DETAIL :' . $queryDetail . '<br>' ; $resulDetail = mysql_query($queryDetail); //echo 'RESULT DETAIL :' . $resultDetail + 0 . '<br>' ; $detail = mysql_fetch_array($resultDetail); //echo $detail . '<br>'; //echo 'detail subject is : ' . $detail['subject'] . '<br>'; //echo 'detail comment is : ' . $detail['comment'] . '<br>'; //echo $detail[$x] . '<br>'; ?> code for form: <tr> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5">From:</td> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><input type="text" name="to" size="40" maxlength="80" value="<?php echo $detail['userid']; ?>"/></td> </tr> <tr> <td width="38%" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5">Subject:</td> <td width="62%" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><input type="text" name="subject" size="40" maxlength="80" value="<?php echo $detail['subject']; ?>"/></td> </tr> <tr> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5">Comment:</td> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><textarea name="comment" rows="5" cols="40"><?php echo $detail['message']; ?></textarea></td> </tr> <tr> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><p>&nbsp;</p> <p>&nbsp;</p></td> <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><input type="submit" name="submit" value="Submit Comment" onClick="return OnButton1();"/></td> </tr>

    Read the article

  • change password code error.......

    - by shimaTun
    I've created a code to change a password. Now it seem contain an error. When before I fill in the form to change password.the error is: Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\e-Complaint(FYP)\userChangePass.php:7) in C:\Program Files\xampp\htdocs\e-Complaint(FYP)\userChangePass.php on line 126 the code: <?php # userChangePass.php //this page allows logged in user to change their password. $page_title='Change Your Password'; //if no first_name variable exists, redirect the user if(!isset($_SESSION['userid'])){ header("Location: http://" .$_SERVER['HTTP_HOST']. dirname($_SERVER['PHP_SELF'])."/index.php"); ob_end_clean(); exit(); }else{ if(isset($_POST['submit'])) {//handle form. require_once('connectioncomplaint.php'); //connec to the database //check for a new password and match againts the confirmed password. if(eregi ("^[[:alnum:]]{4,20}$", stripslashes(trim($_POST['password1'])))){ if($_POST['password1'] == $_POST['password2']){ $p =escape_data($_POST['password1']); }else{ $p=FALSE; echo'<p><font color="red" size="+1"> Your password did not match the confirmed password!</font></p>'; } }else{ $p=FALSE; echo'<p><font color="red" size="+1"> Please Enter a valid password!</font></p>'; } if($p){ //if everything OK. //make the query $query="UPDATE access SET password=PASSWORD('$p') WHERE userid={$_SESSION['userid']}"; $result=@mysql_query($query);//run the query. if(mysql_affected_rows() == 1) {//if it run ok. //send an email,if desired. echo '<p><b>your password has been changed.</b></p>'; //include('templates/footer.inc');//include the HTML footer. exit(); }else{//if it did not run ok $message= '<p>Your password could not be change due to a system error.We apolpgize for any inconvenience.</p><p>' .mysql_error() .'</p>'; } mysql_close();//close the database connection. }else{//failed the validation test. echo '<p><font color="red" size="+1"> Please try again.</font></p>'; } }//end of the main Submit conditional. } ?> the error at this line:- header("Location: http://" .$_SERVER['HTTP_HOST']. dirname($_SERVER['PHP_SELF'])."/index.php"); please help me guy...

    Read the article

  • change password code error.....

    - by shimaTun
    I've created a code to change a password. Now it seem contain an error.before i fill the form. the page display the error message: Parse error: parse error, unexpected $end in C:\Program Files\xampp\htdocs\e-Complaint(FYP)\userChangePass.php on line 222 this the code: <?php # userChangePass.php //this page allows logged in user to change their password. $page_title='Change Your Password'; //if no first_name variable exists, redirect the user if(!isset($_SESSION['nameuser'])){ header("Location: http://" .$_SERVER['HTTP_HOST']. dirname($_SERVER['PHP_SELF'])."/index.php"); ob_end_clean(); exit(); }else{ if(isset($_POST['submit'])) {//handle form. require_once('connectioncomplaint.php'); //connec to the database //check for a new password and match againts the confirmed password. if(eregi ("^[[:alnum:]]{4,20}$", stripslashes(trim($_POST['password1'])))){ if($_POST['password1'] == $_POST['password2']){ $p =escape_data($_POST['password1']); }else{ $p=FALSE; echo'<p><font color="red" size="+1"> Your password did not match the confirmed password!</font></p>'; } }else{ $p=FALSE; echo'<p><font color="red" size="+1"> Please Enter a valid password!</font></p>'; } if($p){ //if everything OK. //make the query $query="UPDATE access SET password=PASSWORD('$p') WHERE userid={$_SESSION['userid']}"; $result=@mysql_query($query);//run the query. if(mysql_affected_rows() == 1) {//if it run ok. //send an email,if desired. echo '<p><b>your password has been changed.</b></p>'; //include('templates/footer.inc');//include the HTML footer. exit(); }else{//if it did not run ok $message= '<p>Your password could not be change due to a system error.We apolpgize for any inconvenience.</p><p>' .mysql_error() .'</p>'; } mysql_close();//close the database connection. }else{//failed the validation test. echo '<p><font color="red" size="+1"> Please try again.</font></p>'; } }//end of the main Submit conditional. ?> And code for form: <h1>Change Your Password</h1> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <fieldset> <p><b>New Password:</b><input type="password" name="password1" size="20" maxlength="20" /> <small>Use only letters and numbers.Must be between 4 and 20 characters long.</small></p> <p><b>Confirm New Password:</b><input type="password" name="password2" size="20" maxlength="20" /></p> </fieldset> <div align="center"> <input type="submit" name="submit" value="Change My Password" /></div> </form><!--End Form-->

    Read the article

1