Shanti C 106 Posting Virtuoso

i think this is the error in your code and i have changed it to:

mysql_query("UPDATE members2 SET exp_points=exp_points+ $points WHERE username = '$username' AND game = '$game'");

i dont know exactly....

justted commented: Very helpful!!! +1
Shanti C 106 Posting Virtuoso

you have to write insert query after submit your form:
see below:

if($_SERVER['REQUEST_METHOD']=='POST') {
$qur="insert into `users`(`userid`,`password`,`email`,`title`,`fname`,`sname`,`jtitle`,`company`,`address1`, `address2`,`address3`,`town`,`postcode`,`country`,`isector`,`interests`,`telephone`,`fax`,`url`,`status`,`reg_date`)values ('".$_POST['userid']."','".$_POST['password']."','".$_POST['email']."','".$_POST['title']."','".$_POST['fname']."','".$_POST['sname']."','".$_POST['jtitle']."','".$_POST['company']."','".$_POST['address1']."','".$_POST['address2']."','".$_POST['address3']."', '".$_POST['town']."','".$_POST['postcode']."','".$_POST['country']."','".$_POST['isector']."','".$tempids."','".$_POST['telephone']."','".$_POST['fax']."','".$_POST['url']."','0', now())";
			$res= mysql_query( $qur ) ;	
}
theimben commented: Thanks for your help - !Unreal :) +1
Shanti C 106 Posting Virtuoso

how to disable ctrl+c:
http://www.faqs.org/faqs/msdos-programmer-faq/part2/section-16.html

And
That shortcut is handled by the operating system. It never reaches the browser and so the browser has no opportunity to pass it to the web page.

IE only:

Add the following code to your BODY tag:

ondragstart="return false" onselectstart="return false"

Q8iEnG commented: Thanks for the big help :) +1
Shanti C 106 Posting Virtuoso

hi praveen check this once:

<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
session_start();

// Unset all of the session variables.
$_SESSION = array();

// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($_COOKIE[session_name()])) {
    setcookie(session_name(), '', time()-42000, '/');
}

// Finally, destroy the session.
session_destroy();
?>

or see this for reference:
http://us2.php.net/manual/en/function.session-destroy.php

Shanti C 106 Posting Virtuoso

see this reference will teach you clearly..
http://www.indiana.edu/~istdept/R547/PHPbasics/template/template.phtml?pager=43

or follow this code and try to implement your self:

<?

function grades ($student, $score, &$grade)                    {

            if ($score >= 90 )

                        $grade = 'A';

            else if ($score >= 80 )

                        $grade = 'B';

            else

                        $grade = 'C'; 

}

                                                                   

grades("Bob", 75, $bobsGrade);                                                        

echo "Bob's grade is $bobsGrade<br />";                                                     

?>
nav33n commented: good job! +8
Shanti C 106 Posting Virtuoso
if(trimstr(d.emailid.value)==""){alert("Enter E-Mail ID");d.emailid.focus();return false;}
	var m = document.form1.emailid.value
	var cnt=0,spc=0,dot=0;
	for(var i=1;i<=m.length;i++)
	{
		if(m.charAt(i)=="@") cnt++;
		if(m.charAt(i)==" ") spc++;
		if(m.charAt(i)==".") dot++;
	}
	lnm=m.length
	if(cnt==0||cnt>1||spc!=0||dot==0 ||lnm<=2 )	{alert("Please Enter Valid E-mail Id ");document.form1.emailid.focus();return false;	}
Scottmandoo commented: Thanks heaps for the email validation +1
Shanti C 106 Posting Virtuoso
var1=document.getelementbyid('txt1').value
var2=document.getelementbyid('txt2').value
var3=Number(var1)+Number(var2)

or concentrate on eval() function in javascript by googling....

nav33n commented: Ah! Didn't know that.. +7
Shanti C 106 Posting Virtuoso

you just put your code in CODE tags....

peter_budo commented: Exactly... +9
Shanti C 106 Posting Virtuoso
if (Date.parse(fromDate) > Date.parse(toDate)) {
alert("Invalid Date Range!\nStart Date cannot be after End Date!")
return false;

}

or

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<meta name="Content-Style-Type" content="text/css">
<title>Example</title>

<script type="text/javascript">
<!--
function check (f) {
var start = new Date (f.start.value);
var end = new Date (f.end.value);

start.setDate (start.getDate() + 28);
if (end >= start) {alert (); return false}
}
// -->
</script>

<style type="text/css">
<!--
fieldset {padding:1ex; width:10em}
label {display:block; margin:1em 0}
input {display:block}
button {display:block; margin:auto}
-->
</style>

</head>
<body>
<form action="some-script.pl" onsubmit="return check (this)">
<fieldset>
<legend>Dates</legend>
<label>Start Date<input name="start" onchange="this.value = new Date (this.value).toDateString()" type="text"></label>
<label>End Date<input name="end" onchange="this.value = new Date (this.value).toDateString()" type="text"></label>
<button type="submit">Submit</button>
</fieldset>
</form>
</body>
</html>

or simply

function dt()
    {
        var ch=Date.parse("06/19/2008");
       
        var currentdt=new Date;
        if(ch>Date.parse(currentdt))
        {
            alert("Date is greater.");
        }
        else
        {
            alert("Date is less");
        }
    }
Shanti C 106 Posting Virtuoso

you have to post this thread in viruses forum...

Shanti C 106 Posting Virtuoso

Hello kavitha try this...

