<?
session_start();
include('include/config.php');
include('include/global.php');
$uname=$_POST["username"];
$password=$_POST["password"];
$backurl="";
if(isset($_POST["backurl"]))
{
$backurl=$_POST["backurl"];
}
$qry="Select * from `user` where `username` ='".$uname."' and `password` ='".$password."'";
$resultset=mysql_query($qry) or die(mysql_error());
$no_row=mysql_num_rows($resultset);
#echo $row['deleted'].'='.$row['valid'];die;
if($no_row>0)
{
$row=mysql_fetch_array($resultset);
$_SESSION['TMP_STAMP']=time();
if($row['valid']==1 && $row['deleted']==0)
{
$_SESSION['ses_member_id']=$row["user_id"];
$_SESSION['username']=$row["username"];
$_SESSION['fname']=$row["name"];
//delete order record of uer in temparary table
$del_temp_order=mysql_query('delete from temp_reward_order where user_id='.$row['user_id'])or die(mysql_error());
if($backurl=="")
{
echo "<meta http-equiv='refresh' content='0;URL=myprofile.php'>";
}
else
{
echo "<meta http-equiv='refresh' content='0;URL=$backurl'>";
}
}
if($row["valid"]==1 && $row["deleted"]==1)
{
echo "<meta http-equiv='refresh' content='0;URL=thanks.php?backurl=$backurl&errmsg=Your profile has been disapproved.'>";
}
/*else
{
echo "<meta http-equiv='refresh' content='0;URL=login.php?backurl=$backurl&errmsg=Incorrect Username Or Password.'>";
}*/
}
else
{
echo "<meta http-equiv='refresh' content='0;URL=thanks.php?backurl=$backurl&errmsg=Incorrect Username Or Password.'>";
}
?>
Wednesday, December 1, 2010
Monday, November 29, 2010
Mail function through php
http://phpfastcode.blogspot.com/2010/11/mail-function-through-php.html
<?php
$a1=$_POST['name'];
$a2=$_POST['email'];
$a3=$_POST['phone'];
$a4=$_POST['mesg'];
$mail_from="http://phpfastcode.blogspot.com";
$mail_to= "yogeshbajapi@gmail.com";
$mail_sub="Order Forward from phpfastcode.";
$mail_mesg="The mail forward from phpfastcode.
****************************************************
Customer Information
****************************************************
Contact Person
Name :-$a1
E-mail :-$a2
Telephone :-$a3
Message :-$a4
************************************
*************************************
Thank from
phpfastcode";
?>
<p align="center"><font color="#008aff" size="4" face="Arial, Helvetica, sans-serif">
<?php if(mail($mail_to,$mail_sub,$mail_mesg,"From: $mail_from \nX-Mailer: PHP/" . phpversion()))
{
$sub_user='phpfastcode';
$message="Hi There! \n\n Thank you for interest in our services,\n We hope to answer all emails within 1 business day, should you not get a reply please phone us or use our live help option!\n\n
Kind Regards, \n
The phpfastcode team \n
";
mail($a4,$sub_user,$message,"From: $mail_from \nX-Mailer: PHP/" . phpversion());
?>
<font color="#008aff" size="4" > Thanks </font></p>
<p align="center"><font color="#008aff" size="4" face="Arial, Helvetica, sans-serif">Your
request have been submitted</font></p>
<p> </p>
<font color="#66CC33">
<?php } else{
?>
</font>
<p align="center"><font color="#008aff" size="4" face="Arial, Helvetica, sans-serif">Sorry <?php echo $a1; echo " "; echo $a2;?></font></p>
<p align="center"><font color="#008aff" size="4" face="Arial, Helvetica, sans-serif">Your
request can not be submitted</font> <font face="Arial, Helvetica, sans-serif">
<?php } ?>
</font></p>
<?php
$a1=$_POST['name'];
$a2=$_POST['email'];
$a3=$_POST['phone'];
$a4=$_POST['mesg'];
$mail_from="http://phpfastcode.blogspot.com";
$mail_to= "yogeshbajapi@gmail.com";
$mail_sub="Order Forward from phpfastcode.";
$mail_mesg="The mail forward from phpfastcode.
****************************************************
Customer Information
****************************************************
Contact Person
Name :-$a1
E-mail :-$a2
Telephone :-$a3
Message :-$a4
************************************
*************************************
Thank from
phpfastcode";
?>
<p align="center"><font color="#008aff" size="4" face="Arial, Helvetica, sans-serif">
<?php if(mail($mail_to,$mail_sub,$mail_mesg,"From: $mail_from \nX-Mailer: PHP/" . phpversion()))
{
$sub_user='phpfastcode';
$message="Hi There! \n\n Thank you for interest in our services,\n We hope to answer all emails within 1 business day, should you not get a reply please phone us or use our live help option!\n\n
Kind Regards, \n
The phpfastcode team \n
";
mail($a4,$sub_user,$message,"From: $mail_from \nX-Mailer: PHP/" . phpversion());
?>
<font color="#008aff" size="4" > Thanks </font></p>
<p align="center"><font color="#008aff" size="4" face="Arial, Helvetica, sans-serif">Your
request have been submitted</font></p>
<p> </p>
<font color="#66CC33">
<?php } else{
?>
</font>
<p align="center"><font color="#008aff" size="4" face="Arial, Helvetica, sans-serif">Sorry <?php echo $a1; echo " "; echo $a2;?></font></p>
<p align="center"><font color="#008aff" size="4" face="Arial, Helvetica, sans-serif">Your
request can not be submitted</font> <font face="Arial, Helvetica, sans-serif">
<?php } ?>
</font></p>
config.php file,connection string in php
<?php
//session_cache_limiter("nocahe");
session_start();
ob_start();
/*$database="database name";
$host="localhost";
$userid="useridr";
$password="password";
mysql_connect($host,$userid,$password);
mysql_select_db($database) or die("Could not select database");*/
?>
<?
//session_cache_limiter("nocahe");
session_start();
$database="database name";
$host="localhost";
$userid="root";
$password="";
MySQL_connect($host,$userid,$password);
MySQL_select_db($database) or die("Could not select database");
?>
//session_cache_limiter("nocahe");
session_start();
ob_start();
/*$database="database name";
$host="localhost";
$userid="useridr";
$password="password";
mysql_connect($host,$userid,$password);
mysql_select_db($database) or die("Could not select database");*/
?>
<?
//session_cache_limiter("nocahe");
session_start();
$database="database name";
$host="localhost";
$userid="root";
$password="";
MySQL_connect($host,$userid,$password);
MySQL_select_db($database) or die("Could not select database");
?>
Thursday, October 28, 2010
What is php?
PHP stands for Hypertext Preprocessor
PHP
Paradigm imperative, object-oriented, Procedural, reflective
Appeared in 1995 (1995)[1]
Designed by Rasmus Lerdorf
Developer The PHP Group
Stable release 5.3.3 (July 22, 2010; 3 months ago (2010-07-22))
Typing discipline Dynamic, weak
Major implementations Zend Engine, Roadsend PHP, Phalanger, Quercus, Project Zero, HipHop
Influenced by C, Perl, Java, C++, Tcl[1]
Influenced PHP4Delphi
Programming language C
OS Cross-platform
License PHP License
Usual file extensions .php, .phtml .php5 .phps
Website www.php.net
Wikibooks logo PHP Programming at Wikibooks
PHP
Paradigm imperative, object-oriented, Procedural, reflective
Appeared in 1995 (1995)[1]
Designed by Rasmus Lerdorf
Developer The PHP Group
Stable release 5.3.3 (July 22, 2010; 3 months ago (2010-07-22))
Typing discipline Dynamic, weak
Major implementations Zend Engine, Roadsend PHP, Phalanger, Quercus, Project Zero, HipHop
Influenced by C, Perl, Java, C++, Tcl[1]
Influenced PHP4Delphi
Programming language C
OS Cross-platform
License PHP License
Usual file extensions .php, .phtml .php5 .phps
Website www.php.net
Wikibooks logo PHP Programming at Wikibooks
insert csv into mysql using php.
<?
//session_cache_limiter("nocahe");
if(isset($_POST['submit']))
{
$filename=$_POST['filename'];
$handle = fopen("$filename", "r");
while (($data = fgetcsv($handle, 100000, ",")) !== FALSE)
{
$import="INSERT into kmmb_member1(no_ahli,no_pin,nama,no_ic_baru,no_ic_lama) values('$data[0]','$data[1]','$data[2]','$data[3]','$data[4]')";
mysql_query($import) or die(mysql_error());
}
fclose($handle);
print "Import done";
}
else
{
print "<form action='import.php' method='post'>";
print "Type file name to import:<br>";
print "<input type='text' name='filename' size='20'><br>";
print "<input type='submit' name='submit' value='submit'></form>";
}
?>
//session_cache_limiter("nocahe");
if(isset($_POST['submit']))
{
$filename=$_POST['filename'];
$handle = fopen("$filename", "r");
while (($data = fgetcsv($handle, 100000, ",")) !== FALSE)
{
$import="INSERT into kmmb_member1(no_ahli,no_pin,nama,no_ic_baru,no_ic_lama) values('$data[0]','$data[1]','$data[2]','$data[3]','$data[4]')";
mysql_query($import) or die(mysql_error());
}
fclose($handle);
print "Import done";
}
else
{
print "<form action='import.php' method='post'>";
print "Type file name to import:<br>";
print "<input type='text' name='filename' size='20'><br>";
print "<input type='submit' name='submit' value='submit'></form>";
}
?>
Subscribe to:
Comments (Atom)