SQL hulp

Gestart doorBremdecoolste35 reacties121 weergaven

36 berichten · pagina 1 van 3

Bremdecoolste

Lid · Topicstarter

Berichten
1.783
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hey,

Ik heb nu een andere geprobeerd, alleen die werkt ook niet, Ik zal hem wel even laten zien, ik heb de regsiter.php, login.php en index.php in de map "login" gezet, en in de map login heb ik "includes" gezet, alleen hij werkt niet biggrin
config.php;
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR] 
[COLOR= #FF8000]// start the session before any output. [/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR] 
 
[COLOR= #FF8000]// Set the folder for our includes [/COLOR]
[COLOR= #0000BB]$sFolder[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]login[/COLOR][COLOR= #007700];[/COLOR]  
 
[COLOR= #FF8000]/*************** 
  Database Connection  
    You will need to change the user (user)  
    and password (password) to what your database information uses.  
    Same with the database name if you used something else. 
****************/[/COLOR] 
[URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]159.253.5.5[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]minecaft_brem[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Unable to connect to the database: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR] 
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]minecaft_login[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Unable to switch to the database: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR] 
 
[COLOR= #FF8000]/*************** 
  password salts are used to ensure a secure password 
  hash and make your passwords much harder to be broken into 
  Change these to be whatever you want, just try and limit them to 
  10-20 characters each to avoid collisions.  
****************/[/COLOR] 
[URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]SALT1[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]24859f@#$#@$[/COLOR][COLOR= #007700]);[/COLOR] 
[URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]SALT2[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]^&@#_-=+Afda$#%[/COLOR][COLOR= #007700]);[/COLOR] 
 
[COLOR= #FF8000]// require the function file [/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]DOCUMENT_ROOT[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #0000BB]$sFolder[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]/includes/functions.php[/COLOR][COLOR= #007700]);[/COLOR] 
 
[COLOR= #FF8000]// default the error variable to empty. [/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]error[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR] 
 
[COLOR= #FF8000]// declare $sOutput so we do not have to do this on each page. [/COLOR]
[COLOR= #0000BB]$sOutput[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR] 
?>
functions.php;
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR] 
 
[COLOR= #FF8000]/*********** 
  bool createAccount (string $pUsername, string $pPassword) 
    Attempt to create an account for the passed in  
    username and password. 
************/[/COLOR] 
[COLOR= #007700]function[/COLOR] createAccount[COLOR= #007700]([/COLOR][COLOR= #0000BB]$pUsername[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pPassword[/COLOR][COLOR= #007700]) {[/COLOR] 
  [COLOR= #FF8000]// First check we have data passed in. [/COLOR]
  [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pUsername[/COLOR][COLOR= #007700]) && ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pPassword[/COLOR][COLOR= #007700])) {[/COLOR] 
    [COLOR= #0000BB]$uLen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pUsername[/COLOR][COLOR= #007700]);[/COLOR] 
    [COLOR= #0000BB]$pLen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pPassword[/COLOR][COLOR= #007700]);[/COLOR] 
     
    [COLOR= #FF8000]// escape the $pUsername to avoid SQL Injections [/COLOR]
    [COLOR= #0000BB]$eUsername[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pUsername[/COLOR][COLOR= #007700]);[/COLOR] 
    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT username FROM users WHERE username = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$eUsername[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]" LIMIT 1"[/COLOR][COLOR= #007700];[/COLOR] 
 
    [COLOR= #FF8000]// Note the use of trigger_error instead of or die. [/COLOR]
    [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Query Failed: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR] 
 
    [COLOR= #FF8000]// Error checks (Should be explained with the error) [/COLOR]
    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$uLen[/COLOR] [COLOR= #007700]<=[/COLOR] [COLOR= #0000BB]4[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$uLen[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]11[/COLOR][COLOR= #007700]) {[/COLOR] 
      [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]error[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]"Username must be between 4 and 11 characters."[/COLOR][COLOR= #007700]; 
    }[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$pLen[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]6[/COLOR][COLOR= #007700]) {[/COLOR] 
      [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]error[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]"Password must be longer then 6 characters."[/COLOR][COLOR= #007700]; 
    }[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR] 
      [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]error[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]"Username already exists."[/COLOR][COLOR= #007700]; 
    }[/COLOR][URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] 
      [COLOR= #FF8000]// All errors passed lets 
      // Create our insert SQL by hashing the password and using the escaped Username. [/COLOR]
      [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO users (`username`, `password`) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$eUsername[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] hashPassword[COLOR= #007700]([/COLOR][COLOR= #0000BB]$pPassword[/COLOR][COLOR= #007700],[/COLOR] SALT1[COLOR= #007700],[/COLOR] SALT2[COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]");"[/COLOR][COLOR= #007700];[/COLOR] 
       
      [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Query Failed: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR] 
       
      [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) {[/COLOR] 
        [URL="http://www.php.net/return"]return[/URL] true[COLOR= #007700]; 
      }   
    } 
  }[/COLOR] 
   
  [URL="http://www.php.net/return"]return[/URL] false[COLOR= #007700]; 
}[/COLOR] 
 
[COLOR= #FF8000]/*********** 
  string hashPassword (string $pPassword, string $pSalt1, string $pSalt2) 
    This will create a SHA1 hash of the password 
    using 2 salts that the user specifies. 
************/[/COLOR] 
[COLOR= #007700]function[/COLOR] hashPassword[COLOR= #007700]([/COLOR][COLOR= #0000BB]$pPassword[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pSalt1[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"2345#$%@3e"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pSalt2[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"taesa%#@2%^#"[/COLOR][COLOR= #007700]) {[/COLOR] 
  [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pSalt2[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$pPassword[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$pSalt1[/COLOR][COLOR= #007700])); 
}[/COLOR] 
 
[COLOR= #FF8000]/*********** 
  bool loggedIn 
    verifies that session data is in tack 
    and the user is valid for this session. 
************/[/COLOR] 
[COLOR= #007700]function[/COLOR] loggedIn[COLOR= #007700]() {[/COLOR] 
  [COLOR= #FF8000]// check both loggedin and username to verify user. [/COLOR]
  [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]loggedin[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]])) {[/COLOR] 
    [URL="http://www.php.net/return"]return[/URL] true[COLOR= #007700]; 
  }[/COLOR] 
   
  [URL="http://www.php.net/return"]return[/URL] false[COLOR= #007700]; 
}[/COLOR] 
 
[COLOR= #FF8000]/*********** 
  bool logoutUser  
    Log out a user by unsetting the session variable. 
************/[/COLOR] 
[COLOR= #007700]function[/COLOR] logoutUser[COLOR= #007700]() {[/COLOR] 
  [COLOR= #FF8000]// using unset will remove the variable 
  // and thus logging off the user. [/COLOR]
  [URL="http://www.php.net/unset"]unset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]);[/COLOR] 
  [URL="http://www.php.net/unset"]unset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]loggedin[/COLOR][COLOR= #007700]]);[/COLOR] 
   
  [URL="http://www.php.net/return"]return[/URL] true[COLOR= #007700]; 
}[/COLOR] 
 
[COLOR= #FF8000]/*********** 
  bool validateUser 
    Attempt to verify that a username / password 
    combination are valid. If they are it will set 
    cookies and session data then return true.  
    If they are not valid it simply returns false.  
************/[/COLOR] 
[COLOR= #007700]function[/COLOR] validateUser[COLOR= #007700]([/COLOR][COLOR= #0000BB]$pUsername[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pPassword[/COLOR][COLOR= #007700]) {[/COLOR] 
  [COLOR= #FF8000]// See if the username and password are valid. [/COLOR]
  [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT username FROM users  
    WHERE username = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pUsername[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]" AND password = "[/COLOR] [COLOR= #007700].[/COLOR] hashPassword[COLOR= #007700]([/COLOR][COLOR= #0000BB]$pPassword[/COLOR][COLOR= #007700],[/COLOR] SALT1[COLOR= #007700],[/COLOR] SALT2[COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]" LIMIT 1"[/COLOR][COLOR= #007700];[/COLOR] 
  [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Query Failed: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR] 
   
  [COLOR= #FF8000]// If one row was returned, the user was logged in! [/COLOR]
  [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR] 
    [COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);[/COLOR] 
    [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR] 
    [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]loggedin[/COLOR][COLOR= #007700]] =[/COLOR] true[COLOR= #007700];[/COLOR] 
       
    [URL="http://www.php.net/return"]return[/URL] true[COLOR= #007700]; 
  }[/COLOR] 
   
   
  [URL="http://www.php.net/return"]return[/URL] false[COLOR= #007700]; 
}[/COLOR] 
?>
En tenslotte, index.php (er zijn er meer, alleen deze glitcht)
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR] 
[URL="http://www.php.net/require"]require[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]DOCUMENT_ROOT[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]login/config.php[/COLOR][COLOR= #007700]);[/COLOR] 
 
[COLOR= #0000BB]$sOutput[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<div id="index-body">[/COLOR][COLOR= #007700];[/COLOR] 
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR]loggedIn[COLOR= #007700]()) {[/COLOR] 
  [COLOR= #0000BB]$sOutput[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<h2>Welcome!</h2> 
    Hello, [/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000] how are you today?<br /> 
    <h4>Would you like to <a href="login.php?action=logout">Logout?</a></h4>[/COLOR][COLOR= #007700]; 
}[/COLOR][URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] 
  [COLOR= #0000BB]$sOutput[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<h2>Welcome to our site</h2><br /> 
    <h4>Would you like to <a href="login.php">login</a>?</h4> 
    <h4>Create a new <a href="register.php">account</a>?</h4>[/COLOR][COLOR= #007700]; 
 
}[/COLOR] 
[COLOR= #0000BB]$sOutput[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];[/COLOR] 
 
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sOutput[/COLOR][COLOR= #007700];[/COLOR] 
?>
Live demo: http://minecraftclub.eu/login/index.php (denk ik, ik ga er heen via de DirectAdmin...)

Alvast bedankt!
Bram
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
En nu de rest, geef het bestandje waar de query in staat.

Login.php bijvoorbeeld, hier hebben we niets aan
0
Bremdecoolste

Lid · Topicstarter

Berichten
1.783
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb de ww enzo er niet ingezet, moet ik alles wel erin zetten, behalve mijn ww?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Bvanhaaren schreef:
Ik heb de ww enzo er niet ingezet, moet ik alles wel erin zetten, behalve mijn ww?
Werkt register.php niet of login.php?

En Jezus, die is geen goede fouten afhandeling
0
Bremdecoolste

Lid · Topicstarter

Berichten
1.783
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
allebei niet

toevoeging op 1 oktober 2012, 221037:
En waarom is het slechte fouten handeling?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Bvanhaaren schreef:
allebei niet
toevoeging op 1 oktober 2012, 221037:
En waarom is het slechte fouten handeling?

Het stopt het script.

Stel je voor dat je een snee krijgt op je boven arm, en de rest van je arm gaat doodemo
Ga eens wat debuggen. Wat waardes echoën
0
Bremdecoolste

Lid · Topicstarter

Berichten
1.783
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oke, maar ik heb nog steeds geen antwoord op wat ik verder fout doe als hij registeerd
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Op welke manier word die functie aangeroepen?

Waar heb je het script vandaan?
0
Bremdecoolste

Lid · Topicstarter

Berichten
1.783
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sevvlor schreef:
Op welke manier word die functie aangeroepen?
Via dit toch?:
//If everything is okay lets register this user


$insert = mysql_query("INSERT INTO users (username, password, email) VALUES ($username, $password, $email)");

if(!$insert){

die("Theres little problem: ".mysql_error());

}


echo $username.", you are now registered. Thank you!<br><a href=login.php>Login</a> | <a href=index.php>Index</a>";


}


switch($act){


default;

register_form();

break;


case "register";

register();

break;


}
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Heb je dit zelf gemaakt?

Ik zie nergens een post check zoals

if($_SERVER[REQUEST_METHOD] == POST){


En de functie gaat niet werken aangezien er geen waardes worden door gegeven.

$_POST
0
Bremdecoolste

Lid · Topicstarter

Berichten
1.783
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sevvlor schreef:
Heb je dit zelf gemaakt?

Ik zie nergens een post check zoals
if($_SERVER[REQUEST_METHOD] == POST){


En de functie gaat niet werken aangezien er geen waardes worden door gegeven.

$_POST

Waar zou dat dan moeten? Ik ben nog maar een beginner met PHP
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Bvanhaaren schreef:
Eerdere citaten tonen
Sevvlor schreef:
Heb je dit zelf gemaakt?
Ik zie nergens een post check zoals

if($_SERVER[REQUEST_METHOD] == POST){


En de functie gaat niet werken aangezien er geen waardes worden door gegeven.

$_POST
Waar zou dat dan moeten? Ik ben nog maar een beginner met PHP

Heb je dit zelf gemaakt?
0
Bremdecoolste

Lid · Topicstarter

Berichten
1.783
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Half, ik heb alles gekeken op internet, heb gekeken wat alles doet, heb het uit mn hoofd proberen te maken, had ik redelijk goed gedaan, ik "keek na" op die tut, en heb toen alles verbeterd, zo leer ik toch nog yummie
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan heb je echt een hele (echt hele) slechte tutorial gevolgd wink
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Ga naar phptuts.nl en leer daar je PHP-kennis.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren