Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Hak3r1z questions.

Parašė Tomcis· 2009 Sau. 25 19:01:16
#1

Klausymai.
1.Reik kodo, kad pvz, į www.puslapis.lt/login.php puslapį leistų eiti jeigu tavo IP: 78.60.156.34 , o kitus numestų į index.
Paredaguokit kodą, kas gali.

<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";

if (iMEMBER) {
   header("Location:index.php");
} else {
   opentable($locale['060']);
   echo "<div align='center'>
<form name='loginform' method='post' action='".FUSION_SELF."'>
".$locale['061']."<br>
<input type='text' name='user_name' class='textbox' style='width:100px'><br>
".$locale['062']."<br>
<input type='password' name='user_pass' class='textbox' style='width:100px'><br>
<input type='checkbox' name='remember_me' value='y'>".$locale['063']."<br><br>
<input type='submit' name='login' value='Login' class='button'><br>
</form>
<br>
</div>\n";
   closetable();
}
require_once "footer.php";
?>




Plius 10 būtinai duosiu. ;)
Pačiam neišėjo.

Redagavo Tomcis· 2009 Sau. 26 21:01:32

Parašė MAnjack· 2009 Sau. 25 19:01:30
#2

if (USER_IP = 78.60.156.34) {
login kodas
}

Parašė A-R-T-U-R-A-S· 2009 Sau. 25 19:01:36
#3

o jei Ip besikeiciantis ir viskas... nesiulau tokio,tik pasidaryk admin ip,o kitu nariu juk niekas nelauzia,tik admin

Parašė Tomcis· 2009 Sau. 25 19:01:39
#4

MAnjack parašė:
if (USER_IP = 78.60.156.34) {
login kodas
}


Neveikia, rašo:

Parse error: syntax error, unexpected '=' in /home/judekxzlt/judam.xz.lt/login.php on line 16


Va kokį kodą įmetęs buvau:

<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";

if (USER_IP = 78.60.156.34) {
   opentable($locale['060']);
   echo "<div align='center'>
<form name='loginform' method='post' action='".FUSION_SELF."'>
".$locale['061']."<br>
<input type='text' name='user_name' class='textbox' style='width:100px'><br>
".$locale['062']."<br>
<input type='password' name='user_pass' class='textbox' style='width:100px'><br>
<input type='checkbox' name='remember_me' value='y'>".$locale['063']."<br><br>
<input type='submit' name='login' value='Login' class='button'><br>
</form>
<br>
</div>\n";
   closetable();
} else {
      header("Location:index.php");
}
require_once "footer.php";
?>



Redagavo Tomcis· 2009 Sau. 25 19:01:13

Parašė Tomcis· 2009 Sau. 25 20:01:23
#5

Jau nereik.
Ex-it'as pagelbėjo.

Štai, kam reik.

<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
$ip = getenv("REMOTE_ADDR");
if ($ip != 'JŪSŲ IP') {
    header("Location:index.php");
} else {
      opentable($locale['060']);
   echo "<div align='center'>
<form name='loginform' method='post' action='".FUSION_SELF."'>
".$locale['061']."<br>
<input type='text' name='user_name' class='textbox' style='width:100px'><br>
".$locale['062']."<br>
<input type='password' name='user_pass' class='textbox' style='width:100px'><br>
<input type='checkbox' name='remember_me' value='y'>".$locale['063']."<br><br>
<input type='submit' name='login' value='Login' class='button'><br>
</form>
<br>
</div>\n";
   closetable();
}
require_once "footer.php";
?>



Redagavo Tomcis· 2009 Sau. 25 20:01:52