PDA

View Full Version : Php help [QUICK]



Assassinator
10-12-2007, 08:59 PM
Basicly, i have made this up to know but it wont seem to work,

What i want it to do is, you type in the username and it completes the fields;

Here is my code,

Anybody get me lol?

Instead of fetching the username's i type, it just fetch's mine.


<td align="center" valign="top"><div align="center">



<table width="100%" height="94" border="1" cellpadding="0" cellspacing="0" class="thinline">



<tr>



<td height="21" colspan="4" background="skins/<?php echo"$fetch->skin"; ?>/grad.jpg"><div align="center">

Ip Check</div></td>



</tr>



<tr>



<td width="184" height="21" align="center">Username</td>



<td width="137" align="center">Ip</td>



<td width="149" align="center">Registered Ip</td>



<td width="105" align="center">Status</td>



</tr>











<?php







if ($_POST['search1']){



$username11 = $_POST['$username11'];



$fetchy=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username11'"));



$query=mysql_query("SELECT * FROM users WHERE l_ip='$fetch->l_ip' AND status='Alive'");



while($fetch = mysql_fetch_object($query)){



if($username11->status == "Dead"){



$username11="ModRevive";



}elseif($fetch->username11->status == "Alive"){



$username11="ModKill";



}



echo " <tr><td width=\"184\" height=\"21\"><div align=\"center\">$fetch->username11(<a onclick=$fetch($fetch->username11); href=#>$fetch!</a>)</div></td>



<td width=\"137\"><div align=\"center\">$fetch->l_ip</div></td>



<td width=\"149\"><div align=\"center\">$fetch->r_ip</div></td>



<td width=\"105\"><div align=\"center\">$fetch->status</div></td></tr>"; }



}











if ($_POST['search2']){



$tl_ip = $_POST['tl_ip'];



$fetchy=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE l_ip='$tl_ip'"));



$query=mysql_query("SELECT * FROM users WHERE l_ip='$fetch->l_ip' AND status='Alive'");



while($fetch = mysql_fetch_object($query)){



if($search2->status == "Dead"){



$search2="ModRevive";



}elseif($fetch->search2 == "Alive"){



$search2="ModKill";



}



echo " <tr><td width=\"184\" height=\"21\"><div align=\"center\">$tl_ip->username(<a onclick=$fetch($fetch->username); href=#>$fetch!</a>)</div></td>



<td width=\"137\"><div align=\"center\">$fetch->l_ip</div></td>



<td width=\"149\"><div align=\"center\">$fetch->r_ip</div></td>



<td width=\"105\"><div align=\"center\">$fetch->status</div></td></tr>"; }



}



?>



<tr>



<td height="21" colspan="4">



<div align="center">Username:



<input type="text" name="username11" id="username11" />



<input type="submit" name="search1" id="search1" value="Search Username" />



<br />



Ip:



<input type="text" name="tl_ip" id="tl_ip" />



<input type="submit" name="search2" id="search2" value="Search Ip" />



</div></td>



</tr>



</table>







</div>

MrCraig
10-12-2007, 09:42 PM
wouldnt u need to use some sort of javascript to make the content load without refreshing page?

Invent
10-12-2007, 09:47 PM
That is oh-so insecure.

Fix the security issues and I'll help ^_^

Assassinator
11-12-2007, 04:49 PM
That is oh-so insecure.

Fix the security issues and I'll help ^_^

What do you mean?

And this is only part of the script.

k
11-12-2007, 04:50 PM
kayne pm me your msn

Assassinator
11-12-2007, 04:58 PM
kayne pm me your msn

*Kane

And why?

MrCraig
11-12-2007, 07:58 PM
What do you mean?

And this is only part of the script.


And its a very insecure part of the script..

Remember to clean your variables and behind your ears :)

Zaub
12-12-2007, 03:46 AM
Not quite sure of the code, but you'd need to use AJAX.

Dentafrice,
12-12-2007, 08:34 PM
Ewww $fetch->blab->befaoij gross. Are you using a premade script?

Probably because you have defined $username11 about 50 times :\

$username11="ModRevive";

Want to hide these adverts? Register an account for free!