Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 18:37

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Register script funzt nicht

Discussion on Register script funzt nicht within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1

 
Crypt3c's Avatar
 
elite*gold: 1502
Join Date: Jun 2013
Posts: 500
Received Thanks: 78
Unhappy Register script funzt nicht

hey habe nen register script geschrieben was aber leider nicht funzt :/ kann jemand mal drüberschauen? Errors erscheinen auch keine.

functions.php
PHP Code:
<?php

$server 
"127.0.0.1:3307";
$user "root";
$password "";
$_data "_data";
$_db "_db";
$_auth "_auth";
$_post "_post";
$pwsalt "phoohie1yaihooyaequae7PuiWoeNgahjieth3ru3yeeghaepahb7aeYaipe2we6zii6mai6uweig8siasheinoungeoyeiLohShi2xoh2xi8ooxee9ahpiehahc9Phe";

$con mysqli_connect($server$user$password) or exit(mysqli_error());

function 
con_data () {
    global 
$con$_data;
    
mysqli_select_db($con$_data) or exit(mysqli_error());
}

function 
con_db () {
    global 
$con$_db;
    
mysqli_select_db($con$_db) or exit(mysqli_error());
}

function 
con_auth () {
    global 
$con$_auth;
    
mysqli_select_db($con$_auth) or exit(mysqli_error());
}

function 
con_post () {
    global 
$con$_post;
    
mysqli_select_db($con$_post) or exit(mysqli_error());
}

?>
register.php
PHP Code:
<link href="css\styles.css" rel="stylesheet" type="text/css" />
<?php include ("footer.php"); ?>
<?php 
include ("navigation.php"); ?>
<?php 
include ("slideshow.php"); ?>
<?php 
include ("functions.php"); ?>
<div class="content">

<?php

con_auth
();

