yasminlove1 Posted June 25, 2013 Share Posted June 25, 2013 Hello, I am dutch so i can`t understand everything...sorry.. but my problem is, i have a html index with a login and registration formulier, this works good.. but the formulier self does`nt works when you wan`t to login or registrate. Then come`s thera a rong page. this are my scripts, please help me, thank you very much: Index.html <!DOCTYPE php<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <title>Horselife</title> </head><body> <img src="http://s3.amazonaws.com/pizap_gallery/062413/medium/pizap.com10.223355115856975321372029466154.jpg" alt=Horselife/> <br><br> <h3>Welkom op Horselife!</h3> <img src="http://u.jimdo.com/www60/o/s1a8880590aa1f2a7/img/i26cb75cb4e3ecea6/1368381675/std/image.jpg" alt=Horselifewelkom/> <p>Horselife is een paardenspel waarin je net zoals in het echt een stal kunt runnen en met paarden wedstrijden rijden, fokken, trainen en nog veel meer.<br>Voor meer uitleg ga je naar 'uitleg'.</p> <div><html><title>Inloggen.</title><body><form action='loginv.php' method='POST'><table><tr><td>Gebruikersnaam:</td><td><input type='text' name='gebruikersnaam'></td></tr><tr><td>Stalnaam:</td><td><input type='text' name='stalnaam'></td></tr><tr><td>Wachtwoord:</td><td><input type='password' name='password'></td></tr><tr><td></td><td><input type='submit' value='Inloggen'></td></tr></table></form></body></html><html><title>Registratie.</title><body><form action='registreerv.php' method='POST'><table><tr><td>Gebruikersnaam:</td><td><input type='text' name='gebruikersnaam'></td></tr><tr><td>Stalnaam:</td><td><input type='text' name='stalnaam'></td></tr><tr><td>Naam paard:</td><td><input type='text' name='naam paard'></td></tr><tr><td>Ras:</td><td><input type='text' name='ras paard'></td></tr><tr><td>Geslacht:</td><td><input type='text' name='geslacht paard'></td></tr><tr><td>Wachtwoord:</td><td><input type='password' name='password'></td></tr><tr><td>Controle wachtwoord:</td><td><input type='password' name='passwordc'></td></tr><tr><td>E-mail:</td><td><input type='text' name='mail'></td></tr><tr><td></td><td><input type='submit' value='Aanmelden'></td></tr></table></form></body></html></div> <style type="text/css"> body { color: black; width: 828px; margin: auto; background-color: #FAEBD7 } </style> </body></html> connect.php <?php//connecting to the database$error = "Could not connect to the database";$con = mysql_connect('---','---','---') or die($error);mysql_select_db("---", $con) or die($error);?> login.php <html><title>Inloggen.</title><body><form action='loginv.php' method='POST'><table><tr><td>Gebruikersnaam:</td><td><input type='text' name='gebruikersnaam'></td></tr><tr><td>Wachtwoord:</td><td><input type='password' name='password'></td></tr><tr><td></td><td><input type='submit' value='Inloggen'></td></tr></table></form></body></html> loginv.php <?phpsession_start();if( $_SERVER['REQUEST_METHOD'] == 'POST') // Controle of er op de knop is gedrukt.{ if(!empty($_POST['gebruikersnaam']) AND !empty($_POST['password'])) // Controle of alles is ingevult. { include_once 'connect.php'; // Connectie met database. include_once 'uwx3g.php'; // Connectie salt page. $gebruikersnaam = mysql_real_escape_string($_POST['gebruikersnaam']); // Gevaren voor sql injectie weren dmv. mysql_real_....... $password = sha1(salt($_POST['password'])); // Hash en Salting van pw. $sql = ("SELECT gebruikersnaam, password FROM gebruikers WHERE gebruikersnaam='". $gebruikersnaam . "' AND password='" . $password . "'"); // Selecteer user waar de gebruiker overeenkomt met ingevoerde pas $uitvoer = mysql_query($sql); $controle = mysql_num_rows($uitvoer); //Uitvoer van inlog if($controle != 0) { //VERDERE VERWERKING. (DIT is aanjou, bijv. sessie ofziets? } else { header('Refresh: 2; url=login.php'); exit ('Verkeerde gebruikersnaam of wachtwoord.'); // Negatieve melding van ingevoerde gegevens. } } else { header('Refresh: 2; url=login.php'); exit ('U heeft een van de gegevens niet goed ingevuld.'); // Negatieve melding van ingevoerde gegevens. } }else{ header('Refresh: 2; url=login.php'); // Negatief op de verwerk pagina gekomen, direct terug verwijzen met gepaste melding. exit ('U bent op de verkeerde pagina gekomen, u wordt doorverwezen.');}?> registreren.php <html><title>Registratie.</title><body><form action='registreerv.php' method='POST'><table><tr><td>Gebruikersnaam:</td><td><input type='text' name='gebruikersnaam'></td></tr><tr><td>Wachtwoord:</td><td><input type='password' name='password'></td></tr><tr><td>Controle wachtwoord:</td><td><input type='password' name='passwordc'></td></tr><tr><td>E-mail:</td><td><input type='text' name='mail'></td></tr><tr><td></td><td><input type='submit' value='Aanmelden'></td></tr></table></form></body></html> registreerv.php <?php//Defineer functiefunction error($link){header('Refresh: 3; url=' . $link.php . '');}if($_SERVER['REQUEST_METHOD'] == 'POST') // Controle of er op de knop is geklikt.{ include_once 'connect.php'; // Connectie db. if(!empty($_POST['gebruikersnaam']) AND !empty($_POST['password']) AND !empty($_POST['passwordc']) AND !empty($_POST['mail'])) // Controle op invoeren { if(($_POST['password']) == ($_POST['passwordc'])) // Controle of controle pw overeenkomt met echte pw. { include_once 'uwx3g.php'; // Connectie met salt page. $gebruikersnaam = mysql_real_escape_string($_POST['gebruikersnaam']); //Data veilig maken voor sql injectie d.m.v. mysql_real..... $password = sha1(salt($_POST['password'])); //sha1 hash van pass. Inclusief salt. $mail = mysql_real_escape_string($_POST['mail']); $sql = ("SELECT gebruikersnaam FROM gebruikers WHERE gebruikersnaam='". $gebruikersnaam . "'"); // Controle op gebruikersnaam, zo ja een 1 else en 0 (zie controle bij de volgende if) $uitvoer = mysql_query($sql); //($row = mysql_fetch_assoc($get)) $controle = mysql_num_rows($uitvoer); if($controle == 0) // Als uitvoer is 0 registreren. { mysql_query("INSERT INTO gebruikers (id, gebruikersnaam, password, mail, datum) VALUES ('','" . $gebruikersnaam . "', '" . $password . "', '" . $mail . "', '" . now() . "')"); // Gebruiker in db plaatsen. header('Refresh: 4; url=login.php'); exit ('U bent succesvol aangemeld, u kunt nu inloggen.'); } else { header('Refresh: 2; url=registreren.php'); exit ('Verkeerde gebruikersnaam of wachtwoord.'); // Negatieve melding van ingevoerde gegevens. } } else { error(registreren.php); exit ('De ingevoerde gegevens kloppen niet, u heeft het controle wachtwoord verkeerd ingevuld.'); // Negatieve melding van ingevoerde gegevens. } } else { error(registreren.php); exit ('De ingevoerde gegevens kloppen niet, niet alles is ingevuld.'); // Negatieve melding van ingevoerde gegevens. } }else{ error(registreren.php); exit ('U bent op de verkeerde pagina gekomen, U wordt doorverwezen.');}?> uwx3g.php <?phpfunction salt($pass, $salt="7dy23kl6yw4bd9x0k3", $str=""){ $pass = str_replace(" ", "", $pass); $pass = strrev($pass); $arr[0] = strlen($pass); $arr[1] = strlen($salt); while($arr[0] > $arr[1] + 1) { $salt = $salt.$salt; $arr[1] = strlen($salt); } $split_len = floor(max($arr) / (min($arr) - 1)); $salt = explode(" ", chunk_split($salt, $split_len, " ")); array_pop($salt); $salt = array_reverse($salt); $j = $arr[0] > count($salt) ? $arr[0] : count($salt); for($i=0; $i<$j; $i++) { if(isset($pass{$i})) $str .= $pass{$i}; if(isset($salt[$i])) $str .= $salt[$i]; } return $str;}?> Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/ Share on other sites More sharing options...
yasminlove1 Posted June 26, 2013 Author Share Posted June 26, 2013 who can my also help with the session from loginv.php , i thought i know it, but i think i have it rong.. i just want that people can login and go to her own pages, just for everybody one page with almost the same information as the other people. My idea was a stable for them on a page and with an legenda that they also can see what the other people has on them stables, but they must can the same actions like training, buying... Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1437967 Share on other sites More sharing options...
rwhite35 Posted June 26, 2013 Share Posted June 26, 2013 try this. loginv.php: // replace $sql = ("SELECT gebruikersnaam, password FROM gebruikers WHERE gebruikersnaam='". $gebruikersnaam . "' AND password='" . $password . "'"); -- you are mixing string and literal quotes, nether is necessary $sql = ("SELECT gebruikersnaam, password FROM gebruikers WHERE gebruikersnaam=$gebruikersnaam AND password= $password); $controle = mysql_num_rows($uitvoer); //Uitvoer van inlog if($controle != 0) { //if $controle is >=1, nothing is happening here? Is that correct? //VERDERE VERWERKING. (DIT is aanjou, bijv. sessie ofziets? } else { //return to login with a urlencoded message $message = “Verkeerde gebruikersnaam of wachtwoord”; header('Location:login.php?mes='.$message); exit (); // Negatieve melding van ingevoerde gegevens. } Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438010 Share on other sites More sharing options...
yasminlove1 Posted June 26, 2013 Author Share Posted June 26, 2013 try this. loginv.php: // replace $sql = ("SELECT gebruikersnaam, password FROM gebruikers WHERE gebruikersnaam='". $gebruikersnaam . "' AND password='" . $password . "'"); -- you are mixing string and literal quotes, nether is necessary $sql = ("SELECT gebruikersnaam, password FROM gebruikers WHERE gebruikersnaam=$gebruikersnaam AND password= $password); $controle = mysql_num_rows($uitvoer); //Uitvoer van inlog if($controle != 0) { //if $controle is >=1, nothing is happening here? Is that correct? //VERDERE VERWERKING. (DIT is aanjou, bijv. sessie ofziets? } else { //return to login with a urlencoded message $message = “Verkeerde gebruikersnaam of wachtwoord”; header('Location:login.php?mes='.$message); exit (); // Negatieve melding van ingevoerde gegevens. } thank you, but i don`t see something chance when i wanna log in. Can you help me what session i must make? read my last post, please: who can my also help with the session from loginv.php , i thought i know it, but i think i have it rong.. i just want that people can login and go to her own pages, just for everybody one page with almost the same information as the other people. My idea was a stable for them on a page and with an legenda that they also can see what the other people has on them stables, but they must can the same actions like training, buying... Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438018 Share on other sites More sharing options...
rwhite35 Posted June 26, 2013 Share Posted June 26, 2013 I don't see where loginv.php has registered anything with the session. You start the session, but do not interact with it. You could register the $_POST variables like this session_start(); if(!empty($_POST['gebruikersnaam']) AND !empty($_POST['password']) { $_SESSION['naam'] = $_POST['gebruikersnaam']; $_SESSION['pass'] = $_POST['password']; } Now any script with session_start() will have $_SESSION['naam'] and $_SESSION['pass'] available to that script. Not sure how you intend to use the session variable, but this is how you would register $_POST data to the session. I think that is what you asking. Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438051 Share on other sites More sharing options...
yasminlove1 Posted June 26, 2013 Author Share Posted June 26, 2013 I don't see where loginv.php has registered anything with the session. You start the session, but do not interact with it. You could register the $_POST variables like this session_start(); if(!empty($_POST['gebruikersnaam']) AND !empty($_POST['password']) { $_SESSION['naam'] = $_POST['gebruikersnaam']; $_SESSION['pass'] = $_POST['password']; } Now any script with session_start() will have $_SESSION['naam'] and $_SESSION['pass'] available to that script. Not sure how you intend to use the session variable, but this is how you would register $_POST data to the session. I think that is what you asking. I think that that is not what i am looking for.. ? look, this is what i must fill in, the session after controle, under this: //VERDERE VERWERKING. (DIT is aanjou, bijv. sessie ofzoiets, i have fill something in but i don`t know if it can work with my require?: $controle = mysql_num_rows($uitvoer); //Uitvoer van inlog if($controle != 0) { //VERDERE VERWERKING. (DIT is aanjou, bijv. sessie ofziets? header('Location: Page1.html'); echo 'Je bent succesvol ingelogd, je wordt doorgestuurd. '; } else { header('Location: Index.html'); echo ('Verkeerde gebruikersnaam of wachtwoord.'); // Negatieve melding van ingevoerde gegevens. The person must come on a page that is only for her, but the next person must come too on a page what is too only for her, but they must have the same information and work on the page on one thing, the stable must be them own stable. And when somebody buy`s a horse, i want that all te pages refresh and say that that horse is selled. Do you understand it..? Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438053 Share on other sites More sharing options...
rwhite35 Posted June 27, 2013 Share Posted June 27, 2013 Yes, and sessions are the way you would do that. But you have to register each user who logs in with a session variable. And the way to do that is by user id. In your log in process, you will define a session var like this: session_start(); /* * data base query to get user id, user name, user password * once you have returned and defined a users "credentials", * you assign their credentials to a session variable */ $_SESSION['user_id'] = $user_id; $_SESSION['user_id']['user_name'].=$user_name; $_SESSION['user_id']['user_pass'].=$user_pass; // the session variable output would look something like Array ( [135] => Array // the outer array would be the users id ( [user_name] => Jane Doe // from the data base query [user_pass] => a45t67i912b332 // from the data base query ) ) In the head of each subsequent page, define local variables to present specific content to each user. session_start(); $array = $_SESSION['user_id']; foreach ($array as $key=>$value) { ${$key} = $value; //returns two local variables, $user_name and $user_pass } echo "Hello ".$user_name.", your stable is ready for your horse.<br>\n"; Hello Jane Doe, your stable is ready for your horse. Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438119 Share on other sites More sharing options...
yasminlove1 Posted June 27, 2013 Author Share Posted June 27, 2013 (edited) Yes, and sessions are the way you would do that. But you have to register each user who logs in with a session variable. And the way to do that is by user id. In your log in process, you will define a session var like this: session_start(); /* * data base query to get user id, user name, user password * once you have returned and defined a users "credentials", * you assign their credentials to a session variable */ $_SESSION['user_id'] = $user_id; $_SESSION['user_id']['user_name'].=$user_name; $_SESSION['user_id']['user_pass'].=$user_pass; // the session variable output would look something like Array ( [135] => Array // the outer array would be the users id ( [user_name] => Jane Doe // from the data base query [user_pass] => a45t67i912b332 // from the data base query ) ) In the head of each subsequent page, define local variables to present specific content to each user. session_start(); $array = $_SESSION['user_id']; foreach ($array as $key=>$value) { ${$key} = $value; //returns two local variables, $user_name and $user_pass } echo "Hello ".$user_name.", your stable is ready for your horse.<br>\n"; Hello Jane Doe, your stable is ready for your horse. This is only the loginv.php the first one and what is the two one? you start two times with session_star, so i think that you mean that the two one is for the index page? Thank you very much, i understand it what better right now about the pages where they must come. edit, so, my loginv.php is too much and i must do that gone and take this what you writed? Becouse i don`t started with $_SESSION but i started with if (SERVER . Edited June 27, 2013 by yasminlove1 Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438151 Share on other sites More sharing options...
MissMarisjuh Posted June 27, 2013 Share Posted June 27, 2013 (edited) May I can help you.Can you tell me your experience about your PHP programming-skills? Edited June 27, 2013 by MissMarisjuh Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438270 Share on other sites More sharing options...
yasminlove1 Posted June 28, 2013 Author Share Posted June 28, 2013 i know not more than the basic lessons... Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438333 Share on other sites More sharing options...
MissMarisjuh Posted June 28, 2013 Share Posted June 28, 2013 (edited) i know not more than the basic lessons... Can you explain about your skills? Array's? statements? Form-requesting....? The only thing you know... with basic PHP-experience, it can be takes months/year before you have a RPG game with Horses..... How long have you had experience about PHP? I can help you, but let be shure. I will not tell everything .... Edited June 28, 2013 by MissMarisjuh Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438345 Share on other sites More sharing options...
yasminlove1 Posted June 28, 2013 Author Share Posted June 28, 2013 I don`t understand what you say...? I am 14 years and i am learning about making a website with php and html, css and more. No, it must be this but than automatic : www.horselife1.jimdo.com It is very much work to do that with mail and typing, so i thought i could make it in a new version automatic, than can i do something else with the time that i had for it. No, you don`t have to tell everything, but now i am with a problem, but i don`t know what it is, look, here must be the problem somewhere: <?php //connecting to the database $error = "Could not connect to the database"; $connectie = mysql_connect($000webhost.com,'','') or die($error); mysql_select_db($db, $connectie) or die($error); ?> and here is a problem but i don`t know where..: <?php if(isset($_POST['registreer'])){ function email_validator($email){ if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$email)) {$geldig = 'ja'; } else{$geldig = 'nee';} return $geldig; } function email_check($email){ $email_query = "SELECT gebruiker_email FROM gebruiker WHERE gebruiker_email='".$email."';"; $email_sql = mysql_query($email_query)or die(mysql_error()); if(mysql_num_rows($email_sql) == 0) {$bezet = 'nee';} else{$bezet = 'ja' ;} return $bezet; } function gebruikersnaam_check($gebruikersnaam){ $gebruikersnaam_query = "SELECT gebruiker_naam FROM gebruiker WHERE gebruiker_naam='".$gebruikersnaam."';"; $gebruikersnaam_sql = mysql_query($gebruikersnaam_query)or die(mysql_error()); if(mysql_num_rows($gebruikersnaam_sql) == 0) {$bezet = 'nee' ;} else{$bezet = 'ja';} return $bezet; } if(trim($_POST['gebruikersnaam']) == ""){ echo 'U heeft geen gebruikersnaam ingevuld'; }elseif(gebruikersnaam_check($_POST['gebruikersnaam']) == 'ja'){ echo 'Deze gebruikersnaam is al in gebruik, kies a.u.b een ander.'; }elseif($_POST['wachtwoord1'] != $_POST['wachtwoord2']){ echo 'De opgegeven wachtwoorden komen niet overeen'; }elseif($_POST['wachtwoord1'] == ""){ echo 'Er zijn geen wachtwoord<b>en</b> opgegeven'; }elseif(email_validator($_POST['emailadres']) == 'nee'){ echo 'Het ingevulde emailadres is niet geldig'; }elseif(email_check($_POST['emailadres']) == 'ja'){ echo 'Er is al iemand geregistreerd met dit emailadres.'; }else{ $query = "INSERT INTO gebruiker (gebruiker_naam, gebruiker_wachtwoord, gebruiker_email) VALUES ('".mysql_real_escape_string($_POST['gebruikersnaam'])."', '".md5($_POST['wachtwoord1'])."', '".$_POST['emailadres']."');"; $sql = mysql_query($query)or die(mysql_error()); echo 'U bent succesvol aangemeld.:'; include('Index.html'); } }else{ ?> <form action="registreerv.php" method="POST"> <table> <tr><td>Gebruikersnaam:</td><td><input type="text" name="gebruikersnaam" value=""></td></tr> <tr><td>Stalnaam:</td><td><input type="text" name="stalnaam" value=""></td></tr> <tr><td>Naam paard:</td><td><input type="text" name="naam paard" value=""></td></tr> <tr><td>Ras:</td><td><input type="text" name="ras" value=""></td></tr> <tr><td>Geslacht:</td><td><input type="text" name="geslacht" value=""></td></tr> <tr><td>Wachtwoord:</td><td><input type="password" name="wachtwoord1" value=""></td></tr> <tr><td>Controle wachtwoord:</td><td><input type="password" name="wachtwoord2" value=""></td></tr> <tr><td>Emailadres:</td><td><input type="text" name="emailadres" value=""></td></tr> <tr><td></td><td><input type="submit" name="registreer" value="Aanmelden"> </table> </form> <?php } ?> I have made it different, i thought the other code was the problem.. Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438354 Share on other sites More sharing options...
yasminlove1 Posted June 28, 2013 Author Share Posted June 28, 2013 And please.. don`t say that i must learn more.. that`s the reason why i didn`t say how old i am.. people gonna think than that i can`t make a website.. Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438356 Share on other sites More sharing options...
MissMarisjuh Posted June 28, 2013 Share Posted June 28, 2013 (edited) $connectie = mysql_connect($000webhost.com,'','') or die($error);This first argument of your function is not correct. And did you have filled in the right credentials? (user, pass, database) How long do you have experience about PHP? Edited June 28, 2013 by MissMarisjuh Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438357 Share on other sites More sharing options...
yasminlove1 Posted June 28, 2013 Author Share Posted June 28, 2013 o yeah, that`s right that must be fill in.. I don`t wanna say that because people don`t wanna help me than and say: Go learning! Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438359 Share on other sites More sharing options...
MissMarisjuh Posted June 28, 2013 Share Posted June 28, 2013 Okay okay... But, again...What experience do you have about PHP? What do you know about it.... (and tell me not 'the basic)' ? Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438360 Share on other sites More sharing options...
yasminlove1 Posted June 28, 2013 Author Share Posted June 28, 2013 Ehh.. let me think... i can the most of the scripts... like scripting for a index, formulier, text, picture`s... and that stuff, that`s the reason why i am started with something else, like a system for login and registrate. ow yes, by registration formulier isn`t everything good, i have a error by line 21 say`s it. Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438361 Share on other sites More sharing options...
MissMarisjuh Posted June 28, 2013 Share Posted June 28, 2013 (edited) Yes, what you explain, that stuff is HTML. What you now will is PHP, that really different and i think your're very new in this world? Is it? What are your experiences about PHP? Edited June 28, 2013 by MissMarisjuh Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438362 Share on other sites More sharing options...
yasminlove1 Posted June 28, 2013 Author Share Posted June 28, 2013 I just learned the things about php like basic thing like scripting a index, with php, and now i am bizzy with the formulier for login and registrate, i think that that all the php things what i need is, let it say like this: i don`t need to learn the things what i don`t need, and i am not very long bizzy with php, html is something else and that is easyer for me, but for this formulier i need php... Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438372 Share on other sites More sharing options...
MissMarisjuh Posted June 28, 2013 Share Posted June 28, 2013 (edited) A index, that's just HTML-learnings, same to build a form...But, what do you know about PHP?Is it not a better idea to first make a safe contact-script, or a guestbook? Thats the way how i was started with PHP.Now 3 years further, i have build my own webshop system in classes, OOP, MCV and more... A game (RPG) for a beginner is a way too far.... Edited June 28, 2013 by MissMarisjuh Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438375 Share on other sites More sharing options...
yasminlove1 Posted June 28, 2013 Author Share Posted June 28, 2013 what is RPG? it must be a game maded from a website I don`t know what i know about php, i have learned much about php.. when you say how must php start and end? than i know the enswer: Start with: <?php end with ?> I would like that to make, but than i have another problem.. i want to make a contact-script on a apart page but i have a error when i click on the link.. Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438377 Share on other sites More sharing options...
MissMarisjuh Posted June 28, 2013 Share Posted June 28, 2013 (edited) Role Player Game... (use Wikipedia) often made as a website, sometimes build in Flash (like Habbo Hotel or Runescape)First, forget your idea's about your game, and make a few little scripts. With 'no' or 'few knowledge' is it very very difficult to make an own game. What i can advize: - Learn the practice about POST and GET en how form's working and how they're handled by PHP. (E.g. to show you name you've filled in. - Build a calculator, to explore the power of the 'operators'. And use own made 'functions'... - Learn about sessions, (E.g. To save your name into a Session)- Build an own contactscript, to mail the contactinformation to your mailadres...- A guestbook that can save the data in a mysql/postgresql database. - Build a simple forum to explore the power of MySQL/PostGreSQL (and learn about JOINS) In due of time, you learn all the stuff you have needed to make your own game. But it's very important to take the time. Maybe you can make end of this year the first steps for your own game. have fun..... Edited June 28, 2013 by MissMarisjuh Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438387 Share on other sites More sharing options...
yasminlove1 Posted June 28, 2013 Author Share Posted June 28, 2013 No, not a game like habbo, because in my game you can`t walk or something.. yeah.. the contactscript... that`s a problem too... look, there wil come a error 404 when i wanna open the link to see if it works and then the script can make. Guestbook or something like that comes yes. I gonna learn, but when i have an problem.. what i must do than? Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438407 Share on other sites More sharing options...
MissMarisjuh Posted June 28, 2013 Share Posted June 28, 2013 (edited) Yes, i know.. But Habbo is an example of an RPG game..... Sure i can help you with your contactscript. Can you tell me more about your problem, what you tried, and show your code and problem around the lines... (relevant sourcecode, around 15 lines...) I gonna learn, but when i have an problem.. what i must do than? Learn to how debug them, read the manuals on php.net. Be a go-getter and in extreme cases, tell your question in this phpfreaks forum. Edited June 28, 2013 by MissMarisjuh Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438408 Share on other sites More sharing options...
yasminlove1 Posted June 29, 2013 Author Share Posted June 29, 2013 Well, the connect is not the only problem i think.. it is just that when i on the link click than will there coma a error 404.. It won`t come on the other page.. this is connect: <?php //connecting to the database $error = "Could not connect to the database"; $connectie = mysql_connect($serverxx.xxxwebhost.com,xxxxxxxx,xxxxxxxxx) or die($error); mysql_select_db($db, $connectie) or die($error); ?> I filled in the server, name and password.. And this is the link. <ul> <li><a href="Page2.html">Nieuw hier?</a></li> <li><a href="#">Contact</a></li> </ul> I tryed very much times to look if it was better with another link, but that don`t helped.. Nieuw hier? must go to Page2.html, and Contact is going to the index right now, so you don`t see any different with page when you click on Contact because it is made on that page, and there is no problem with.. It must lay on the connect script.. Quote Link to comment https://forums.phpfreaks.com/topic/279570-php-login-and-registration-formulier-with-a-html-index/#findComment-1438481 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.