PRoblem in Delete

Thread Solved

Join Date: Sep 2009
Posts: 539
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 63
network18 network18 is offline Offline
Posting Pro
 
-1
  #11
30 Days Ago
Originally Posted by manishmannan View Post
whenever i am working on local host it work fine but after uploading file on internet
this script not deleting any records
what do i do????
so what error you getting on the server?
Again you including the login.html and using <?php echo $user; ?> in the script, $user gets set in the html file??
check with this or post your login.html too here
Last edited by network18; 30 Days Ago at 3:08 am.
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 44
Reputation: manishmannan is an unknown quantity at this point 
Solved Threads: 2
manishmannan manishmannan is offline Offline
Light Poster
 
0
  #12
30 Days Ago
thanks but my problem is not solve
Last edited by manishmannan; 30 Days Ago at 8:29 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 44
Reputation: manishmannan is an unknown quantity at this point 
Solved Threads: 2
manishmannan manishmannan is offline Offline
Light Poster
 
0
  #13
30 Days Ago
is there any change needed in php.ini file to delete records from the database if it happen thn plz tell me
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 44
Reputation: manishmannan is an unknown quantity at this point 
Solved Threads: 2
manishmannan manishmannan is offline Offline
Light Poster
 
0
  #14
30 Days Ago
Login.HTML
<html>
<head>
<script language="JavaScript" type="text/javascript">
function validate()
{
if (document.frm1.txtuser.value == '')
{
alert('Please fill a UserName!');
return false;
}
if (document.frm1.txtpass.value == '')
{
alert('Please fill in Password!');
return false;
}
return true;
}

</script>
<style>
body {
font-family:Arial, Helvetica, sans-serif;
background:#FFFFF0;
font-size:12px;
color:#000000;
}
.logout {
cursor:pointer;
background:#FFFF00;
border:#FF6600 1px solid;
width:100px;
height:30px;
font-size:14px;
font-weight:bold;
color:#FF6600;
float:right;
text-decoration:none;
font-family:Arial;
font-size:14px;
line-height:30px;
margin:50px 50px 0px 0px;
text-align:center;
}
h1 {
font-family:Arial, Helvetica, sans-serif;
font-size:20px;
color: #FF6600;
text-align:center;
margin:50px auto 0px auto;
font-weight:500;
}
.head {
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
color: #000;
text-align:center;
font-weight:bold;
}
.form {
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#666666;
line-height:18px;
background:#FBFBFB;
width:100%;
padding:20px;
border:#FFCC00 2px solid;
font-weight:bold;
}
.lable {
margin-left:100px;
}
.btn {
cursor:pointer;
background:#E0E0E0;
border:#000 1px solid;
width:100px;
height:30px;
font-size:14px;
font-weight:bold;
color:#000;
float:left;
margin-left:20px;
}
</style>
<title>Admin Login</title><body>
<form name= "frm1" method= "post" action="login.php" >
<h1 align="center" class="style1">ADMIN PANEL </h1>
<br>
<br>
<table width="354" height="166" border="1" align="center" cellspacing="0" bordercolor="#FF9900" bgcolor="#FBFBFB" class="head">
<tr>
<th height="23" colspan="2" bgcolor="#FFCC00">LOG IN </th>
</tr>
<tr>
<td width="83" height="40"> User</td>
<td width="261" height="40"><input type="text" name="txtuser" /></td>
</tr>
<tr>
<td height="40">Password</td>
<td height="40"><input type="password" name="txtpass" /></td>
</tr>
<tr>
<td height="40">&nbsp;</td>
<td height="40"><input type="submit" name="submit" value="login" class="btn"/></td>
</tr>
</table>
</form>
<center><a href="forget.php" target="_self">Foget Username or Password </a><br>
<a href="change.php" target="_self">Change Password</a>
</center>
</body>
</html>
NOW Login.php
<?php

$host="localhost"; // Host name

$username="root"; // Mysql username

$password=""; // Mysql password

$db_name="hnit"; // Database name

$tbl_name="login"; // Table name



// Connect to server and select databse.

mysql_connect("$host", "$username", "$password")or die("cannot connect");

mysql_select_db("$db_name")or die("cannot select DB");
// username and password sent from signup form

$myusername= $_POST['txtuser'];

$mypassword= $_POST['txtpass'];

$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";

$result=mysql_query($sql);


// Mysql_num_row is counting table row

$count=mysql_num_rows($result);

//echo"$count";

// If result matched $myusername and $mypassword, table row must be 1 row



