MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 19th, 2000, 12:56 AM
Haafiz
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I wanted to know if there is anyway to do this:

Create a table which stores Usernames Passwords, and Account #'s (I know this part).

When you provide a valid username and password, it will redirect you to a certain page for example your account # with a .html added on to the end of it ("account#.html")

Could you please post example code if possible instead of telling me how to do it.

------------------
-- Haafiz Dossa
http://www.innovativewpd.com

Reply With Quote
  #2  
Old October 19th, 2000, 06:19 AM
Sepodati's Avatar
Sepodati Sepodati is offline
Banned
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Dec 1999
Location: Afghanistan
Posts: 14,382 Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 70626 Folding Title: Intermediate FolderFolding Points: 70626 Folding Title: Intermediate FolderFolding Points: 70626 Folding Title: Intermediate FolderFolding Points: 70626 Folding Title: Intermediate Folder
Time spent in forums: 2 Months 4 Weeks 11 h 1 m 51 sec
Reputation Power: 1784
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<?php
//assuming you've passed $username and $password by using a form...
$link_id = mysql_connect("localhost","user","pass");
$db = mysql_select_db("your_db");
$result = mysql_query("SELECT acct_num FROM your_table WHERE username='$username' AND password='$password'");
if ($row = mysql_fetch_array($result))
{
header("Location: <A HREF="http://www.yourhost.com/"" TARGET=_blank>http://www.yourhost.com/"</A> . $row["acct_num"] . ".html");
}
?>
<html>
<body>
Cannot log in
</body>
</html>
[/code]

You'll have to check on that header syntax and make sure it's correct. I haven't used it before...

You could also just include the file

include($row["acct_num"] . ".html");

---John Holmes...

------------------
*************************************************************
* The manual can probably answer 90% of your questions...
*
* PHP Manual. www.php.net/manual
* MySQL Manual: www.mysql.com/documentation/mysql/bychapter
*************************************************************

Reply With Quote
  #3  
Old October 19th, 2000, 09:36 PM
Haafiz
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Thanks for replying. That little tag saying about the header makes doesn't work, but screws everything up. when you actually log in properly, it will say something like trying to add a header to the submitted form. it thinks you are adding something like this: http://www.yourdomain.com/login.php3?user=xxxx&pass=xxx&acct_num=xxxxx
and it doesn't allow you to do that so you get an error message.

------------------
-- Haafiz Dossa
http://www.innovativewpd.com

Reply With Quote
  #4  
Old October 20th, 2000, 09:05 PM
Sepodati's Avatar
Sepodati Sepodati is offline
Banned
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Dec 1999
Location: Afghanistan
Posts: 14,382 Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 70626 Folding Title: Intermediate FolderFolding Points: 70626 Folding Title: Intermediate FolderFolding Points: 70626 Folding Title: Intermediate FolderFolding Points: 70626 Folding Title: Intermediate Folder
Time spent in forums: 2 Months 4 Weeks 11 h 1 m 51 sec
Reputation Power: 1784
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
See if one of the following work better for you...I need to look into that header function I guess....
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<?php
//make sure no one tries to pass page in the
//url and sneak in...
unset($page);

//assuming you've passed $username and $password by using a form...
$link_id = mysql_connect("localhost","user","pass");
$db = mysql_select_db("your_db");

$result = mysql_query("SELECT acct_num FROM your_table WHERE username='$username' AND password='$password'");

if ($row = mysql_fetch_array($result))
{
$page = $row["acct_num"] . ".html";
}
?>
<html>
<body>
<?php
if (isset($page))
{
include($page);
}
?>
Cannot log in
</body>
</html>
[/code]
or...
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<?php
//make sure no one tries to pass page in the
//url and sneak in...
unset($page);

//assuming you've passed $username and $password by using a form...
$link_id = mysql_connect("localhost","user","pass");
$db = mysql_select_db("your_db");

$result = mysql_query("SELECT acct_num FROM your_table WHERE username='$username' AND password='$password'");

if ($row = mysql_fetch_array($result))
{
$page = $row["acct_num"] . ".html";
}
?>
<html>
<body>
<?php
if (isset($page))
{
echo "<script language="javascript">location.href='$page';</script>";
}
?>
Cannot log in
</body>
</html>
[/code]
---John Holmes...

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Password protection


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway