The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 11 of 11

Thread: login script????

  1. #1

    login script????

    hey all,

    i'm trying to have a login script which will do multiple things when the submit button is pressed in flash.
    - here is what i am wanting to have:
    //-------------------------------------login script-----------------------------------------------\\
    - if the user is a new user then insert their name and email into the users tbl
    - if the user is already a member then check that and log them in when they type their name and email
    - and also checks the user (existing members) to see if they have seen specific questions or any questions from the database.

    //----------------------------------------------user_question script---------------------------\\
    - when the user has answered the question and is submitting their answer i need a script on that submit button so that it sends the information which user, which question, and whether or not they answered it correctly. this all has to be entered into my database. so that the next time they play the game they will not recieve the viewed questions.
    - there will be a pool of around 500 questions in the database which i will need randomized using the RAND() function but it will have to be so that the same question cannot come up twice to the same user.

    i hope this is enough information please help or guide me in the right way...

  2. #2
    I can create the login part for you, are you using PHP and MySQL?

  3. #3

    yes i am using php and mysql and flash...that would be great if you could! Thankyou!

    if u need more details please let me know

    Thankyou again

  4. #4
    well I will just create a simple example one and then send you a .zip then you can copy it into your own one and change it to suit you. if thats ok?

  5. #5
    I may be wrong but your description of what you need seem rather like a clients request. It seems liek your gettign sombody to do the work for you and take all the credit, though I could be wrong but it sounds like a client request.
    Member #2 of the "I wont critique Timmytot's designs anymore" club.

  6. #6
    seb has a good point, what is the purpose of this as I dont want to create the whole thing only to find out you are selling the software etc etc, so until the explanation I supposes you could adapt the tutorial http://www.kirupa.com/developer/acti...entication.htm

  7. #7
    i know it may sound like a client request...its not though i'm actually trying to run a few tests of different applications and games for my server to see how fast they get and if i need to get a new server...in general its basically testing for myself and software and hardware and host...as yes eventually i will be needing to put client applications and what not on this server or a new one if needs be. But atm i'm testing every type of app and game platforms...long and tedious but has to be done. But thanks for the tutorial i'll take a look there and see what i can make from it...this is up to you evil drummer i'm not demanding it...its your choice what you do hoep to hear from you soon.

    ps.thanks for the tutorial

  8. #8
    ok we'll heres what i've come up with using that tutorial...i know i probably should have used a subquery but i wasn't sure about how to go about it...
    i keep getting this error which is stopping me adding anything to the users any ideas?
    Parse error: syntax error, unexpected T_VARIABLE in

    here is the code:

    PHP Code:
    <?php

    mysql_pconnect
    ("$host","$user","$pass") or die (mysql_error());
    mysql_select_db("$db") or die (mysql_error());

    $name $_POST['fname'];
    $email $_POST['email'];

    $query "SELECT * FROM users WHERE firstname = '$name' AND email = '$email'"
    $query1 "INSERT INTO users (`firstname`, `email`) VALUES ('$fname', '$email') WHERE email <> '$email'"

    $result mysql_query$query ) or die (mysql_error());
    $result1 mysql_query$query1 ) or die (mysql_error());

    $num mysql_num_rows$result1 );
    if (
    $num == 1){
        print 
    "status=Same user&checklog=1";
        } else {
        print 
    "status=New user&checklog=2";
    }
    }
    ?>

  9. #9
    that error is fixed and here is my new code but i still get another error here it is:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF (SELECT * FROM users WHERE firstname = '' AND email = '')' at line 1

    here is the code i am using:
    PHP Code:
    <?php

    mysql_pconnect
    ("$host","$user","$pass") or die (mysql_error());
    mysql_select_db("$db") or die (mysql_error());

    $name $_POST['fname'];
    $email $_POST['email'];

    $query "INSERT INTO users (`firstname`, `email`) VALUES ('$fname', '$email') IF (SELECT * FROM users WHERE firstname = '$name' AND email = '$email', )";
    //$query = "SELECT * FROM users WHERE firstname = '$name' AND email = '$email'"
    //$query1 = "INSERT INTO users (`firstname`, `email`) VALUES ('$fname', '$email') IF email <> '$email'"

    $result mysql_query$query ) or die (mysql_error());
    //$result1 = mysql_query( $query1 ) or die (mysql_error());

    $num mysql_num_rows$result );
    if (
    $num == 1){
        print 
    "status=Same user&checklog=1";
        } else {
        print 
    "status=New user&checklog=2";
    }



    ?>

  10. #10
    Why are you using an IF statement in your SQL?
    From reading it I am guessing you want it to insert the data if there are no results but I would reccomend doing it the PHP way, get the data and then in PHP create an if statemnt saying if their are no results then insert the data into the table.
    Did you get the login flash thing working then?

  11. #11
    yeh thats what i'm trying to do umm i'm kind of close but its the if statement in php i'm stuck on

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012