FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php code
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: php code [message #177418 is a reply to message #177415] Mon, 26 March 2012 16:03 Go to previous messageGo to previous message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma:
Senior Member
On Mon, 26 Mar 2012 08:05:29 -0700 (PDT), shaurya077 wrote:
> hi frds .....
> i'm working on a small assignment based on php
> in this assignment i just created a login page (username and password
> required)
> but it is working all right
> but after login there i created a welcome page but in which welcome
> page php scripts didn't showing the name of user
>
> like "hi! shaurya"
>
> my php code is for login check:
>
> <?php
>
> include("config.php");
>
> session_start();
>
> if($_SERVER["REQUEST_METHOD"]=="POST")
> {
> $myusername=addslashes($_POST['user_name']);
> $mypassword=addslashes($_POST['pass_word']);
>
>
> $sql="select id from userinformation WHERE username='$myusername' and
> password='$mypassword' ";
>
> $result=mysql_query($sql);
>
> $row=mysql_fetch_array($result);
>
> $active=$row['active'];
>
> $count=mysql_num_rows($result);
>
> if($count==1)
> {
> session_register("myusername");
> $_SESSION['login_user']=$myusername;
>
> header("location:welcome.php");
> }
> else
> {
> $error="name and password is invalid";
>
> echo $error;
>
>
> }
> }
>
>
> ?>
>
> this scripts is used to check the data filled bu user and after that
> this welcome page comes (code):
>
> <?
>
> //screen after verification
>
> include('lock.php');
>
> echo $login_session;
>
> ?>
>
>
> reply plz....

Where is $login_session set?

--
41. Once my power is secure, I will destroy all those pesky time-travel
devices.
--Peter Anspach's list of things to do as an Evil Overlord
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Sharetext
Next Topic: Import values from XML file
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 20:35:56 GMT 2024

Total time taken to generate the page: 0.04281 seconds