Free2Code
The majority of forums are now only available as archives, which means posting/editing is disabled.

The Anything and Everything forum is still open.
 
Time: 2013-05-18, 05:35pm
hosting problem
Subject: hosting problem  ·  Posted: 2005-09-02, 11:23am
Rank: ? (47)
Member #: 24909
thank god atlast all my code worked nicely
in my loclahost
but when i hosted it it is working very worst
if i login and i try to login again i get that ur allraeady logged in
in my localhost
but when i hosted it
it wont give hat message
it tell agin to login
what may be the problrm

 
  Reply to this ·  Post link ·  Top
Subject: Re: hosting problem  ·  Posted: 2005-09-02, 12:47pm
Rank: ? (1200)
Member #: 12930
Are u some kind of a poet?!? What exactly is ur problem?

So... How is life?
 
  Reply to this ·  Post link ·  Top
Subject: Re: hosting problem  ·  Posted: 2005-09-02, 01:21pm
Rank: ? (47)
Member #: 24909
sorry for not understanding my problem.my problem is my code is working very nice in my localhost(login php). but when i hosted it my login php is not logining in properly.
when i login i get welcome message but when i try to login again i get u are not the member login again.
in my localhost i m not getting i get the message that u are allready logged in.
y i m geting the error after hosting


 
  Reply to this ·  Post link ·  Top
Subject: Re: hosting problem  ·  Posted: 2005-09-03, 04:45am
Rank: ? (1200)
Member #: 12930
Could u post the code please? Maybe there's something wrong with the Sessions/Cookies the server is sending?

So... How is life?
 
  Reply to this ·  Post link ·  Top
Subject: Re: hosting problem  ·  Posted: 2005-09-03, 05:41am
Rank: ? (47)
Member #: 24909
this is login .php


<?php
include 'db_connect.php';
if($logged_in == 1)
{?>


<FONT SIZE=2 COLOR="RED"><?print('You are already logged in, '.$_SESSION['usercode'].'.');?></FONT>
//i have included form here
die("";
}
?>

<?php
$usercode=$_POST['usercode'];
$password=$_POST['password'];

if(!$_POST['usercode'] | !$_POST['password'])
{
//i have included form here
?>


die("";
}
// authenticate.
if(!get_magic_quotes_gpc()) {
$_POST['usercode'] = addslashes($_POST['usercode']);
}
$check = mysql_query("SELECT usercode, password FROM userlogin1 WHERE usercode = '$usercode' and password='$password'" or die("no";
if ( mysql_num_Rows($check) == 0) {?>
// i have include form here
<?
die("";}

$date=('m d,Y');
$update_login = mysql_query("UPDATE userlogin1 SET last_login = '$date' WHERE usercode = '".$_POST['usercode']."'";

$_POST['usercode'] = stripslashes($_POST['usercode']);
$_SESSION['usercode'] = $_POST['usercode'];
$_SESSION['password'] = $_POST['password'];
mysql_close();
?>

//i have included form here


this is check_login.php
<?session_start();
if (!isset($_SESSION['usercode']) || !isset($_SESSION['password'])) {
$logged_in = 0;
return;
} else {
if(!get_magic_quotes_gpc()) {
$_SESSION['usercode'] = addslashes($_SESSION['usercode']);}
$usercode=$_SESSION['usercode'];
$pass =mysql_query("SELECT password FROM userlogin1 WHERE usercode ='$usercode'";

if( mysql_num_Rows($pass) != 1) {
$logged_in = 0;
unset($_SESSION['usercode']);
unset($_SESSION['password']);
}
$db_pass = mysql_fetch_array($pass);
$db_pass['password'] = stripslashes($db_pass['password']);
$_SESSION['password'] = stripslashes($_SESSION['password']);
$password=$_session['password'];
if($_SESSION['password'] == $db_pass['password']) {
$logged_in = 1;


} else {
$logged_in = 0;

unset($_SESSION['usercode']);
unset($_SESSION['password']); }
}
unset($db_pass['password']);
$_SESSION['usercode'] = stripslashes($_SESSION['usercode']);
?>


 
  Reply to this ·  Post link ·  Top
Subject: Re: hosting problem  ·  Posted: 2005-09-03, 07:52am
Rank: ? (900)
Member #: 3
you have alot of problems my friend.

Stop flooding the board with the same scripts and read up on php at php.net

work with it a bit, you will catch on. You cant expect everyone to solve all problems for you or else you will never learn anything.

--bs0d | allsyntax.com
 
  Reply to this ·  Post link ·  Top
Subject: Re: hosting problem  ·  Posted: 2005-09-03, 10:10am
Rank: ? (47)
Member #: 24909
yes sir i agree i have lots of problem. i resolved many of my problems. now everyting is fine .i m learning php so i thought if i ask some of my silly question in this form i could learn php little fast.
i am not a web designer , i thought of doing one site of my own. thats y i wanted to learn php .after solving all my problems in my localhost. that is login,registering,restricting the members to some pages ext. another problem arised after hosting. is there any session problem?as my check_login.php is not working after hosting.i hope u will help me


 
  Reply to this ·  Post link ·  Top
Subject: Re: hosting problem  ·  Posted: 2005-09-03, 12:14pm
Rank: ? (1200)
Member #: 12930
Don't u also need
session_start();
I can't see that anywhere in your code! If you don't have that, sessions wouldn't be generated.

So... How is life?
 
  Reply to this ·  Post link ·  Top
Subject: Re: hosting problem  ·  Posted: 2005-09-03, 01:19pm
Rank: ? (47)
Member #: 24909
session_start() is there in check_login.php
i have included it

 
  Reply to this ·  Post link ·  Top
This post has been removed by the author
 
  Top
Subject: Re: hosting problem  ·  Posted: 2005-09-03, 02:30pm
Rank: ? (47)
Member #: 24909
thank u every body it is working now


 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

Penguino AVR

Want to learn about robotics or microcontrollers?
Check out the Penguino AVR from our friends at
Icy Labs