-
[Help] Ip login
Im been searcing on google for some help with out luck, i wants to make my admin page, login i don't wants to use database i wants to try some new, i found out you can have access to a site by your ip.
like if you ip is : 85.81.174.181 you can go
if you ip is : 127.0.0.1 you can go
else you set a message.
Can some help me with my problem?
Code:
<html>
<head>
<title>
<?php include"setup.php"; print $title ?> | Forside
</title>
</head>
<body>
<center>
<img src="<?php include"setup.php"; print $banner ?>"></img>
</center>
<center>
<?php include"menu.php"; print $menu ?>
</center>
<br />
</body>
</html>
-
Re: [Help] Ip login
I don't understand what goes where in your code above, so I'll make a crappy little one.
PHP Code:
<html>
<head>
<title>Hello</title>
<style type="text/css">
body, table, input, select, textarea {
font-family: Verdana;
font-size: 11px;
}
</style>
</head>
<body>
<?php
if($_SERVER['REMOTE_ADDR'] == '85.81.174.181'){
echo 'Hello Admin!';
}else{
echo 'You are not allowed here!<br /><br /><a href="index.php">Home</a>';
}
?>
</body>
</html>
Is that what you meant?
-
Re: [Help] Ip login
Thanks! can you help with header ? i get this warring:
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\Css hjemmeside\log_in.php:4) in C:\xampp\htdocs\Css hjemmeside\log_in.php on line 25
my code is:
<?php
$accepter = array('127.0.0.1','XX.XX.XX.XX','XX.XX.XX.XX');
if(!in_array($_SERVER['REMOTE_ADDR'],$accepter))
{
print 'Du skal v
-
Re: [Help] Ip login
Try:
[php]
<?php
ob_start();
$accepter = array('127.0.0.1','XX.XX.XX.XX','XX.XX.XX.XX');
if(!in_array($_SERVER['REMOTE_ADDR'],$accepter))
{
print 'Du skal v
-
Re: [Help] Ip login
-
Re: [Help] Ip login
Put this in a file called php.ini and upload it to your host:
Code:
output_buffering=on
Then put this in your .htaccess file:
Code:
PHP_FLAG output_buffering on
-
Re: [Help] Ip login
its still dont works i madet the php.ini file and type in it (output_buffering=on
PHP_FLAG output_buffering on).
-
Re: [Help] Ip login
is
PHP Code:
header("Location: /admin.php/");
becoming after any html output?
-
Re: [Help] Ip login
[code]<?php
$userip = ($_SERVER['REMOTE_ADDR']);
$allowip = '127.0.0.1';
$allowip2 = 'WANIPHERE';
if ($userip != $allowip