Forum Sementara Putera.com

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Forum Sementara Putera.com

Bersama kita perkemaskan forum ini sementara forum asal dalam pemulihan.

Forum putera dah kembali. Masalah sudah berjaya diselesaikan. Sila lawati http://forum.putera.com/tanya


3 posters

    nk coding membership register

    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty nk coding membership register

    Post by syira86 Sun Oct 11, 2009 3:48 pm

    salam....nk mntk tlg ssape yg ade coding utk user register utk membership..... Very Happy
    OngBok
    OngBok
    Moderators
    Moderators


    Gender : Male Number of posts : 729
    Location : Dungun Terengganu
    Job/hobbies : Pesara JKR
    Registration date : 18/02/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by OngBok Sun Oct 11, 2009 5:14 pm

    kenapa tak guna joomla jer.
    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Sun Oct 11, 2009 7:21 pm

    jom la ade dtbase php mysql x???sy xbape sgt dng jom la
    johnburn
    johnburn
    Moderators
    Moderators


    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by johnburn Sun Oct 11, 2009 9:00 pm

    http://www.joomla.org/about-joomla.html
    OngBok
    OngBok
    Moderators
    Moderators


    Gender : Male Number of posts : 729
    Location : Dungun Terengganu
    Job/hobbies : Pesara JKR
    Registration date : 18/02/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by OngBok Mon Oct 12, 2009 10:40 am

    joomla memang guna php/mysql
    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Mon Oct 12, 2009 12:45 pm

    lect sy xksi la guna joomla..sy dah wat coding member tp ade mslh la...xtau la nape ade error
    johnburn
    johnburn
    Moderators
    Moderators


    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by johnburn Mon Oct 12, 2009 12:47 pm

    ape mslh die?
    ade pe2 error yg kuar ke?
    bleh bg code sini nk tgk
    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Mon Oct 12, 2009 12:54 pm

    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
    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Mon Oct 12, 2009 12:55 pm

    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`
    #


    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Mon Oct 12, 2009 12:57 pm

    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">&nbsp;</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">&nbsp;</td>
        </tr>
    </table>
    </form>
    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Mon Oct 12, 2009 12:57 pm

    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.";

    ?>

    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Mon Oct 12, 2009 12:58 pm

    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">&nbsp;</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>


    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Mon Oct 12, 2009 12:59 pm

    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”;
    }

    ?>
    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Mon Oct 12, 2009 1:00 pm

    coding nie sy amek kt tutorial php..
    johnburn
    johnburn
    Moderators
    Moderators


    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by johnburn Mon Oct 12, 2009 1:01 pm

    function login cmne?
    pkai session ke cookies
    ape yg prob? kuar error ke?
    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Mon Oct 12, 2009 1:05 pm

    pakai session

    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
    johnburn
    Moderators
    Moderators


    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by johnburn Mon Oct 12, 2009 1:10 pm

    bleh bg code login.php x?
    satu lg, tgk line 19 dlm login.php tu, pastikan ade semicolon (;) kt last line tu
    avatar
    syira86
    Ahli Baharu
    Ahli Baharu


    Gender : Female Number of posts : 108
    Age : 38
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by syira86 Mon Oct 12, 2009 1:16 pm

    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
    johnburn
    Moderators
    Moderators


    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    nk coding membership register Empty Re: nk coding membership register

    Post by johnburn Mon Oct 12, 2009 1:19 pm

    try ganti bhgian:
    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."'";

    Sponsored content


    nk coding membership register Empty Re: nk coding membership register

    Post by Sponsored content


      Current date/time is Mon Nov 18, 2024 10:21 am