urtrivedi 276 Nearly a Posting Virtuoso

If your computer is in LAN, then, you can try to open it from other pc like

http://yourcomputername/pagefolder/page.jsp

I am assuming that it is running successfully in your computer like
http://localhost/pagefolder/page.jsp.

You also need to check firewall in your computer, usually port no 80 for http service

urtrivedi 276 Nearly a Posting Virtuoso

THIS IS LITTLE MODIFIED VERSION
I think just write -1 there in interval

SELECT monthlycommission.YearPaid, sum(monthlycommission.Amount)CommissionPaid, monthlycommission.MonthPaid
FROM monthlycommission
WHERE DatePaid is not null and year(DATE_SUB(NOW(), INTERVAL -1 YEAR))-monthlycommission.YearPaid
GROUP BY MonthPaid
ORDER BY DatePaid ASC
urtrivedi 276 Nearly a Posting Virtuoso

I think just write -1 there in interval

SELECT monthlycommission.YearPaid, sum(monthlycommission.Amount)CommissionPaid, monthlycommission.MonthPaid
FROM monthlycommission
WHERE DatePaid is not null and DATE_SUB(NOW(), INTERVAL -1 YEAR)
GROUP BY MonthPaid
ORDER BY DatePaid ASC
urtrivedi 276 Nearly a Posting Virtuoso

so your problem is solved or u are still cant trace it?
If you have opened file in any software or by fopen. then it may not allow you to delete on widows.

on linux you apache user must have permission to access the file.

urtrivedi 276 Nearly a Posting Virtuoso

on windows I dont think any problem should occur, Is the file opened, when u are trying to delete.

urtrivedi 276 Nearly a Posting Virtuoso

linux or windows?

urtrivedi 276 Nearly a Posting Virtuoso

Capthcha is used to avoid spam generated by bots, it can not defeat or restrict a human.

urtrivedi 276 Nearly a Posting Virtuoso

is it your own server under your control or it is somewhere else.
Do you have telnet or ftp access?

urtrivedi 276 Nearly a Posting Virtuoso

is it php or jsp?

urtrivedi 276 Nearly a Posting Virtuoso

Your web user on the server has no permission to access that file. So its not possible to delete file without full privilege.

urtrivedi 276 Nearly a Posting Virtuoso

Is your simple mail working on server.

urtrivedi 276 Nearly a Posting Virtuoso

dont start form, first make clear what you want in database. post your columns you want to keep in 3 tables. if you once identify relation between the tables , your query will automatically join appropriate tables and will give you perfect result.

urtrivedi 276 Nearly a Posting Virtuoso

when you click on logout, you must call some file say logout.php in which you must destroy session like

<?php
        session_start();

	session_unset('userid');
	session_unset('username');
			
	session_destroy();

	header("Location: login.php");
?>
urtrivedi 276 Nearly a Posting Virtuoso

This is full code, you may keep backup of your changepassword.php and create new file with this code

<?php
include './dbfunctions.php';
$link = dbConnect();
session_start();
$stid = $_GET['staffref']; 
echo $stid; 


$staffs = dbGetRows("staff", "id = '".$stid."'");
$staff = mysql_fetch_array($staffs, MYSQL_ASSOC);

