...

View Full Version : hmm phpbb code for ip search not working



stoodder
04-03-2003, 12:45 PM
well here is what i have so far.. the IPs get encrypted into hex format BTW so yea lol hereis my code i know its not done yet:

<?php
$phpbb_root_path = './../';
require($phpbb_root_path . 'config.php');
mysql_connect($dbhost, $dbuser, $dbpasswd);
mysql_select_db($dbname);
$post = $_POST['ipaddresss'];
GLOBAL $post;
$findip = ENCODE_IP("$post");
if($mode=="search") {
$sql="SELECT * FROM phpbb_posts WHERE poster_ip='" . $findip . "'";
$query=mysql_query($sql);
while($fetch=mysql_fetch_row($query)) {
$usersql="SELECT * FROM phpbb_users WHERE user_id='" . $fetch[3] . "'";
$userquery=mysql_query($usersql);
while($userfetch=mysql_fecth_row($userquery)) {
echo"$userfetch[2]";
}
}
}
if($mode=="") {
echo"<form action=ipsearch.php?mode=search method=POST>
<input type=text name='ipaddresss'><br><input type=submit>
</form>";
}
?>
it says th encode_ip() functiuon is called to undefined

firepages
04-03-2003, 02:34 PM
we need to see the ENCODE_IP() function ... + the GLOBAL call is pointless unless you are already within a function , even then if you just use $_POST['ipaddress'] then its automagically global.

but post the ENCODE_IP() function else we cant really help.

mordred
04-03-2003, 07:11 PM
And don't forget to use indentation and a little more whitespace to maintain the readability of your code, stoodder. Makes it easier for us to help.

stoodder
04-03-2003, 08:39 PM
lol ya sorry oh yea i knew it was already global cept i couldnt get the code to work so i just tested you know??? but if you want here ius my page the thingy is located at still doesnt work so yea lol http://forum.shadowgelert.com/admin/ipsearch.php

mordred
04-03-2003, 10:06 PM
And this page basically tells us what firepages had already diagnosed.. the function encode_ip is unknown in the script. Perhaps you should include the function in this script so it can be used, hm?

stoodder
04-04-2003, 01:58 PM
ooo ic so that means there is no fontction encode php thats why! ha thankies lots i get it now lol



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum