ArcEmu: Create Account - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Create Account

#1 User is offline   giantgnome 

  • Member
  • Pip
  • Group: Members
  • Posts: 18
  • Joined: 14-June 10
  • Gender:Male

Posted 16 July 2010 - 04:53 PM

Does anyone know a script that creates an account with out having to email me it kind of annoying to keep getting emailed.
0

#2 User is offline   iEzri 

  • < Ace of spades >
  • Group: Contributor
  • Posts: 1,692
  • Joined: 22-December 08
  • Gender:Female
  • Interests:I'm likely to cause mischief
  • Server OS:Linux

Posted 16 July 2010 - 05:39 PM

View Postgiantgnome, on 16 July 2010 - 04:53 PM, said:

Does anyone know a script that creates an account with out having to email me it kind of annoying to keep getting emailed.


rofl yes definately. aim is even worse lol ^^

but you might just use a php script to do what you are trying to do...

uh, ok i am kinda bored so watch this:

<? //account creation dummy code.
// omg ezri is so bored 2010
if(!isset($_POST['formSent']))
{
?>
	<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post">
		<!-- display formular here... -->
	</form>
<?
}
else
{
	mysql_connect($svr,$usr,$pw) or die(mysql_error());
	mysql_select_db($dbn) or die(mysql_error());

	//check for name
	if((mysql_query("SELECT COUNT(*) FROM `accounts` WHERE `login` = '".$_POST['name']."'")) > 0) {
		$error = "this name cannot be used..."; //break
	}
	elseif($_POST['name']==""){
		$error = "form filled out?";
	}
	else
	{ // everything there?
		mysql_query("INSERT INTO `accounts`(`login`, `password`, `email`, `flags`) VALUES('".$_POST['name']."', '".$_POST['passwort']."', '".$_POST['mail']."', '".$_POST['flags']."')") or die(mysql_error());
		// done?
	}
?>


now you might think "omg how did ezri get to be such an awesome php uberleet codah?!?" but i read books and tutorials.. i actually practice.. this for example took me about 6:28 minutes of my time (ok 6:42 to comment it and paste it into here) and ofc this is only dummy code and might not work at all, but it shows the basic principal... you can do it boi!

greets,
Posted Image I do not join. I lead.
0

#3 User is offline   iEzri 

  • < Ace of spades >
  • Group: Contributor
  • Posts: 1,692
  • Joined: 22-December 08
  • Gender:Female
  • Interests:I'm likely to cause mischief
  • Server OS:Linux

Posted 16 July 2010 - 06:05 PM

View Postdfighter, on 16 July 2010 - 06:01 PM, said:

wow and I thought you were busy working


like i told you somehow i didnt get to much, but i prepared some things for tomorrow already and i guess if i get up early i get on balance again. you see, thats the negative side about it, you have to beat yourself yourself :)

anyhow, someone check this and fix my errors! :)
Posted Image I do not join. I lead.
0

#4 User is offline   giantgnome 

  • Member
  • Pip
  • Group: Members
  • Posts: 18
  • Joined: 14-June 10
  • Gender:Male

Posted 16 July 2010 - 07:47 PM

View PostiEzri, on 16 July 2010 - 05:39 PM, said:

rofl yes definately. aim is even worse lol ^^

but you might just use a php script to do what you are trying to do...

uh, ok i am kinda bored so watch this:

<? //account creation dummy code.
// omg ezri is so bored 2010
if(!isset($_POST['formSent']))
{
?>
	<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post">
		<!-- display formular here... -->
	</form>
<?
}
else
{
	mysql_connect($svr,$usr,$pw) or die(mysql_error());
	mysql_select_db($dbn) or die(mysql_error());

	//check for name
	if((mysql_query("SELECT COUNT(*) FROM `accounts` WHERE `login` = '".$_POST['name']."'")) > 0) {
		$error = "this name cannot be used..."; //break
	}
	elseif($_POST['name']==""){
		$error = "form filled out?";
	}
	else
	{ // everything there?
		mysql_query("INSERT INTO `accounts`(`login`, `password`, `email`, `flags`) VALUES('".$_POST['name']."', '".$_POST['passwort']."', '".$_POST['mail']."', '".$_POST['flags']."')") or die(mysql_error());
		// done?
	}
?>


now you might think "omg how did ezri get to be such an awesome php uberleet codah?!?" but i read books and tutorials.. i actually practice.. this for example took me about 6:28 minutes of my time (ok 6:42 to comment it and paste it into here) and ofc this is only dummy code and might not work at all, but it shows the basic principal... you can do it boi!

greets,

so that might not work but it shows the basics oof what i need to right? so i may need to somae little tweeks on it?
0

#5 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 16 July 2010 - 07:50 PM

View Postgiantgnome, on 16 July 2010 - 07:47 PM, said:

so that might not work but it shows the basics oof what i need to right? so i may need to somae little tweeks on it?

Yes, but as I said you could consider adding it by hand if it's for you and your friends only. That's a lot simpler and faster :)
"The demand for free goods is infinite."
0

#6 User is offline   iEzri 

  • < Ace of spades >
  • Group: Contributor
  • Posts: 1,692
  • Joined: 22-December 08
  • Gender:Female
  • Interests:I'm likely to cause mischief
  • Server OS:Linux

Posted 17 July 2010 - 03:00 PM

