3 posters
nk coding membership register
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°1
nk coding membership register
salam....nk mntk tlg ssape yg ade coding utk user register utk membership.....
OngBok- Moderators
- Gender : Male Number of posts : 729
Location : Dungun Terengganu
Job/hobbies : Pesara JKR
Registration date : 18/02/2009
- Post n°2
Re: nk coding membership register
kenapa tak guna joomla jer.
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°3
Re: nk coding membership register
jom la ade dtbase php mysql x???sy xbape sgt dng jom la
johnburn- Moderators
- Gender : Male Number of posts : 755
Location : Terengganu
Registration date : 07/03/2009
- Post n°4
Re: nk coding membership register
http://www.joomla.org/about-joomla.html
OngBok- Moderators
- Gender : Male Number of posts : 729
Location : Dungun Terengganu
Job/hobbies : Pesara JKR
Registration date : 18/02/2009
- Post n°5
Re: nk coding membership register
joomla memang guna php/mysql
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°6
Re: nk coding membership register
lect sy xksi la guna joomla..sy dah wat coding member tp ade mslh la...xtau la nape ade error
johnburn- Moderators
- Gender : Male Number of posts : 755
Location : Terengganu
Registration date : 07/03/2009
- Post n°7
Re: nk coding membership register
ape mslh die?
ade pe2 error yg kuar ke?
bleh bg code sini nk tgk
ade pe2 error yg kuar ke?
bleh bg code sini nk tgk
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°8
Re: nk coding membership register
sume page ade probz....die tls no databse selected...
Parse error: parse error, unexpected $ in c:\phpdev5\www\member\memberspage.php on line 34
Parse error: parse error, unexpected T_STRING in c:\phpdev5\www\member\login.php on line 19
Parse error: parse error, unexpected $ in c:\phpdev5\www\member\memberspage.php on line 34
Parse error: parse error, unexpected T_STRING in c:\phpdev5\www\member\login.php on line 19
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°9
Re: nk coding membership register
- Code:
# phpMyAdmin MySQL-Dump
# version 2.3.0-rc3
# http://phpwizard.net/phpMyAdmin/
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Generation Time: Oct 12, 2009 at 10:26 AM
# Server version: 4.00.00
# PHP Version: 4.2.2
# Database : `member`
# --------------------------------------------------------
#
# Table structure for table `user`
#
CREATE TABLE user (
userid int(10) NOT NULL auto_increment,
username varchar(255) NOT NULL default '',
password varchar(255) NOT NULL default '',
email varchar(255) NOT NULL default '',
name varchar(25) NOT NULL default '',
PRIMARY KEY (userid),
UNIQUE KEY username (username)
) TYPE=MyISAM;
#
# Dumping data for table `user`
#
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°10
Re: nk coding membership register
for registration.php
- Code:
<form name="login" method="post" action="register.php">
<table border="0" width="225" align="center">
<tr>
<td width="219" bgcolor="#999999">
<p align="center"><font color="white"><span style="font-size:12pt;"><b>Registration</b></span></font></p>
</td>
</tr>
<tr>
<td width="219">
<table border="0" width="282" align="center">
<tr>
<td width="116"><span style="font-size:10pt;">Name:</span></td>
<td width="156"><input type="text" name="name" maxlength="100"></td>
</tr>
<tr>
<td width="116"><span style="font-size:10pt;">Email:</span></td>
<td width="156"><input type="text" name="email" maxlength="100"></td>
</tr>
<tr>
<td width="116"><span style="font-size:10pt;">Username:</span></td>
<td width="156"><input type="text" name="username"></td>
</tr>
<tr>
<td width="116"><span style="font-size:10pt;">Password:</span></td>
<td width="156"><input type="password" name="password"></td>
</tr>
<tr>
<td width="116"> </td>
<td width="156">
<p align="right"><input type="submit" name="submit" value="Submit"></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="219" bgcolor="#999999"> </td>
</tr>
</table>
</form>
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°11
Re: nk coding membership register
for register.php
- Code:
<?PHP
//Database Information
$dbhost = "localhost";
$dbname = "your database name";
$dbuser = "username";
$dbpass = "yourpass";
//Connect to database
mysql_connect ( $localhost)or die("Could not connect: ".mysql_error());
mysql_select_db($member) or die(mysql_error());
$name = $_POST['name'];
$email = $_POST['email'];
$username = $_POST['username'];
$password = md5($_POST['password']);
// lets check to see if the username already exists
$checkuser = mysql_query("SELECT username FROM user WHERE username='$username'");
$username_exist = mysql_num_rows($checkuser);
if($username_exist > 0){
echo "I'm sorry but the username you specified has already been taken. Please pick another one.";
unset($username);
include 'register.html';
exit();
}
// lf no errors present with the username
// use a query to insert the data into the database.
$query = "INSERT INTO user (name, email, username, password)
VALUES('$name', '$email', '$username', '$password')";
mysql_query($query) or die(mysql_error());
mysql_close();
echo "You have successfully Registered";
// mail user their information
$yoursite = ‘www.blahblah.com’;
$webmaster = ‘yourname’;
$youremail = ‘youremail’;
$subject = "You have successfully registered at $yoursite...";
$message = "Dear $name, you are now registered at our web site.
To login, simply go to our web page and enter in the following details in the login form:
Username: $username
Password: $password
Please print this information out and store it for future reference.
Thanks,
$webmaster";
mail($email, $subject, $message, "From: $yoursite <$youremail>\nX-Mailer:PHP/" . phpversion());
echo "Your information has been mailed to your email address.";
?>
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°12
Re: nk coding membership register
for login.html
- Code:
<form name="login" method="post" action="login.php">
<table border="0" width="225" align="center">
<tr>
<td width="219" bgcolor="#999999">
<p align="center"><font color="white"><span style="font-size:12pt;"><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="219">
<table border="0" width="220" align="center">
<tr>
<td width="71"><span style="font-size:10pt;">Username:</span></td>
<td width="139"><input type="text" name="username"></td>
</tr>
<tr>
<td width="71"><span style="font-size:10pt;">Password:</span></td>
<td width="139"><input type="password" name="password"></td>
</tr>
<tr>
<td width="71"> </td>
<td width="139">
<p align="right"><input type="submit" name="submit" value="Submit"></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="219" bgcolor="#999999"><font color="white">Not Registered? </font><a href="register.html" target="_self"><font color="white">Register</font></a><font color="white"> </font><b><i><font color="white">Now!</font></i></b></td>
</tr>
</table>
</form>
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°13
Re: nk coding membership register
for login.php
- Code:
<?php
//Database Information
$dbhost = "localhost";
$dbname = "your database name";
$dbuser = "username";
$dbpass = "yourpass";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POST[‘username’];
$password = md5($_POST[‘password’]);
$query = “select * from users where username=’$username’ and password=’$password’”;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = “Bad Login”;
include “login.html”;
} else {
$_SESSION[‘username’] = “$username”;
include “memberspage.php”;
}
?>
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°14
Re: nk coding membership register
coding nie sy amek kt tutorial php..
johnburn- Moderators
- Gender : Male Number of posts : 755
Location : Terengganu
Registration date : 07/03/2009
- Post n°15
Re: nk coding membership register
function login cmne?
pkai session ke cookies
ape yg prob? kuar error ke?
pkai session ke cookies
ape yg prob? kuar error ke?
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°16
Re: nk coding membership register
pakai session
for register...kuar error msg not databse is selected
- Code:
Parse error: parse error, unexpected T_STRING in c:\phpdev5\www\member\login.php on line 19
for register...kuar error msg not databse is selected
johnburn- Moderators
- Gender : Male Number of posts : 755
Location : Terengganu
Registration date : 07/03/2009
- Post n°17
Re: nk coding membership register
bleh bg code login.php x?
satu lg, tgk line 19 dlm login.php tu, pastikan ade semicolon (;) kt last line tu
satu lg, tgk line 19 dlm login.php tu, pastikan ade semicolon (;) kt last line tu
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°18
Re: nk coding membership register
- Code:
<?php
//Database Information
$dbhost = "localhost";
$dbname = "your database name";
$dbuser = "username";
$dbpass = "yourpass";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($member) or die(mysql_error());
session_start();
$username = $_POST[‘username’];
$password = md5($_POST[‘password’]);
$query = "select * from user where username=’$username’ and password=’$password’";
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "Bad Login";
include "login.html";
} else {
$_SESSION[‘username’] = "$username";
include "memberspage.php";
}
?>
johnburn- Moderators
- Gender : Male Number of posts : 755
Location : Terengganu
Registration date : 07/03/2009
- Post n°19
Re: nk coding membership register
try ganti bhgian:
tukar ngan ni:
- Code:
$query = "select * from user where username=’$username’ and password=’$password’";
tukar ngan ni:
- Code:
$query = "select * from user where username='".$username."' and password='".$password."'";