echo $staff['username'];
echo $staff['password'];

  if (isset($_POST['Submit'])) 
  {
 
	$username = $_POST['username'];
	$oldpassword = md5($_POST['oldpassword']);
	$newpassword = $_POST['newpassword'];
	$confirmnewpassword = $_POST['confirmnewpassword'];
  
// var_dump($_POST);	

 
    if($newpassword == "" )
	{
		echo "New password cannot be blank!";
	}
    // Check if New password is confirmed
    elseif ($newpassword != $confirmnewpassword)
	{ 
		echo "The \"New Password\" and \"Confirm New Password\" fields do not match, please re-enter!"; 
	}
    else
	{

		 // query username old password is not correct
		$query = "SELECT username FROM staff WHERE username = '".mysql_real_escape_string($username)."' and password = '".$oldpassword."'";
	
		$result = mysql_query($query);
		$row=mysql_fetch_array($result);
	
	    // Check if Old username old password is not correct
	    if(!$row)
		{
		  
			echo "Aw shucks! Seems like you don't exist! Please recheck your username/password dude";
			mysql_create_db("abcde");
		}
		else
		{
	    // If everything is ok,  modify the record
			$query = "UPDATE staff SET password = '".md5($newpassword)."' WHERE username = '".$username."'";

			$result =  mysql_query($query) or die('Error : ' . mysql_error());
			if( $result ) 
			{
				echo "All done!";
			}
		}
	}
 }	    
			
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Password Administration</title>
<link href="../bb.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFF4DC">
<table width="60%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td width="32"><img src="../images/admin_03.gif"></td>
    <td width="0*" bgcolor="#FFFFFF" background="../images/admin_04.gif" style="background-repeat: repeat-x;">&nbsp;</td>
    <td width="35"><img src="../images/admin_07.gif" width="32" height="33"></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF" background="../images/admin_15.gif" style="background-repeat: repeat-y;"></td>
    <td bgcolor="#FFFFFF"><table …
urtrivedi 276 Nearly a Posting Virtuoso

this should work

echo $staff['password'];

  if (isset($_POST['Submit'])) 
  {
 
	$username = $_POST['username'];
	$oldpassword = md5($_POST['oldpassword']);
	$newpassword = $_POST['newpassword'];
	$confirmnewpassword = $_POST['confirmnewpassword'];
  
// var_dump($_POST);	

 
    if($newpassword == "" )
	{
		echo "New password cannot be blank!";
	}
    // Check if New password is confirmed
    elseif ($newpassword != $confirmnewpassword)
	{ 
		echo "The \"New Password\" and \"Confirm New Password\" fields do not match, please re-enter!"; 
	}
    else
	{

		 // query username old password is not correct
		$query = "SELECT username FROM staff WHERE username = '".mysql_real_escape_string($username)."' and password = '".$oldpassword."'";

	
		$result = mysql_query($query);
		$row=mysql_fetch_array($result);
	
	    // Check if Old username old password is not correct
	    if(!$row)
		{
		  
			echo "Aw shucks! Seems like you don't exist! Please recheck your username/password dude";
		}
		else
		{
	    // If everything is ok,  modify the record
			$query = "UPDATE staff SET password = '".md5($newpassword)."' WHERE username = '".$username."'";

			$result =  mysql_query($query) or die('Error : ' . mysql_error());
			if( $result ) 
			{
				echo "All done!";
			}
		}
	}
 }	    
			
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
urtrivedi 276 Nearly a Posting Virtuoso

at the end line no 360 add this 2 link

var image=  get_image(pair[1]);
        document.getElementById("prodid_hidden").value  = image.prodid;
urtrivedi 276 Nearly a Posting Virtuoso

You change this line to capital S, you have written small s, this will start your script working.
Still I am working on password logic, but this is first workaround, to start

if (isset($_POST['Submit']))
urtrivedi 276 Nearly a Posting Virtuoso

I am looking into it, Now I will need some time. meanwhile you try to do it or you many continue other work.

urtrivedi 276 Nearly a Posting Virtuoso

open your html file in google chrome,
right click on the actual product id (not label).
click on INSPECT ELEMENT.
NOW YOU WILL SEE SOME HTML CODE, POST THAT CODE HERE (related to prod id fetched from js file)

or

if you want me to check here, post your all other js files used

urtrivedi 276 Nearly a Posting Virtuoso

do you have google chrome browser

urtrivedi 276 Nearly a Posting Virtuoso

can you post your all php files and table script in sql here

urtrivedi 276 Nearly a Posting Virtuoso

have you noticed innerHTML, i have used .innerHTML and not .value

document.getElementById("prodid_hidden").value  = document.getElementById("prodid").innerHTML;
urtrivedi 276 Nearly a Posting Virtuoso

undo what you changed by my previous post
ok sorry, change line 260 to

<input type="hidden" id="prodid_hidden" name="prodid_hidden" value=""  />

at line 340 (after sameadd function)
add line

