UnlimitedMB.comUnlimitedMB.com
Home    |    About Us    |    Forums    |    Signup    |    Login    |    Support
UnlimitedMB.com


 
UnlimitedMB.com



Go Back   UnlimitedMB.com Forums > General Forums > HTML

Reply
 
Thread Tools Display Modes
Other Code.
  #11  
Old 23 Hours Ago
hotnoob hotnoob is offline
Junior Member
 
Join Date: Oct 2007
Posts: 13
Default Other Code.

Here if u wanna play with links;

This is UnlimitedMB.com http://anoobsworld.com.net.sc/home.php
it should redirect to index.php

This is my other host, Byethost.com http://fivefingernoobs.byethost31.co...world/home.php
it should redirect to index.php

if it does not redirect, then i figured it is either the server, or a bug that doesn't show up any more, when id=0 and ip does not. i put in a script to stop that from happening though.

If your not satisfied, try any other page on both sites, it should redirect to the index.php as long as you are not logged on, and if you are logged on, it should redirect you to home.php from index.php.

Both servers have the same php versions, 5.2.4. the byethost server is about 1 year old, and the unlimitedmb server is 8 days old, which makes me suspect something on your guys side.
Reply With Quote
  #12  
Old 23 Hours Ago
Tyler Tyler is offline
Administrator
 
Join Date: Jun 2006
Posts: 1,103
Default

Your code is wrong, your page shouldn't show page content if you have the redirect code right. Show me the source of the page, it should look just like the code i showed you. (the full page)

Why are you saying our server is 8 days old?
__________________
Tyler,
Admin

Please do not PM me unless I ask you to.
Reply With Quote
  #13  
Old 16 Hours Ago
hotnoob hotnoob is offline
Junior Member
 
Join Date: Oct 2007
Posts: 13
Default


//intial login variables

$passwordcheck=0;

$error=0;

$home=0;

//standered login pross

include ("connect.php");

include ("timecheck.php");

include ("loginscript.php");

include ("userinfo.php");


include ("mainfunctions.php");

?>

Loginscript.php


$email = $_POST['email'];

$password = $_POST['password'];

$ip = $_SERVER['REMOTE_ADDR'];



$query = "Select * from online where ip='$ip'";

$result = mysql_query($query);

if($row = mysql_fetch_array($result))

{

$id = $row['id'];

if ($id == 0)

{

$query="Update `online` Set ip='NULL' Where id = 0 ";

if(mysql_query($query))

{



}

else

{

echo "Please contact your administrator to manually fix your accounts login error.";

}

$id = NULL;



}

}



$query = "Select * from `email` where email='$email'";

$result = mysql_query($query);

while($row = mysql_fetch_array($result))

{

$id=$row['id'];

$passwordcheck=1;

}



if($passwordcheck==1)

{

$query = "Select * from `$id`";

$result = mysql_query($query);

while ($row = mysql_fetch_array($result))

{

if ($row['password'] == $password)

{

}

else

{

$error=1;

}

}

}



$time=time();



$viewuser = $_GET['viewuser'];

if($viewuser == NULL)

{

$viewuser = $id;

$home=1;

}

if($viewuser == NULL)

{

header("Location: index.php");

}



$query="DELETE FROM `online` WHERE id='$id'";

mysql_query($query);

$query="INSERT INTO `online` (

`id` ,

`ip` ,

`time`

)

VALUES (

'$id', '$ip', '$time'

);";

mysql_query($query);





?>

if your thinking that the if statement might not be correct, then check this one out, it also does not work.
logout.php

//intial login variables

$passwordcheck=0;

$error=0;

$home=0;

//connection

include ("connect.php");

$DB_Connect = mysql_pconnect($hostname_DB_Connect, $username_DB_Connect, $password_DB_Connect) or trigger_error(mysql_error(),E_USER_ERROR);

mysql_select_db($database_DB_Connect) or die(mysql_error());

//get information provided by login screen

$email = $_POST['email'];

$password = $_POST['password'];



//get ip adress

$ip = $_SERVER['REMOTE_ADDR'];

//use ip adress to check if online

$query = "Select * from online where ip='$ip'";

$result = mysql_query($query);

if($row = mysql_fetch_array($result))

{

$id = $row['id'];

if ($id == 0)

{

$id = NULL;

}

}



$query = "Select * from `email` where email='$email'";

$result = mysql_query($query);

while($row = mysql_fetch_array($result))

{

$id=$row['id'];

$passwordcheck=1;

}



if($passwordcheck==1)

{

$query = "Select * from `$id`";

$result = mysql_query($query);

while ($row = mysql_fetch_array($result))

{

if ($row['password'] == $password)

{

}

else

{

$error=1;

}

}

}



$time=time();



$viewuser = $_GET['viewuser'];

if($viewuser == NULL)

{

$viewuser = $id;

$home=1;

}

if($viewuser == NULL)

{

header("Location: index.php");

}



$query="DELETE FROM `online` WHERE id='$id'";

mysql_query($query);

header("Location: index.php");





?>

i just noticed how it said it was 8 days old when i logged on mysql.
o nvm, tis just how long its be up.

Last edited by hotnoob : 16 Hours Ago at 12:51 PM.
Reply With Quote
Reply

« Previous Thread | Next Thread »

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes

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 Off
HTML code is Off
Forum Jump


All times are GMT. The time now is 05:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.







 



UnlimitedMB.com © 2006
Terms of Use | Report Abuse