Page 1 of 1

php guru needed for login.php

Posted: Mon Dec 15, 2008 4:56 am
by mtb211
Hi, Ive asked every profi i know about how to do this but it seems like no one knows

Right now I have a folder called customer and inside this folder I have all the customers names that are secure with htaccess

at the moment I do not have a login page but just direct links for each user

Can I create a login.php file.. with only a user name and password with a small image

Can I enter a username and password but if the user enters the correct user name and password it will direct him to the correct folder?(working with htaccess?)

thanks in advance

Matt


code for file login.html

Code: Select all

 
<!doctype html public "-//w3c//dtd html 3.2//en">
 
 <html>
 
 <head>
 <title>Login Page</title>
 </head>
 
 <body bgcolor="#808080" text="#000000" link="#8080ff" vlink="#0000ff" alink="#ffff00">
 
 <form method="post" action="login.php">
    <b> Username </b>&nbsp;&nbsp;<input type="text" name="name"><br>
    <b> Password </b>&nbsp;&nbsp;&nbsp;<input type="password" name="password"><br>
    <br>
  <input type="submit" name="Login" value="Login">
 </form>
 </body>
 
 </html>
 
code for file login file login.php

Code: Select all

 
 
<?php
// These two values are passed from the form ---------------------------
$username = $_POST['name'];
$password = $_POST['password'];
// Change these values to fit your site --------------------------------
$domain   = "[url="http:www.punktewolke.de//www.punktewolke.de"]www.punktewolke.de[/url]";  // my domain? correct?
$restrict = "kunden";    // The restricted directory
$pagetitle= "Login;  // Title of the Page
 
echo "<html><head><title>$pagetitle</title><META HTTP-EQUIV=REFRESH CONTENT="0; 
URL=http://$username:$password@$domain/$restrict\"></head>";
echo "<body bgcolor=\"#C1C1C9\">";
echo "<center><h2> Login into the Members Area ... </h2>";
echo "</body></html>"; 
?> 
 
 

Re: php guru needed for login.php

Posted: Mon Dec 15, 2008 6:09 am
by phpserver
If a user is authentic he/she will be redirected to the page youy want.

if($login_creds == $theones_taht_exist_in ya database)
{
redirect("the_page_you_wish_to_redirect_to")
}

Re: php guru needed for login.php

Posted: Mon Dec 15, 2008 6:36 am
by mtb211
really dont understand that.. page is http://www.punktewolke.de

there is a link that says kunden klicken sie here

when you click that the script appears... is it possible to direct the user to the correct folder?