<?
/...database connections...
if(!empty($_GET['delid'])){  
	mysql_query("delete from category WHERE id='".$_GET['delid']."'");
	
	header("location:samepage.php?msg=del");
	
}
?>
//This is in your designing table...
 <td height="22" align="center" ><a href="javascript:del('<? echo $frow['id'];?>')">Delete</a> </td>
//and this can be anyware in your page

            <script language="javascript">
var d = document.frmmngmall;						
	function del(x)
	{
				
				if(confirm("You want to delete this record"))
					{
					d.action="samepage.php?delid="+x;
					d.submit();
					}
				
			return;
	}
        </script>
 

<? /...database connections... if(!empty($_GET['delid'])){ mysql_query("delete from category WHERE id='".$_GET['delid']."'"); if(!empty($_GET['start'])) { header("location:add_subcategory.php?msg=del&start=".$_GET['start'].""); }else{ header("location:samepage.php?msg=del"); } } ?> //This is in your designing table... <td height="22" align="center" ><a href="javascript<b></b>:del('<? echo $frow['id'];?>')">Delete</a> </td> //and this can be anyware in your page <script language="javascript"> var d = document.frmmngmall; function del(x) { if(confirm("You want to delete this record")) { d.action="samepage.php?delid="+x; d.submit(); } return; } </script>

And your a href must be in form tag...

This is working finely...try this...

Thanks.
Shanti

Shanti C 106 Posting Virtuoso

Hello kavitha try this...

<?
/...database connections...
if(!empty($_GET['delid'])){  
	mysql_query("delete from category WHERE id='".$_GET['delid']."'");
	if(!empty($_GET['start']))
    {
	header("location:add_subcategory.php?msg=del&start=".$_GET['start']."");
	}else{
	header("location:samepage.php?msg=del");
	}
}
?>
//This is in your designing table...
 <td height="22" align="center" ><a href="javascript:del('<? echo $frow['id'];?>')">Delete</a> </td>
//and this can be anyware in your page

            <script language="javascript">
var d = document.frmmngmall;						
	function del(x)
	{
				
				if(confirm("You want to delete this record"))
					{
					d.action="samepage.php?delid="+x;
					d.submit();
					}
				
			return;
	}
        </script>

And your a href must be in form tag...

This is working finely...try this...

Thanks.
Shanti

Shanti C 106 Posting Virtuoso

Try this code, it will work better...

But we can insert image into a folder and That path will be saved into database table..

check it once..

<?


include('connection.php');


if($_SERVER=='POST') {


$dupcnt=getdata("products","count(*)","prcode='".$_POST."'");
$dupcnt2=getdata("products","count(*)","prname='".$_POST."' && catid='".$_POST."'");
if($dupcnt>0 && $dupcnt2>0){
$err="Product With this Name and code already existed.";
} else if($dupcnt>0){
$err="Product With this code already existed.";
} else if($dupcnt2>0){
$err="Product With this name already existed.";
} else {
if($HTTP_POST_FILES["prlimage"]["size"] >1) {    // for  large image 1
$ext = substr($HTTP_POST_FILES,strpos($HTTP_POST_FILES,'.')+1);
$ext_arr=array("jpeg","ping","jpg","gif","bmp");
//if (in_array($ext,$ext_arr)) {
$prlimage=substr($HTTP_POST_FILES,0,strpos($HTTP_POST_FILES,'.'));
$prlimage.=time();
$prlimage.=strstr($HTTP_POST_FILES,'.');
$prlimage="../productimages/".$prlimage;
if(!move_uploaded_file($HTTP_POST_FILES,$prlimage)) { $prlimage=""; }
chmod($prlimage,0777);
} else {
$prlimage="";
}
/*}  else {
$err="Please Upload image only ";
}*/
if($HTTP_POST_FILES["prsimage"]["size"] >1) {    // for  small image 1
$prsimage=substr($HTTP_POST_FILES,0,strpos($HTTP_POST_FILES,'.'));
$ext = substr($HTTP_POST_FILES,strpos($HTTP_POST_FILES,'.')+1);
$ext_arr=array(".jpeg",".ping",".jpg",".gif",".bmp");
//if (in_array($ext,$ext_arr)) {
$prsimage.=time();
$prsimage.=strstr($HTTP_POST_FILES,'.');
$prsimage="../productimages/small/".$prsimage;
if(!move_uploaded_file($HTTP_POST_FILES,$prsimage)) { $prsimage=""; }
chmod($prsimage,0777);
$image_attribs = getimagesize($prsimage);
$width=$image_attribs[0];
$height=$image_attribs[1];
if($width > 75){
@unlink($prsimage);
$err="Please Upload small image of size 75 x 75 ";
}
} else {
$prsimage="";
}
/*} else {
$err="Please Upload image only ";
}*/


if(!empty($_POST)) $prhome='1'; else $prhome='0';
if(!isset($err)) { //add`sub_catid`,'".$_POST."', `prstock`,'".$_POST."',
$qur="insert into `products` (`catid`,  `prname`, `prcode`, `prsdesc`, `prldesc`, `prsimg`, `prlimg`, `prhot`,  `prstatus`, `currdate`) values ('".$_POST."', '".$_POST."', '".$_POST."', '".$_POST."', '".$_POST."', '".$prsimage."', '".$prlimage."', '".$prhome."', '1', now())";
$res= mysql_query( $qur ) ;
$id=mysql_insert_id();
echo'<script language="javascript">window.location.href="success.php'";</script>';
}
} //end for else of product count
} // post



?>

Thanks,
Shanti.

casper_wang commented: nice job Shanti +1