if($count==1){

// Register $myusername, $mypassword and redirect to file "login_success.php"

session_start ();



$_SESSION['myusername'] = $_POST['txtuser'];

$_SESSION['myusername'];

$_SESSION['mypassword'] = $_POST['txtpass'];

//$_SESSION['id'] = $ror[id];



session_write_close ();



header ( 'location: task.php' );



exit ();

}

else {
echo'<center><b>Wrong Username or Password</b></center>';

}

?>
<style>
body {
font-family:Arial, Helvetica, sans-serif;
color:#ff0000;
font-size:16px;
font-weight:bold;
background:#FFFFF0;
padding:50px;
}
#holder {
width:502px;
height:164px;
margin:50px auto 0px auto;
background:#FFFFCC;
border:#FFCC00 1px solid;
}
#link {
width:500px;
position:relative;
float:left;
background: #FFFFCC;
text-align:center;
border:#FFCC00 1px solid;
}
#link a {
color:#000;
padding:10px;
text-decoration:none;
display:block
}
#link a:hover {
color:#ff0000;
text-decoration:none;
background:#FFCC00;
}
#link a:visited {
color:#000;
text-decoration:none;
}
#link a:active {
color:#000;
text-decoration:none;
}
h1 {
font:bold Arial, Helvetica, sans-serif 14px;
color: #FF6600;
text-align:center;
margin:50px auto 0px auto;
}
#logout {
cursor:pointer;
background:#FFFF00;
border:#FF6600 1px solid;
width:100px;
height:30px;
font-size:14px;
font-weight:bold;
color:#FF6600;
float:right;
margin-right:100px;
margin-top:20px;
position:relative;
}
</style>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Wrong Username or Password</title>
</head>
<body>
<?php echo $error_message; ?>
</body>
</html>
plz help me dude
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 44
Reputation: manishmannan is an unknown quantity at this point 
Solved Threads: 2
manishmannan manishmannan is offline Offline
Light Poster
 
-1
  #15
30 Days Ago
there is no any kind of error occuring in the server even it print the message that records have deleted but still reords is not deleted
My all the commands work properly but still the records are not deleted do somthing take it seriously plzzzzzz
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 539
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 63
network18 network18 is offline Offline
Posting Pro
 
0
  #16
30 Days Ago
No,deleting the rows got nothing to do with php.ini settings. Now I will write how to start debugging step by step.
-first check if you can connect to the mysql on the server; echo the connection object like
  1. $con = mysql_connect(.....,....,..);
  2. echo "Connection=>".$con;
-check you getting the delete query as echo after the delete
-try to execute it in the db,got any error in the mysql with the query syntax.
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro
 
-1
  #17
30 Days Ago
Please use code tags, it makes it easier to read your code.

Also, the code on the first page has a Delete statement, the code above does not. Which code are you using at the moment?
Last edited by Will Gresham; 30 Days Ago at 8:51 am.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 44
Reputation: manishmannan is an unknown quantity at this point 
Solved Threads: 2
manishmannan manishmannan is offline Offline
Light Poster
 
0
  #18
29 Days Ago
hello friends
1stly i am replying to network
my query works fine like there is a statements in my script like this

<?php if($_GET['delete'] && $_GET['delete'] =='Delete' ){
for($i=0;$i<count($_GET['checkbox']);$i++)
{
$del_id = $checkbox[$i];
$sql = "DELETE FROM $tbl_name WHERE id='$del_id' ";
$result = mysql_query($sql,$con);
if (mysql_query($sql,$con))
{
echo " records is sucessfully Deleted";
}
else{
die('Error: ' . mysql_error());
}
}
if($result){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=del.php\">";
}
}
mysql_close();

?>
here i got proper execution of my script even no any kind of error occured
and message prints sucessfully
like
records is sucessfully Deleted
but results is no rows are deleting from the database
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 44
Reputation: manishmannan is an unknown quantity at this point 
Solved Threads: 2
manishmannan manishmannan is offline Offline
Light Poster
 
0
  #19
29 Days Ago
and this is the same script that work fine on my local host but not on uploading files on internet
what to do??????????
plz help me out
and i need to tell you that my localhost sql version is
MySQL
Server: localhost via TCP/IP
Server version: 5.1.37
Protocol version: 10
User: root@localhost
MySQL charset: UTF-8 Unicode (utf8)

and on internet i am having

localhost
Server version: 5.0.18-nt
Protocol version: 10
Server: localhost via TCP/IP
User: DATABASE@127.0.0.1
MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation:
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 44
Reputation: manishmannan is an unknown quantity at this point 
Solved Threads: 2
manishmannan manishmannan is offline Offline
Light Poster
 
0
  #20
29 Days Ago
is there any difference in any both the version of my sql??????
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC