Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

PHP login and registration formulier with a html index

Codes here !

Moderators: macek, egami, gesf

PHP login and registration formulier with a html index

Postby yasminlove1 » Wed Jun 26, 2013 9:23 am

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....72029466154.jpg" alt=Horselife/> <br><br>

<h3>Welkom op Horselife!</h3>
<img src="http://u.jimdo.com/w...5/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





<?php
session_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 functie
function 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













<?php

function 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;
}
?>






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...




Thank you.
yasminlove1
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Jun 26, 2013 9:18 am

Re: Coach Factory outlet online store (33)

Postby yasminlove1 » Thu Jun 27, 2013 1:24 am

sherman79 wrote:India is most common tourist attraction country in the world. When you are planning your next vacation in India, there are several things to keep in mind to help you find the best India coach factory stores canada shop coach factory store online travel deals. It doesn?t matter how you plan on getting there, you can find outstanding travel deals to help you keep your vacation budget from being blown away. Think about these traveling tips when you plan your next holiday in India.
Many of today?s airlines offer significant savings, if you book early. As soon as you know your travel dates, start searching for flights, lodging and attraction tickets. Most of the airlines offer exceptional savings, if you book your travel at least a month in advance.
Travel during the Week
Most airlines offer their cheapest fares during the middle of the week. Tuesday through Thursday travel are usually the least expensive days to travel. If you can stay over on a Saturday, many times the fares are cheaper than if you stay overnight a different day of the week.
Travel during the Off Season<br coach factory store online shopping />
Many of the prime destinations are much, much cheaper during a typical off season. This will apply all the way down to your lodging and event or attraction tickets. You can often find lodging for half the price of the peak times of the factory outlet store the year.
Use an India Tour Operator
Travel operator knows all the ins and outs to great travel deals. Many India travel agencies book several vacation packages at once to keep the prices low for their customers. If it is getting close to the package date, you might be able to snag a really reduced rate. The India travel agency would much rather make a small profit than have to take a loss.
Buy India Package Tours
This is one of the best ways to save money on vacation to India. An India vacation package that includes airfare, accommodations, and attraction tickets will be substantially less than purchasing each ticket or room separately. Plus you won?t have to make each reservation yourself and keep track of all the confirmation information.
<br coach factory store online us />Use a Budget Carrier
Even if you have a flight on a budget carrier that does not include an in-flight movie or meal, you might not mind if it can save you up to fifty percent off the normal airfare. Also consider flying standby, unless your travel dates and itinerary are specific.
Join a Travel Club
Many travel clubs, offer great deals for India travel packages and even event and attraction tickets. Using their service one time is usually enough to pay for the membership for a year.
Look for Discount Coupons
You can find coupons online for travel agency in India just about everywhere. However, some of the best coupons for traveling in India can be found at an online coupon website. You may find coupons on airfare and lodging or great deals on attraction tickets. Sometimes you may find coupons that you can use even coach factory outlet online store with another promotional offer. Be sure you understand a terms and conditions of the coupon and check the expiration date.
India Golden Tours.com is an online travel services business based in Capital of India. Our motive is to provide travel related services to inbound /domestic tourists & corporate for their conferences & employee motivation needs.
We reach thousands of online customers who use our web portal and plan India tours, especially Golden Triangle Tours and we help them make their journey luxurious, enjoyable and hassle-free.

相关的主题文章:


Coach Factory outlet online store (7)

Coach Factory outlet online store (12)

Coach Factory outlet online store (22)



what is this?!?!
yasminlove1
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Jun 26, 2013 9:18 am


Return to mySQL & php coding

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron