General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old September 8th, 2002, 11:02 PM
littleblackdog littleblackdog is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Anchorage
Posts: 118 littleblackdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Authentication and header( 'Location...

I am having trouble calling a page from a row in mysql table as the header('Location : newpagehere.php');

It works if I put a page in, the page authenticates the user/password against the mysql db but I can't seem to get the user's webpage to fit into the header line...how is this done?

Here is what I have so far, probably a lame attempt...

//visitor's name and password work
$query = ("SELECT count(*) FROM passwords WHERE name ='$name' and password = '$password'");
$myrow = mysql_fetch_array($result);
$master = '$result';
header('Location: $master');
die();
} else {
//visitory must try again
echo "<h1>Go Away!</h1>";

I want the page to redirect to the user's page, called from their row in the db.
__________________
bow wow!

Reply With Quote
  #2  
Old September 9th, 2002, 07:04 PM
adunsulag adunsulag is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 5 adunsulag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 32 sec
Reputation Power: 0
Send a message via AIM to adunsulag
use of header

I'm not quite sure why it doesn't work with the single '' marks but in your header function it needs to be header("Location: $yadda");

Reply With Quote
  #3  
Old September 9th, 2002, 07:45 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
The problem you're having is from the "COUNT(*)"... All you're doing is retrieving the number of fields contained within the user's row.

I would suggest reading Havard Lindset's article, "PHP, MySQL and Authentication 101". It will explain a lot of the problems you're having. It will help you develop a useful login system.

Let me know if you continue to have problems.
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #4  
Old September 10th, 2002, 03:14 AM
littleblackdog littleblackdog is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Anchorage
Posts: 118 littleblackdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Want to require more verification...

I have a copy of the previously mentioned article from H.L. and I learned alot from it. I am trying to allow log in to a main page by a group teachers, each having thier own usernaem and pass, but then they have pages only they can enter..this requires those pages to ask for an additional condition... any good examples of this kind of script? Seriously, I'm not trying to make this too complicated...just secure.

Thanks.

Reply With Quote
  #5  
Old September 11th, 2002, 08:52 AM
crazytrain81 crazytrain81 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 232 crazytrain81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
something like this

for simplicity sake we'll assume you've already validated their password and username and them into session variables. If you want them to have links to various pages, simply place them out there, and verify that $_SESSION[username] is the authorized username, and if it is not, simply header them to javascript:history.back() . If you want them automatically redirected, use header("Location: $newPage");

Reply With Quote
  #6  
Old September 17th, 2002, 07:39 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
i would use if (session_registered($name)) to check if the person is allowed to view the page.

not sure if thats the right function... only thing that came to my mind at the moment.
__________________




"Only Linux users see the end of crashes."
- Pl4t0

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Authentication and header( 'Location...


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 | 
  
 

Iron Speed




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