473,320 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Single sign on

1
hi all,
we are working on a single sign on project.if a user registers with our software we store his passwords in oracle database and our aim is to retrieve it and insert it on the login page when he visits the respective website.we are coding in VB.we are facing a problem in insertion of password on login page.which language should we code?can anyone provide us with a sample code ? we have thought of php but quite unsure.
Platform-Windows XP
Mar 4 '07 #1
2 2078
[php]
i would advise you to code with php and maybe use MySql for your database even though you can actually connect with any database management system. What you need is"
1.The registration form
2.Registration form processing code
3. Login form
4.Login processing code which verifies users against your database

This is a dummy registration form:
<form name="login" method="post" action="registration.php">
<table border="0" width="225" align="center">
<tr>
<td width="219" bgcolor="#999999">
<p align="center"><font color="white"><span style="font-size:12pt;"><b>Registration</b></span></font></p>
</td>
</tr>
<tr>
<td width="219">
<table border="0" width="282" align="center">
<tr>
<td width="116"><span style="font-size:10pt;">Name:</span></td>
<td width="156"><input type="text" name="name" maxlength="100"></td>
</tr>
<tr>
<td width="116"><span style="font-size:10pt;">Email:</span></td>
<td width="156"><input type="text" name="email" maxlength="100"></td>
</tr>
<tr>
<td width="116"><span style="font-size:10pt;">Username:</span></td>
<td width="156"><input type="text" name="username"></td>
</tr>
<tr>
<td width="116"><span style="font-size:10pt;">Password:</span></td>
<td width="156"><input type="password" name="password"></td>
</tr>
<tr>
<td width="116">&nbsp;</td>
<td width="156">
<p align="right"><input type="submit" name="submit" value="Submit"></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="219" bgcolor="#999999">&nbsp;</td>
</tr>
</table>
</form>

Registration Processing php code"

<?php
$dbhost = "localhost";
$dbname = "php_login";
$dbuser = "root";
$dbpass = "clemence";

mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$name = $_POST['name'];
$email = $_POST['email'];
$username = $_POST['username'];
$password = md5($_POST['password']);

$checkuser = mysql_query("SELECT username FROM users WHERE username='$username'");

$username_exist = mysql_num_rows($checkuser);

if($username_exist > 0){
echo "I'm sorry but the username you specified has already been taken. Please pick another one.";
unset($username);
include 'registration.html';
exit();
}

$query = "INSERT INTO users (name, email, username, password)
VALUES('$name', '$email', '$username', '$password')";
mysql_query($query) or die(mysql_error());
mysql_close();

echo "You have successfully Registered";

$yoursite = 'www.palmarecruits.co.zw';
$webmaster = 'Lameck';
$youremail = 'lmwasisebe@glotecca.co.zw';

$subject = "You have successfully registered at $yoursite...";
$message = "Dear $name, you are now registered at our web site.
To login, simply go to our web page and enter in the following details in the login form:
Username: $username
Password: $password


Thanks,
$webmaster";

mail($email, $subject, $message, "From: $yoursite <$youremail>\nX-Mailer:PHP/" . phpversion());

echo "Your information has been mailed to your email address.";


?>

Login Page

<form name="login" method="post" action="login.php">
<table border="0" width="225" align="center">
<tr>
<td width="219" bgcolor="#999999">
<p align="center"><font color="white"><span style="font-size:12pt;"><b>Login</b></span></font></p>
</td>
</tr>
<tr>
<td width="219">
<table border="0" width="220" align="center">
<tr>
<td width="71"><span style="font-size:10pt;">Username:</span></td>
<td width="139"><input type="text" name="username"></td>
</tr>
<tr>
<td width="71"><span style="font-size:10pt;">Password:</span></td>
<td width="139"><input type="password" name="password"></td>
</tr>
<tr>
<td width="71">&nbsp;</td>
<td width="139">
<p align="right"><input type="submit" name="submit" value="Submit"></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="219" bgcolor="#999999"><font color="white">Not Registered? </font><a href="registration.html" target="_self"><font color="white">Register</font></a><font color="white"> </font><b><i><font color="white">Now!</font></i></b></td>
</tr>
</table>
</form>

Login Processing php code

<?php
$dbhost = "localhost";
$dbname = "php_login";
$dbuser = "root";
$dbpass = "clemence";

mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());

session_start();

$username = $_POST['username'];
$password = md5($_POST['password']);

$result = mysql_query("SELECT * FROM users WHERE username='$username' and password ='$password'");

if (mysql_num_rows($result) != 1) {
$error = "Bad Login";
include "login.html";

} else {
$_SESSION['username'] = $username;
include "memberpage.php";
}

?>[/php]

Read the Posting Guidelines before you post in this forum!.
Especially the part about enclosing code within code or php tags!!

moderator
Mar 5 '07 #2
ronverdonk
4,258 Expert 4TB
When you are unsure about the programming language to use, maybe you should decide that first before you continue on this path.

Ronald :cool:
Mar 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Cowboy \(Gregory A. Beamer\) | last post by:
Quite a few months back, I was able to create a single sign on app for all apps on a single box (perhaps a domain, but never tested) by setting the auth cookie name to an identical value: ...
1
by: Rodney Lane | last post by:
Hi I am investigating the possibility writing an application which uses single sign on with ASP.Net / VB.Net and was wondering if anyone has endeavoured to do this yet. I will most likely be...
3
by: daniel | last post by:
Hi, i want to use dotnet web form to do SSO with AD now, but i don't know to do it. where can i look for relative article or sample code ? thanks.
1
by: EricMatz | last post by:
I work for a medium-sized insurance company, developing web-based systems for our independent agents. There are four primary applications we provide - one that serves as an agent portal (ASP), and...
1
by: TPK | last post by:
Here is what I want to do with javascript. On a page with text place a javascript link that: 1) When a user clicks the link (onClick) a new browser window opens (the easy part) NewWindow =...
2
by: Spam Catcher | last post by:
Hi all, I'm looking to implement a single sign on solution for .NET applications. This single sign on solution will need to work against a variety of back- end databases (i.e. SQL (mainly),...
4
by: Jai | last post by:
Hi, I have a problem related to Login System. I am developing 3 websites for some institution.Now they want that if anybody had sign up for there site1.com(say), than he or she should be able...
7
by: hamarsheh | last post by:
Hi everbody! i need single sign on software for our php website , For all application, because we used visual basic and php, and another things so we need software to do single sign on , that the...
0
amitpatel66
by: amitpatel66 | last post by:
All, Please find below POST about Oracle SINGLE ROW FUNCTIONS which might be useful. SINGLE ROW FUNCTION are those which are executed once for each and every row of the Query. The different...
9
by: Phillip B Oldham | last post by:
Are there any FOSS Python Single-Sign-on Servers? We're looking to centralise the sign-on for our numerous "internal" webapps (across multiple servers, languages, and domains) to speed user...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.