Web Hosting Deals Holiday Logo Design Webcam Chat Website Header Templates Register domain Search Engine Optimisation Web Hosting
Go Back   Talk Mania Forum > Programming / Scripting / Coding

Programming / Scripting / Coding Got a question about : PHP / Perl / Java / JavaScript / CGI Scripts / JavaScript coding. Ask here! We'll get you the answers !

 Image
Buy Sell Downloads

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-08-2007, 04:43 AM
ckyhigh
Guest
 
Posts: n/a
PHP scripts logon

Does anyone know how to make a PHP logon script? the one where user could make a login script in their website.

You can then add stuff like uploading images, etc..

Anyone have any idea? pls let me know thx

Reply With Quote
  #2 (permalink)  
Old 03-08-2007, 05:14 AM
Junior Member
 
Join Date: Mar 2007
Posts: 11
Calibula is on a distinguished road
search for someone on www.hotscripts.com
Reply With Quote
  #3 (permalink)  
Old 03-08-2007, 08:22 PM
Junior Member
 
Join Date: Mar 2007
Posts: 10
limpfrek6661 is on a distinguished road
you can search on www.php-scripts.com
Reply With Quote
  #4 (permalink)  
Old 03-12-2007, 10:17 AM
Junior Member
 
Join Date: Mar 2007
Posts: 11
calmlikeabomb is on a distinguished road
PHP Code:
<?

ob_start
();

if(isset(
$_POST['login'])) {

if(
$_POST['username'] == 'admin' && $_POST['password'] == 'admin') {
setcookie("TestCookie"$_POST['username']);
header("Location: /admin/"); ob_flush(); exit();
}

print <<<LoginForm

<form action=$_SERVER
[PHP_SELF]" method="POST">
<input type="text" name="username" />
<input type="password" name="password" />
<input type="submit" name="login" value="Login"/>
</form>

LoginForm;

?>

Then on the pages you need to protect

PHP Code:
if(!isset($_COOKIE['TestCookie'])) { header("Location: /login/"); ob_flush(); exit(); } 
Reply With Quote
  #5 (permalink)  
Old 03-14-2007, 05:09 PM
Base's Avatar
Senior Member
 
Join Date: Mar 2007
Location: North Yorkshire, UK
Posts: 121
Base is on a distinguished road
Send a message via MSN to Base Send a message via Skype™ to Base
Did you write that youself?

Base
Reply With Quote
  #6 (permalink)  
Old 04-09-2007, 10:12 PM
Junior Member
 
Join Date: Apr 2007
Posts: 3
Paultiscali is on a distinguished road
cheers ive been looking around for a login script for ages now
Reply With Quote
  #7 (permalink)  
Old 04-28-2007, 09:54 PM
Junior Member
 
Join Date: Apr 2007
Posts: 16
quocnhan is on a distinguished road
no answer yet?
Reply With Quote
  #8 (permalink)  
Old 05-08-2007, 12:35 AM
Junior Member
 
Join Date: Nov 2006
Posts: 20
n00b is on a distinguished road
Thumbs up

Quote:
Originally Posted by calmlikeabomb View Post
PHP Code:
<?

ob_start
();

if(isset(
$_POST['login'])) {

if(
$_POST['username'] == 'admin' && $_POST['password'] == 'admin') {
setcookie("TestCookie"$_POST['username']);
header("Location: /admin/"); ob_flush(); exit();
}

print <<<LoginForm

<form action=$_SERVER
[PHP_SELF]" method="POST">
<input type="text" name="username" />
<input type="password" name="password" />
<input type="submit" name="login" value="Login"/>
</form>

LoginForm;

?>

Then on the pages you need to protect

PHP Code:
if(!isset($_COOKIE['TestCookie'])) { header("Location: /login/"); ob_flush(); exit(); } 
It is not best way. if you want to use a COOKIE
use it with SESSIONS. Many peple have turn off cookies.

Script that fill the session from login form
PHP Code:
<?php
session_start
();

$_SESSION['Test'] = true;
$_SESSION['UserName'] = addslashes($_POST['UserName']);
$_SESSION['Password'] = md5(addslashes($_POST['UserName']));

?>
Page that you need protect
PHP Code:
<?php
session_start
();

if (!isset(
$_SESSION['Test']))
{
    
// redirect back on login script
}

?>
You can save into SESSION what you want and chacked it with database or other resources that you have store in another place.
Reply With Quote
  #9 (permalink)  
Old 05-18-2007, 10:14 PM
Junior Member
 
Join Date: May 2007
Posts: 20
zezikaro is on a distinguished road
I'm sure there's LOTS of free scripts o.O
Reply With Quote
  #10 (permalink)  
Old 05-19-2007, 02:59 PM
Junior Member
 
Join Date: May 2007
Posts: 20
phlop is on a distinguished road
thanks, i use to know a realy good site for web learning. if i remember ill let you know.

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +2. The time now is 06:49 PM.


Fake ID

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC8
Forums Copyright © Talk-Mania.com