Skip to main content
Known Participant
July 9, 2008
Question

Login Problem building with PHP and CS3

  • July 9, 2008
  • 1 reply
  • 426 views
I have a site that requires a login. When I type in the username and pswd it redirects to the index page as planned. The problem is that I am not really logged in. I added a conditional statement which is suppose to show the customer name if the username and psw match which they do. And if it does not match it is suppose to say I am not logged in. Well it always says I am not logged in. Can someone please give suggestions?
This topic has been closed for replies.

1 reply

Inspiring
July 9, 2008
TC5Racer wrote:
> I added a conditional statement which is suppose to show the
> customer name if the username and psw match which they do. And if it does not
> match it is suppose to say I am not logged in. Well it always says I am not
> logged in. Can someone please give suggestions?

Your post is so long, the code is cut off by the news server. However,
it's obvious from the following section of code that you're using
deprecated PHP that no longer works.

> <?php
> session_start();
> session_register("sessFirstName");
> $sessFirstName = $HTTP_POST_VARS['Name'];
> ?>

To start off, session_start() has already been called earlier on the
page, so you shouldn't call it again. Secondly, both session_register()
and $HTTP_POST_VARS are deprecated elements of PHP that no longer work
on most servers. The code should be rewritten like this:

$_SESSION['FirstName'] = $_POST['Name'];

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
TC5RacerAuthor
Known Participant
July 9, 2008
Hi,

I made the changes you had suggested, but I am still getting the same results. What should I try next?