if(isset(
$_GET['register'])) {
    
$submit $_POST ['submit'];
    
$user_id $_POST ['user_id'];
    
$password $_POST ['password'];
    
$password2 $_POST ['password2'];
    
$email $_POST ['email'];


    if (
$submit) {

        if (empty(
$_POST['user_id'])) {
            echo 
"<br> [ERROR] Please fill in a username! <br>";
            
?>
            <meta http-equiv='refresh' content='5' ; URL=register.php">
            <?php
        
} elseif (empty($_POST['password'])) {
            echo 
"<br> [ERROR] Please fill in a password! <br>";
            
?>
            <meta http-equiv='refresh' content='5' ; URL=register.php">
            <?php
        
} elseif (empty($_POST['email'])) {
            echo 
"<br> [ERROR] Please fill in a e-mail! <br>";
            
?>
            <meta http-equiv='refresh' content='5' ; URL=register.php">

            }
            <?php
            
die;

            if ((
$_POST['password']) != ($_POST['password2'])) {
                echo 
"<br> [ERROR] Password must the same as Repeat Password!<br>";

                
?>

                <meta http-equiv='refresh' content='5' ; URL=register.php">

                <?php
                
die;
            }


            
$con = new mysqli($server$user$password$db_auth);

            
$mailresult "SELECT * FROM bg_user WHERE email = '$email'";
            
$mailres $con->query($mailresult);


            if (
$mailres->num_rows 0) {
                echo 
"<br> [ERROR] E-mail is already linked to another account. Please choose a new e-mail! <br>";
                
?>

                <meta http-equiv='refresh' content='5' ; URL=register.php">

                <?php
                
die;
            }


            
$user_result "SELECT * FROM bg_user WHERE user_id = '" $user_id "';";
            
$userres $con->query($user_result);

            If (
$userres->num_rows 0) {
                echo 
" <br> [ERROR] Accountname is in use! Please choose another account name!  ";
                
?>

                <meta http-equiv='refresh' content='5' ; URL=register.php">

                <?php
                
die;
            } else {

                
$cryptpasswd hash("sha256"$user_id $salt $password);

                
$queryreg mysqli_query("INSERT INTO bg_user (user_id, passwd, email)
                                VALUES ('
$user_id', '$cryptpasswd', '$email')");

                echo 
" <br>Succes ! Account created ! <br>";

            }

        }

    }
}

?>

<br/>


<form action='register.php' method='POST'>
    Username:<br/>
    <input type='text' class="texta"  name='user_id' size="30" maxlength="12">
    <br/>
    Password:<br/>
    <input type='password' class="texta"  name='password' size="30" maxlength="12">
    <br/>
    Repeat Password:<br/>
    <input type='password' class="texta" name='password2' size="30" maxlength="12">
    <br/>
    Email:<br/>
    <input type='text' class="texta" name='email' size="30" maxlength="12">
    <br>
    <br/>
    <input type='submit' class="buttonz" name='submit' style='padding:0px; padding-right: 0px; font-size:14px;  ' value=' Register '>
</form>

</div>
Crypt3c is offline  
Old 03/03/2016, 16:57   #2
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,407
Received Thanks: 2,024
Bist du sicher, dass du 127.0.0.1:3307 willst? Normalerweise ist 3306 der standard Mysqlport.

Einfach mal die php Fehler einschalten in der php.ini und schon weiss man mehr.

Btw.: Nutz nicht soviel globale Variablen. Das kann man eleganter anders lösen.
NotEnoughForYou is offline  
Thanks
1 User
Old 03/03/2016, 17:07   #3


 
Barca x3's Avatar
 
elite*gold: 30
Join Date: Sep 2007
Posts: 735
Received Thanks: 196
Naja, MySQL kann doch von 3305-3308 laufen, wobei 3307 und 3308 meistens als SSL Ports genutzt werden wenn ich mich nicht irre. - Bzw wenn umgestellt auf jedem Port

Aber wie NotEnoughForYou bereits gesagt hat -> error_reporting(E_ALL)
Barca x3 is offline  
Thanks
1 User
Old 03/03/2016, 17:07   #4

 
Crypt3c's Avatar
 
elite*gold: 1502
Join Date: Jun 2013
Posts: 500
Received Thanks: 78
Quote:
Originally Posted by NotEnoughForYou View Post
Bist du sicher, dass du 127.0.0.1:3307 willst? Normalerweise ist 3306 der standard Mysqlport.

Einfach mal die php Fehler einschalten in der php.ini und schon weiss man mehr.

Btw.: Nutz nicht soviel globale Variablen. Das kann man eleganter anders lösen.
ja habe den port umgestellt da 3306 von skype benutzt wird, teste im moment nur auf meinem pc.

EDIT: Hab gerade im php error log geschaut, dort werden auch keine fehler ausgegeben

error_reporting steht auf E_ALL und immernoch nichts

Kann es vllt daran liegen das ich dies mit html eingebaut hab und es da irgendwie zu errors kommt?
<meta http-equiv='refresh' content='5' ; URL=register.php">

weil normal müsste es ja einen fehler ausgeben wenn ich zb in ein feld nichts eingebe doch es passiert nichts
Crypt3c is offline  
Old 03/03/2016, 20:16   #5

 
~ JWonderpig ~'s Avatar
 
elite*gold: 60
Join Date: Sep 2013
Posts: 1,427
Received Thanks: 248
Meines Wissens nach nutzt Skype Port 80.

Schon mal mit
PHP Code:
if (isset($submit)) { 
...

getestet?
~ JWonderpig ~ is offline  
Thanks
1 User
Old 03/03/2016, 23:55   #6

 
Crypt3c's Avatar
 
elite*gold: 1502
Join Date: Jun 2013
Posts: 500
Received Thanks: 78
Quote:
Originally Posted by ~ JWonderpig ~ View Post
Meines Wissens nach nutzt Skype Port 80.

Schon mal mit
PHP Code:
if (isset($submit)) { 
...

getestet?
hat leider nicht geholfen
Crypt3c is offline  
Old 03/04/2016, 03:10   #7
 
elite*gold: 0
Join Date: May 2015
Posts: 700
Received Thanks: 445
Wieso sollte $_GET['register'] gesetzt sein?

Im Allgemeinen: Mit echo schauen, welcher Teil vom Code ausgeführt wird und welcher nicht. Dann weißt du, was nicht klappt, und kannst das (z.B. eine Bedingung, die false ist, aber true sein sollte) genau untersuchen mit ganz vielen Ausgaben.
algernong is offline  
Thanks
1 User
Old 03/04/2016, 14:49   #8
 
elite*gold: 0
Join Date: Dec 2014
Posts: 276
Received Thanks: 84
Du verwendest POST, fragst aber, ob GET gesetzt ist..
Verwende anstatt if(isset($_GET['register'])) - if(isset($_POST['register']))
.Barone is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Register Script funzt nicht wie es soll..
06/15/2011 - Flyff Private Server - 6 Replies
Hallo, ich hab folgendes Problem: Ich benutze das Register script hier <h3 class="title"></h3> <div id="text"> <?php
NRG Mt2 Register Funzt nicht
10/10/2010 - Metin2 Private Server - 13 Replies
So wie der Titel sagt hab ich ein Problem mit dem Registrieren bei Nrgmt2.Wenn ich registen will steht da ständig einer der fragen wurde falsch beantwortet. Hab Kein Bock das die ganze zeit zu versuchen. Also hab ich die Umfrage gemacht. Welcher Server hat Gute Raten zum Yang Farmen und Nice Shops z.B. Man kann DPP oder Töpp usw. kaufen.BITTE KEINE HAMACHI SERVER !!!!
Script funzt nicht...
06/27/2008 - Guild Wars - 4 Replies
Hihoo... ich hab einige Problem! Ich habe mich heute mal mit AutoIt auseinander gesetzt und wollte mal ne eigene Methode schreiben um aus dem Aussenposten zu kommen. Also als erstes: Die Koordinaten für das Feld um andere Spieler einzuladen. Ich machn Screenshot, lad ihn mit Objectmapper und hohl mir also 2 Koordinaten darin. Die Koordinaten bilden doch nun ein Rechteck, in welchem der Bot irgendwo klickt oder? bei mir stimmt das nicht überein, er klickt oftmals zu hoch/tief. Woran lieft das?? ...



All times are GMT +2. The time now is 18:37.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.