php guru needed for login.php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mtb211
Forum Newbie
Posts: 15
Joined: Sun Dec 14, 2008 11:32 am

php guru needed for login.php

Post 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>"; 
?> 
 
 
User avatar
phpserver
Forum Newbie
Posts: 22
Joined: Mon Oct 20, 2008 2:59 am
Location: Eastleigh,Nairobi

Re: php guru needed for login.php

Post 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")
}
mtb211
Forum Newbie
Posts: 15
Joined: Sun Dec 14, 2008 11:32 am

Re: php guru needed for login.php

Post 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?
Post Reply