document.getElementById("prodid_hidden").value  = document.getElementById("prodid").innerHTML;
</script>
urtrivedi 276 Nearly a Posting Virtuoso

First you create a action page in php which will return you latest info you want to display.
I mean I guess you know using ajax or jquery to post and retrive data.

Now You call that ajax/jquery function using timer

jquery tutorial u may find here
http://phpacademy.org/videos/index.php?all

urtrivedi 276 Nearly a Posting Virtuoso

check my code in new page. IF this works I will explain you later

<?php
.
.
.
.
.
//echo $staff['password'];

  if (isset($_POST['submit'])) 
  {
 
	$username = $_POST['username'];
	$oldpassword = md5($_POST['oldpassword']);
	$newpassword = $_POST['newpassword'];
	$confirmnewpassword = $_POST['newpassword'];
  
// var_dump($_POST);	

 
    if($newpassword == "" )
	{
		echo "New password cannot be blank!";
	}
    // Check if New password is confirmed
    elseif ($newpassword != $confirmnewpassword)
	{ 
		echo "The \"New Password\" and \"Confirm New Password\" fields do not match, please re-enter!"; 
	}
    else
	{

		 // query username old password is not correct
		$query = "SELECT username FROM staff WHERE username = '".mysql_real_escape_string($username)."' and password = '".$oldpassword."'";
	
	
		$result = mysql_query($query);
		$row=mysql_fetch_array($result);
	
	    // Check if Old username old password is not correct
	    if(!$row)
		{
		  
			echo "Aw shucks! Seems like you don't exist! Please recheck your username/password dude";
		}
		else
		{
	    // If everything is ok,  modify the record
			$query = "UPDATE staff SET password = '".md5($newpassword)."' WHERE username = '".$username."'";
			$result =  mysql_query($query) or die('Error : ' . mysql_error());
			if( $result ) 
			{
				echo "All done!";
			}
		}
	}
 }	    
			
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
.
.
.
.
.
urtrivedi 276 Nearly a Posting Virtuoso

modify line 250 (prodid to prodid_h4), make sure you do not use same id for any element of html, whether div, text, para whatever

<h4 id="prodid_h4">Product ID: </h4>

at line 340 (after sameadd function)
add line

document.getElementById("prodid").value  = document.getElementById("prodid_h4").value;
urtrivedi 276 Nearly a Posting Virtuoso

blur and onfocus is best to use, but still you can do

onclick="makeBlank(this,'User Name')"
urtrivedi 276 Nearly a Posting Virtuoso

keep line 21 as (uncomment)

if(isset($_POST['Submit'])){

also add close brace } at line 47

urtrivedi 276 Nearly a Posting Virtuoso

do not add .$salt to md5 with password

md5(mysql_real_escape_string($newpassword))
urtrivedi 276 Nearly a Posting Virtuoso

This is corrected one

<script lang='javascript'>
function makeBlank(obj,defMsg){

	if(obj.value==defMsg){
		obj.value="";
	}
}
function fillDefValue(obj,defMsg){
	if(obj.value==""){
		obj.value=defMsg;
	}
}
</script>

<input name="fromname1" id="fromname1" type="text"> <br>
<input style="width:190px" onblur="fillDefValue(this,'User Name')" onfocus="makeBlank(this,'User Name')" value="User Name" name="fromname" id="fromname" type="text">
urtrivedi 276 Nearly a Posting Virtuoso
<script lang='javascript'>
function makeBlank(obj,defMsg){
	if(obj.value==defMsg){
		obj.value="";
	}
}
function fillDefValue(obj,defMsg){
	if(obj.value==""){
		obj.value=defMsg;
	}
}
</script>

<input style="width:190px" onblur="fillDefValue(this,'User Name')" onfocus="makeBlank(this,'User Name')" value="Name" name="fromname" id="fromname" type="text">
urtrivedi 276 Nearly a Posting Virtuoso

what is the error?

urtrivedi 276 Nearly a Posting Virtuoso

Thats what I told you in my previous post, its not jquery fault, You need to review your insert.php page. Make sure it works fine independently.

urtrivedi 276 Nearly a Posting Virtuoso

