Important alert: (current site time 7/15/2013 11:06:51 AM EDT)
 

VB icon

AcMakerWml

Email
Submitted on: 5/23/2001 4:44:12 AM
By: Bogomil Shopov  
Level: Intermediate
User Rating: By 1 Users
Compatibility: PHP 4.0
Views: 15906
author picture
(About the author)
 
     making accounts with wml &html

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
//**************************************
// Name: AcMakerWml
// Description:making accounts with wml &html
// By: Bogomil Shopov
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=326&lngWId=8//for details.//**************************************

****************** 
config.php 
****************** 
<? 
$server="DBhost"; 
$user="DBUSER"; 
$pass="DBpassword"; 
$dbname="DBNAME"; 
?> 
****************** 
create_db.php 
****************** 
 <? 
require("config.php"); 
error_reporting(15); 
$connect_db=mysql_connect($server,$user,$pass); 
$create_db=mysql_create_db($dbname); 
mysql_query($create_db); 
mysql_select_db($dbname); 
$create_tbl=("CREATE TABLE logs (id INT (3) not null AUTO_INCREMENT, 
 user VARCHAR (21) not null , 
 pass VARCHAR (21) not null , 
 name VARCHAR (35) not null , 
 email VARCHAR(42) not null , 
 PRIMARY KEY (id))"); 
 $rezult=mysql_query($create_tbl); 
?> 
******************* 
register.html 
******************* 
<!doctype html public "-//W3C//DTD HTML 4.0 //EN"> 
<html> 
<head> 
<title>Register! 
</title> 
</head> 
<body> 
<form action = register.php method=post> 
<center> 
ID:<br> 
<input type= text name=username size=14> 
<br>Password:<br> 
<input type= password name=password size=14> <br> 
Name:<br> 
<input type=text name=name size=22><br> 
E-mail:<br> 
<input type =text name=email size=22><br> 
<input type= submit value="Register..!"> 
</center> 
</body> 
</html> 
******************* 
register.php 
******************* 
<? 
require("config.php"); 
mysql_connect($server,$user,$pass); 
mysql_select_db($dbname); 
$insert_data="INSERT INTO logs (user,pass,name,email) 
VALUES ('$username','$password','$name','$email')"; 
mysql_query($insert_data); 
 mail($email,"Registration","You are registered in our database \n user:$username \n pass:$password "); 
echo"<center>Thank you!<br><a href=login.html>Login!</a>"; 
?> 
************** 
login.html 
************** 
<!doctype html public "-//W3C//DTD HTML 4.0 //EN"> 
<html> 
<head> 
<title>login! 
</title> 
</head> 
<body> 
<form action =login.php method=post> 
<center> 
ID:<br> 
<input type=text name=username size=14> 
<br>Password:<br> 
<input type=password name=password size=14> <br> 
<input type=submit value="Login..!"> 
</center> 
</body> 
</html> 
**************** 
login.php 
**************** 
<? 
 mysql_connect($server,$user,$pass); 
 mysql_select_db($dbname); 
 $select_data=("SELECT name FROM logs WHERE pass='$password'AND user='$username' "); 
 $ver=mysql_query($select_data); 
 $string=mysql_fetch_array($ver); 
 if ($string==0){ 
 echo"<center>You are not in database<br> 
<a href=register.html>Register</a></center> 
"; 
} 
 else 
 echo"<center><font color=blue size=+2>Welcome $string[0]</font></center>"; 
?> 
********************** 
register.wml 
********************** 
<?xml version="1.0"?> 
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd"> 
<wml> 
<template> 
<do type="prev"><prev/></do> 
</template> 
<card id="card1" title="Register" newcontext="true"> 
<p align="center"> 
ID:<input name="username" size="15" /> 
Password:<input name="password" type="password" /> 
Name:<input name="name" size="10" /> 
E-mail:<input name="email" size="10" /> 
<do type="Send" label="Send"> 
<go href="register.php" method="post" accept-charset="unknown"> 
<postfield name="username" value="$username"/> 
<postfield name="email" value="$email"/> 
<postfield name="password" value="$password"/> 
<postfield name="name" value="$name"/> 
 </go> 
</do> 
</p> 
</card> 
</wml>


Other 13 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

3/30/2002 11:02:12 AMAngel Bautista

login.php lacks of the following sentence: require("config.php"); at the beginning (actually it gives an error ;)
(If this comment was disrespectful, please report it.)

 
6/2/2006 7:29:43 AMtom_anu007

Hello,
Nice piece of code. Just a few questions ->
(1) If the user ais already present this script of yours will not detect it. Leading to two users with the same id:??
(2) How do one seprate Free pages from registered user pages ?? After login is successfull

Plz. reply .

With Warm Regrads,
Anurag Singh
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.