View Postdfighter, on 16 July 2010 - 07:50 PM, said:

That's a lot simpler and faster :P


ofc, but it wouldnt be that much fun... :P
Posted Image I do not join. I lead.
0

#7 User is offline   Bob Herman 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 452
  • Joined: 11-October 08
  • Gender:Male

Posted 17 July 2010 - 07:52 PM

Nooby question, but I've never seen this before:

if((mysql_query("SELECT COUNT(*) FROM `accounts` WHERE `login` = '".$_POST['name']."'")) > 0)


Does that actually work?
0

#8 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 17 July 2010 - 08:14 PM

View PostiEzri, on 17 July 2010 - 03:00 PM, said:

ofc, but it wouldnt be that much fun... :P

Ofc I prefer long and "complicated" fun myself :P
"The demand for free goods is infinite."
0

#9 User is offline   iEzri 

  • < Ace of spades >
  • Group: Contributor
  • Posts: 1,692
  • Joined: 22-December 08
  • Gender:Female
  • Interests:I'm likely to cause mischief
  • Server OS:Linux

Posted 18 July 2010 - 05:25 AM

View PostBob Herman, on 17 July 2010 - 07:52 PM, said:

Nooby question, but I've never seen this before:

if((mysql_query("SELECT COUNT(*) FROM `accounts` WHERE `login` = '".$_POST['name']."'")) > 0)


Does that actually work?


oh yes this might actually work:

The COUNT function returns the number of rows in a query.

The syntax for the COUNT function is:

    SELECT COUNT(expression)    FROM tables    WHERE predicates;


Note:

The COUNT function will only count those records in which the field in the brackets is NOT NULL.

For example, if you have the following table called suppliers:

    
Supplier_ID 	Supplier_Name 	State
    1 		IBM 		CA
    2 		Microsoft 	 
    3 		NVIDIA 	 


The result for this query will return 3.
    Select COUNT(Supplier_ID) from suppliers;


While the result for the next query will only return 1, since there is only one row in the suppliers table where the State field is NOT NULL.

    Select COUNT(State) from suppliers;


make a google for SELECT COUNT;
Posted Image I do not join. I lead.
0

#10 User is offline   giantgnome 

  • Member
  • Pip
  • Group: Members
  • Posts: 18
  • Joined: 14-June 10
  • Gender:Male

Posted 23 July 2010 - 08:54 PM

This doesn't work at all btw it doesn't show up on my website except for as text i did everything that i use to put other codes in and it didnt work
1

#11 User is offline   Doggie52 

  • arcemu feedback police
  • PipPipPip
  • Group: Members
  • Posts: 297
  • Joined: 09-October 08
  • Gender:Male
  • Location:Sweden
  • Interests:web designing, web programming, wow databases, game- and webservers
  • Server OS:Windows

Posted 24 July 2010 - 01:35 PM

View Postgiantgnome, on 23 July 2010 - 08:54 PM, said:

This doesn't work at all btw it doesn't show up on my website except for as text i did everything that i use to put other codes in and it didnt work

To run PHP scripts you need a webserver with PHP support installed. I suggest installing http://www.apachefri...g/en/xampp.html - it's easy to use and simple to install.
1

#12 User is offline   iEzri 

  • < Ace of spades >
  • Group: Contributor
  • Posts: 1,692
  • Joined: 22-December 08
  • Gender:Female
  • Interests:I'm likely to cause mischief
  • Server OS:Linux

Posted 28 March 2011 - 09:06 PM

ok lets make this even more simple by adding even more description to it... :)

<? //account creation dummy code.

/******************************************************************/

//Database Definition

$svr = '';
$usr = '';
$pw  = '';
$dbn = '';

//flags config
// 8 is classic? 24 is wotlk ??

$flags = 24; 


/******************************************************************/

/* The form has not yet been sent, that is why we display a 
   html form to let the user input his credentials. In this case
   it is a username and a password.
 */

if(!isset($_POST['formSent'])) 
{
?>
        <form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post"> <!-- the actual formular calling itself on submit -->
<input type="text" id="usrname" value="input your Username here!" onclick="this.value='';"><br>
<input type="text" id="emailaddr" value="input your email here!" onclick="this.value='';"><br>
<input type="text" id="password" value="input your Password here!" onclick="this.value='';"><br>
<input type="submit" value="Submit your data!"><br>
        </form>
<?
}
else // the form was sent
{
        mysql_connect($svr,$usr,$pw) or die(mysql_error()); // we connect to the mysql server
        mysql_select_db($dbn) or die(mysql_error()); // we choose our db from the mysql server

        //check for name. if name already there then chrrr chrrr...
        if((mysql_query("SELECT COUNT(*) FROM `accounts` WHERE `login` = '".$_POST['usrname']."'")) > 0) {
                $error = "this name cannot be used..."; //break
        }
        elseif($_POST['usrname']==""){ // we didnt get a username ?
                $error = "form filled out?";
        }
        else
        { // seems everything's there...
                mysql_query("INSERT INTO `accounts`(`login`, `password`, `email`, `flags`) VALUES('".$_POST['usrname']."', '".$_POST['password']."', '".$_POST['mailaddr']."', '".$flags."')") or die(mysql_error());

                // done? cereals now ?
        }

//bye

?>

Posted Image I do not join. I lead.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users