Try this I hope it will work

<script type="text/javascript">
$(document).ready(function(){	
	$('#share').click(function(){		
            var status=$(".input").val();
	    if(status!="So what's on your mind?")	
            {
 		var DATA = 'status=' + status;
		$.ajax({
		type: "POST",
		url: "insert.php",
		data: DATA,
		success: function() {
		  //display message back to user here
		}
            }
	  });
	  return false;	
	});
});
</script>
urtrivedi 276 Nearly a Posting Virtuoso

you are mixing c++ and php, its syntax is same but behavior is different. I hope you are familiar with html form posting.
when ever you submit the form all is processed as it is new thing. Your previous states are not kept.

If you want to use variables across the pages you must use $_SESSION variable provided by php

-> you must use session_start(); in the beginning of all php page going to access session variable

<?php
session_start();//this must be first line in all php pages you are using
.
.
.
.
.
$something = POST['asubmition'];


if ($something){
if(isset($_SESSION['var'])) 
   $_SESSION['var']++;//always use session variable if you want them to store values across multiple page or multiple posts
else
   $_SESSION['var']=1;

}
urtrivedi 276 Nearly a Posting Virtuoso

Is the page available online to view. or its in your computer, becuase I am not able to run it here.

what myaccountbuisness.php file contains?

urtrivedi 276 Nearly a Posting Virtuoso

But what you are trying to do and what is not happening?

urtrivedi 276 Nearly a Posting Virtuoso

post whole code, and explain more what you are trying to do

urtrivedi 276 Nearly a Posting Virtuoso

there may be problem with insert.php, because alert is working fine when you click on share div.

urtrivedi 276 Nearly a Posting Virtuoso

my code will bold text around checkbox.
if you want to change style of checkbox then create 2 style class and apply conditionally using php

urtrivedi 276 Nearly a Posting Virtuoso

Just think that its not div but its a button. If you find code for button, same way you write code for share id.

urtrivedi 276 Nearly a Posting Virtuoso
<td>
<input name="power" type="checkbox" disabled="disabled" 
<?php if($row['power_backup']=='on') echo "checked"; ?> />
</td>
<td><?php if($row['power_backup']=='on') echo "<b>Power Backup</b>" else echo "Power Backup"; ?></td>

<td style="width:25px;">
<input name="purifier" disabled="disabled" type="checkbox" 
<?php if($row['water_purifier']=='on') echo "checked"; ?> />
</td>
<td><?php if($row['water_purifier']=='on') echo "<b>Water Purifier</b>" else echo "Water Purifier"; ?> </td>
urtrivedi 276 Nearly a Posting Virtuoso

Ok in the smaller version you explain little bit more what are you trying to acheive?

urtrivedi 276 Nearly a Posting Virtuoso

Just treat it as a button, use onclick event to do whatever you want

<div class="status">
    <textarea class="input" name="status" id="content" >
        So whats on your mind?
    </textarea>
</div>

<div class="button_outside" id="share" onclick="javascript:alert('hi')">
    <div class="button_inside">Share</div>
</div>
urtrivedi 276 Nearly a Posting Virtuoso

You are not loosing anything actually, at a time you can handle only one form request.

If you submit form1 then only email and mail-submitting will be sent to action page
If you submit form2 then only email,subject and contact-submitting will be sent to action page

urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

One thing is that mysql itself takes care and do not update a row if there is no change.

Still if you want to include it in your code, then when you load your page with database values, then you also add one more hidden field, say original_qty,

Now when your process your data from html form. you compare qty and original_qty column, if both are not matching then only execute update query

urtrivedi 276 Nearly a Posting Virtuoso

if your image longer than the box (border you show), then i think you must change captcha php

urtrivedi 276 Nearly a Posting Virtuoso

1) Either you can create adminpanel for him where you create php pages (that will manage database)
2) your client directly make changes to database using available tools like phpmyadmin for mysql(this is dangerous if client is IT illiterate)

urtrivedi 276 Nearly a Posting Virtuoso

CHANGE LINE NUMBER 89 FROM <TD> TO <td align="right">