http://www.magentocommerce.com/magento-connect/disable-email-notifications.html
Thursday, 29 October 2015
Monday, 5 October 2015
validation with login
<script type="text/javascript">
/*
function demo()
{
var fn = document.getElementById("fn");
var email = document.getElementById("email");
var contact = document.getElementById("contact");
var pass = document.getElementById("pass");
var repass = document.getElementById("repass");
if((fn.value=="") || (fn.value.search(/^[A-Za-z]+$/)))
{
alert('Enter Name');
fn.focus();
return false;
}
var RegExEmail = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}.$/i;
if((email.value=="") ||(!RegExEmail.test(email.value)))
{
alert('Enter email');
email.focus();
return false;
}
if((contact.value=="") || (contact.value.search(/^[0-9]+$/)) || (contact.value.length<10))
{
alert('Enter Contact');
contact.focus();
return false;
}
if((pass.value=="") || (repass.value==""))
{
alert('Enter password twise');
pass.focus();
return false;
}
if(pass.value!=repass.value)
{
alert('password not match');
pass.focus();
return false;
}
return true;
}
*/
</script>
<script type="text/javascript">
function demo(){
var fn = document.getElementById("fn");
var email = document.getElementById("email");
var contact = document.getElementById("contact");
var pass = document.getElementById("pass");
var repass = document.getElementById("repass");
var gender_m = document.getElementById("gender_m");
var gender_f = document.getElementById("gender_f");
var city = document.getElementById("city");
if(fn.value==''){
alert('Enter Name');
fn.focus();
return false;
}
if(fn.value.search(/^[A-Za-z]+$/)){
alert('Enter Valid Name');
fn.focus();
return false;
}
if(email.value.search(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}.$/i)){
alert('Enter Valid Email');
email.focus();
return false;
}
if(contact.value.search(/^[0-9]+$/)){
alert('Enter Valid Contact');
contact.focus();
return false;
}
if(contact.value.length<10){
alert('Must Be Enter 10 Digit');
contact.focus();
return false;
}
if(pass.value!=repass.value){
alert('Password Not Match');
repass.focus();
return false;
}
if(gender_m.checked==false && gender_f.checked==false){
alert('Choose Gender');
gender_m.focus();
return false;
}
if(city.value==''){
alert('Select City');
city.focus();
return false;
}
return true;
}
</script>
<form name="form" action="#" method="post">
Name :-
<input type="text" name="Fname" id="fn" /><br /><br />
Email :-
<input type="text" name="Email" id="email"/><br /><br />
Contact :-
<input type="text" name="contact" id="contact" maxlength="10"/><br /><br />
Password :-
<input type="text" name="password" id="pass" /><br /><br />
Re-Password :-
<input type="text" name="repass" id="repass" /><br /><br />
Gender :-
<input type="radio" name="gender" id="gender_m" value="Male" />Male
<input type="radio" name="gender" id="gender_f" value="Female" />Female<br /><br />
City :-
<select id="city">
<option value="">--Select--</option>
<option value="AHM">Ahmedabad</option>
</select><br /><br />
<input type="submit" name="submit" value="submit" onclick="return demo();" />
</form>
*********************************product*******************
<form action="insert_product1.php" method="post" enctype="multipart/form-data">
<table>
<tr>
<td>Name:</td>
<tD><input type="text" name="t1"></td>
</tr>
<tr>
<td>Price:</td>
<tD><input type="text" name="t2"></td>
</tr>
<tr>
<td>Category:</td>
<td>
<select name="t3">
<option value="Electronic">Electronic</option>
<option value="Mobile">Mobile</option>
</select>
</td>
</tr>
<tr>
<td>Descrition:</td>
<tD><input type="text" name="t4"></td>
</tr>
<tr>
<td>Photo</td>
<td><input type="file" name="t5"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="submit"></td>
</tr>
</table>
</form>
<?php
$conn=new PDO("mysql:dbname=ssit","root","");
$result=$conn->query("select *from product");
?>
<table border="1">
<tr>
<td> </td>
<td> </tD>
<td>Product Id</td>
<td>Product Name</td>
<td>Price</td>
<td>Category</td>
<td>Description</tD>
<td>Photo</td>
</tr>
<?php
while($row=$result->fetch())
{
?>
<tr>
<td><a href='deleteproduct1.php?x=<?php echo $row["pid"]; ?>'>Delete</a></td>
<td><a href='editproduct1.php?x=<?php echo $row["pid"]; ?>'>Edit</a></td>
<td><?php echo $row["pid"]; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["price"]; ?></td>
<td><?php echo $row["category"]; ?></td>
<td><?php echo $row["description"]; ?></td>
<td><img src='<?php echo $row["photo"]; ?>' height="50" width="50" ></td>
</tr>
<?php
}
?>
</table>
****************************insert*******************
<?php
$na=$_POST["t1"];
$p=$_POST["t2"];
$ct=$_POST["t3"];
$des=$_POST["t4"];
$fname=$_FILES["t5"]["name"];
$path="photo/".$fname;
move_uploaded_file($_FILES["t5"]["tmp_name"],$path);
$conn=new PDO("mysql:dbname=ssit","root","");
$conn->query("insert into product(name,price,category,description,photo) values('".$na."','".$p."','".$ct."','".$des."','".$path."')");
header("Location:product.php");
?>
******************edit*************
<?php
$id=$_GET["x"];
$conn=new PDO("mysql:dbname=ssit","root","");
$rs=$conn->query("select *from product where pid='".$id."'");
$rw=$rs->fetch();
?>
<form action="updateproduct1.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="pid" value='<?php echo $rw["pid"]; ?>'>
<table>
<tr>
<td>Name:</td>
<tD><input type="text" value='<?php echo $rw["name"] ?>' name="t1"></td>
</tr>
<tr>
<td>Price:</td>
<tD><input type="text" value='<?php echo $rw["price"] ?>' name="t2"></td>
</tr>
<tr>
<td>Category:</td>
<td>
<select name="t3">
<?php
if($rw["category"]=="Electronic")
{
?>
<option value="Electronic" selected>Electronic</option>
<option value="Mobile">Mobile</option>
<?php
}
else
{
?>
<option value="Electronic">Electronic</option>
<option value="Mobile" selected>Mobile</option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Descrition:</td>
<tD><input type="text" value='<?php echo $rw["description"] ?>' name="t4"></td>
</tr>
<tr>
<td>Photo</td>
<td><input type="file" name="t5">
<img src='<?php echo $rw["photo"] ?>' width="30" height="30">
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Update"></td>
</tr>
</table>
</form>
<?php
$result=$conn->query("select *from product");
?>
<table border="1">
<tr>
<td> </td>
<td> </tD>
<td>Product Id</td>
<td>Product Name</td>
<td>Price</td>
<td>Category</td>
<td>Description</tD>
<td>Photo</td>
</tr>
<?php
while($row=$result->fetch())
{
?>
<tr>
<td><a href='deleteproduct1.php?x=<?php echo $row["pid"]; ?>'>Delete</a></td>
<td><a href='editproduct1.php?x=<?php echo $row["pid"]; ?>'>Edit</a></td>
<td><?php echo $row["pid"]; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["price"]; ?></td>
<td><?php echo $row["category"]; ?></td>
<td><?php echo $row["description"]; ?></td>
<td><img src='<?php echo $row["photo"]; ?>' height="50" width="50" ></td>
</tr>
<?php
}
?>
</table>
*******************delete*****************
<?php
$id=$_GET["x"];
$conn=new PDO("mysql:dbname=ssit","root","");
$conn->query("delete from product where pid='".$id."'");
header("Location:product1.php");
?>
***************************************update
<?php
$na=$_POST["t1"];
$p=$_POST["t2"];
$ct=$_POST["t3"];
$des=$_POST["t4"];
$id=$_POST["pid"];
$conn=new PDO("mysql:dbname=ssit","root","");
$fname=$_FILES["t5"]["name"];
if($fname=="")
{
$conn->query("update product set name='".$na."',price='".$p."',category='".$ct."',description='".$des."' where pid='".$id."'");
}
else
{
$path="photo/".$fname;
move_uploaded_file($_FILES["t5"]["tmp_name"],$path);
$conn->query("update product set name='".$na."',price='".$p."',category='".$ct."',description='".$des."',photo='".$path."' where pid='".$id."'");
}
header("Location:product1.php");
?>
***************multi login******
<?php
session_start();
$l=$_POST["t1"];
$p=$_POST["t2"];
$conn=new PDO("mysql:dbname=project","root","");
$result1=$conn->query("select *from admin where loginid='".$l."' and password='".$p."'");
if($row1=$result1->fetch())
{
header("Location:admin_welcome.php");
}
else
{
$result=$conn->query("select *From business where loginid='".$l."' and password='".$p."'");
if($row=$result->fetch())
{
$_SESSION["rid"]=$row["rid"];
header("Location:welcome_business.php");
}
else
{
$result2=$conn->query("select *From user where loginid='".$l."' and password='".$p."'");
if($row2=$result2->fetch())
{
$_SESSION["rid"]=$row2["uid"];
header("Location:welcome_viewer.php");
}
else
{
header("Location:login.php");
}
}
}
?>
/*
function demo()
{
var fn = document.getElementById("fn");
var email = document.getElementById("email");
var contact = document.getElementById("contact");
var pass = document.getElementById("pass");
var repass = document.getElementById("repass");
if((fn.value=="") || (fn.value.search(/^[A-Za-z]+$/)))
{
alert('Enter Name');
fn.focus();
return false;
}
var RegExEmail = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}.$/i;
if((email.value=="") ||(!RegExEmail.test(email.value)))
{
alert('Enter email');
email.focus();
return false;
}
if((contact.value=="") || (contact.value.search(/^[0-9]+$/)) || (contact.value.length<10))
{
alert('Enter Contact');
contact.focus();
return false;
}
if((pass.value=="") || (repass.value==""))
{
alert('Enter password twise');
pass.focus();
return false;
}
if(pass.value!=repass.value)
{
alert('password not match');
pass.focus();
return false;
}
return true;
}
*/
</script>
<script type="text/javascript">
function demo(){
var fn = document.getElementById("fn");
var email = document.getElementById("email");
var contact = document.getElementById("contact");
var pass = document.getElementById("pass");
var repass = document.getElementById("repass");
var gender_m = document.getElementById("gender_m");
var gender_f = document.getElementById("gender_f");
var city = document.getElementById("city");
if(fn.value==''){
alert('Enter Name');
fn.focus();
return false;
}
if(fn.value.search(/^[A-Za-z]+$/)){
alert('Enter Valid Name');
fn.focus();
return false;
}
if(email.value.search(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}.$/i)){
alert('Enter Valid Email');
email.focus();
return false;
}
if(contact.value.search(/^[0-9]+$/)){
alert('Enter Valid Contact');
contact.focus();
return false;
}
if(contact.value.length<10){
alert('Must Be Enter 10 Digit');
contact.focus();
return false;
}
if(pass.value!=repass.value){
alert('Password Not Match');
repass.focus();
return false;
}
if(gender_m.checked==false && gender_f.checked==false){
alert('Choose Gender');
gender_m.focus();
return false;
}
if(city.value==''){
alert('Select City');
city.focus();
return false;
}
return true;
}
</script>
<form name="form" action="#" method="post">
Name :-
<input type="text" name="Fname" id="fn" /><br /><br />
Email :-
<input type="text" name="Email" id="email"/><br /><br />
Contact :-
<input type="text" name="contact" id="contact" maxlength="10"/><br /><br />
Password :-
<input type="text" name="password" id="pass" /><br /><br />
Re-Password :-
<input type="text" name="repass" id="repass" /><br /><br />
Gender :-
<input type="radio" name="gender" id="gender_m" value="Male" />Male
<input type="radio" name="gender" id="gender_f" value="Female" />Female<br /><br />
City :-
<select id="city">
<option value="">--Select--</option>
<option value="AHM">Ahmedabad</option>
</select><br /><br />
<input type="submit" name="submit" value="submit" onclick="return demo();" />
</form>
*********************************product*******************
<form action="insert_product1.php" method="post" enctype="multipart/form-data">
<table>
<tr>
<td>Name:</td>
<tD><input type="text" name="t1"></td>
</tr>
<tr>
<td>Price:</td>
<tD><input type="text" name="t2"></td>
</tr>
<tr>
<td>Category:</td>
<td>
<select name="t3">
<option value="Electronic">Electronic</option>
<option value="Mobile">Mobile</option>
</select>
</td>
</tr>
<tr>
<td>Descrition:</td>
<tD><input type="text" name="t4"></td>
</tr>
<tr>
<td>Photo</td>
<td><input type="file" name="t5"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="submit"></td>
</tr>
</table>
</form>
<?php
$conn=new PDO("mysql:dbname=ssit","root","");
$result=$conn->query("select *from product");
?>
<table border="1">
<tr>
<td> </td>
<td> </tD>
<td>Product Id</td>
<td>Product Name</td>
<td>Price</td>
<td>Category</td>
<td>Description</tD>
<td>Photo</td>
</tr>
<?php
while($row=$result->fetch())
{
?>
<tr>
<td><a href='deleteproduct1.php?x=<?php echo $row["pid"]; ?>'>Delete</a></td>
<td><a href='editproduct1.php?x=<?php echo $row["pid"]; ?>'>Edit</a></td>
<td><?php echo $row["pid"]; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["price"]; ?></td>
<td><?php echo $row["category"]; ?></td>
<td><?php echo $row["description"]; ?></td>
<td><img src='<?php echo $row["photo"]; ?>' height="50" width="50" ></td>
</tr>
<?php
}
?>
</table>
****************************insert*******************
<?php
$na=$_POST["t1"];
$p=$_POST["t2"];
$ct=$_POST["t3"];
$des=$_POST["t4"];
$fname=$_FILES["t5"]["name"];
$path="photo/".$fname;
move_uploaded_file($_FILES["t5"]["tmp_name"],$path);
$conn=new PDO("mysql:dbname=ssit","root","");
$conn->query("insert into product(name,price,category,description,photo) values('".$na."','".$p."','".$ct."','".$des."','".$path."')");
header("Location:product.php");
?>
******************edit*************
<?php
$id=$_GET["x"];
$conn=new PDO("mysql:dbname=ssit","root","");
$rs=$conn->query("select *from product where pid='".$id."'");
$rw=$rs->fetch();
?>
<form action="updateproduct1.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="pid" value='<?php echo $rw["pid"]; ?>'>
<table>
<tr>
<td>Name:</td>
<tD><input type="text" value='<?php echo $rw["name"] ?>' name="t1"></td>
</tr>
<tr>
<td>Price:</td>
<tD><input type="text" value='<?php echo $rw["price"] ?>' name="t2"></td>
</tr>
<tr>
<td>Category:</td>
<td>
<select name="t3">
<?php
if($rw["category"]=="Electronic")
{
?>
<option value="Electronic" selected>Electronic</option>
<option value="Mobile">Mobile</option>
<?php
}
else
{
?>
<option value="Electronic">Electronic</option>
<option value="Mobile" selected>Mobile</option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Descrition:</td>
<tD><input type="text" value='<?php echo $rw["description"] ?>' name="t4"></td>
</tr>
<tr>
<td>Photo</td>
<td><input type="file" name="t5">
<img src='<?php echo $rw["photo"] ?>' width="30" height="30">
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Update"></td>
</tr>
</table>
</form>
<?php
$result=$conn->query("select *from product");
?>
<table border="1">
<tr>
<td> </td>
<td> </tD>
<td>Product Id</td>
<td>Product Name</td>
<td>Price</td>
<td>Category</td>
<td>Description</tD>
<td>Photo</td>
</tr>
<?php
while($row=$result->fetch())
{
?>
<tr>
<td><a href='deleteproduct1.php?x=<?php echo $row["pid"]; ?>'>Delete</a></td>
<td><a href='editproduct1.php?x=<?php echo $row["pid"]; ?>'>Edit</a></td>
<td><?php echo $row["pid"]; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["price"]; ?></td>
<td><?php echo $row["category"]; ?></td>
<td><?php echo $row["description"]; ?></td>
<td><img src='<?php echo $row["photo"]; ?>' height="50" width="50" ></td>
</tr>
<?php
}
?>
</table>
*******************delete*****************
<?php
$id=$_GET["x"];
$conn=new PDO("mysql:dbname=ssit","root","");
$conn->query("delete from product where pid='".$id."'");
header("Location:product1.php");
?>
***************************************update
<?php
$na=$_POST["t1"];
$p=$_POST["t2"];
$ct=$_POST["t3"];
$des=$_POST["t4"];
$id=$_POST["pid"];
$conn=new PDO("mysql:dbname=ssit","root","");
$fname=$_FILES["t5"]["name"];
if($fname=="")
{
$conn->query("update product set name='".$na."',price='".$p."',category='".$ct."',description='".$des."' where pid='".$id."'");
}
else
{
$path="photo/".$fname;
move_uploaded_file($_FILES["t5"]["tmp_name"],$path);
$conn->query("update product set name='".$na."',price='".$p."',category='".$ct."',description='".$des."',photo='".$path."' where pid='".$id."'");
}
header("Location:product1.php");
?>
***************multi login******
<?php
session_start();
$l=$_POST["t1"];
$p=$_POST["t2"];
$conn=new PDO("mysql:dbname=project","root","");
$result1=$conn->query("select *from admin where loginid='".$l."' and password='".$p."'");
if($row1=$result1->fetch())
{
header("Location:admin_welcome.php");
}
else
{
$result=$conn->query("select *From business where loginid='".$l."' and password='".$p."'");
if($row=$result->fetch())
{
$_SESSION["rid"]=$row["rid"];
header("Location:welcome_business.php");
}
else
{
$result2=$conn->query("select *From user where loginid='".$l."' and password='".$p."'");
if($row2=$result2->fetch())
{
$_SESSION["rid"]=$row2["uid"];
header("Location:welcome_viewer.php");
}
else
{
header("Location:login.php");
}
}
}
?>
Subscribe to:
Posts (Atom)