Jump to content

A few things..


DeathStar

Recommended Posts

Now i got a problem:

It strips things like

<script>

but i put an if in to die if it has that but doesnt seem to work:

e
$name2 = $_POST['name'];
if (strip_tags($name2)){
die("Contained Tags");}
else {
$name1 = $name2;}
$name = mysql_real_escape_string($name1);
$reson2 = $_POST['reson'];
if (strip_tags($reson2)){
die("Contained Tags");}
else {
$reson1 = $reson2;}
$reson = mysql_real_escape_string($reson1);
$status2 = $_POST['status'];
if (strip_tags($status2)){
die("Contained Tags");}
else {
$status1 = $status2;}
$status = mysql_real_escape_string($status1);
$email2 = $_POST['email'];
if (strip_tags($email2)){
$email1 = "Removed. Contained Tags";}
else {
$email1 = $email2;}
$email = mysql_real_escape_string($email1);
$ip2 = $_POST['ip'];
if (strip_tags($ip2)){
die ("Contained Tags");}
else {
$ip1 = $ip2;}
$ip = mysql_real_escape_string($ip1);
$whois2 = $_POST['whois'];
if (strip_tags($whois2)){
die ("Contained Tags");}
else {
$whois1 = $whois2;}
$whois = mysql_real_escape_string($whois1);
$date2 = date("H:i d/m/Y");
$date1 = strip_tags($date2);
$date = mysql_real_escape_string($date1);
$about2 = $_POST['about'];
if (strip_tags($about2)){
die ("Contained Tags");}
else {
$about1 = $about2;}
$about = mysql_real_escape_string($about1);
$affected2 = $_POST['affected'];
if (strip_tags($affected2)){
die ("Contained Tags");}
else {
$affected1 = $affected2;}
$affected = mysql_real_escape_string($affected1);

Link to comment
https://forums.phpfreaks.com/topic/44155-a-few-things/#findComment-214420
Share on other sites

lumo, you starting to sound like my one friend lol  :D

 

SO i am supposed to get the query's and display it liek this:

$query = mysql_query("SELECT * FROM `table`");
$q = mysql_fetch_array($query);
echo "<table><tr><td>Name</td></tr>";
echo "<tr><td>";
echo strip_tags($q['name']);
echo "</td></tr></table>";

 

??

Link to comment
https://forums.phpfreaks.com/topic/44155-a-few-things/#findComment-214465
Share on other sites

yea yea..

 

I did it that way now but i am getting this error:

Fatal error: Call to undefined function: stript_tags() in /home/deathsta/public_html/index.php on line 72

 

Here is my code aka beautified:

 

$sm  = mysql_query("SELECT * FROM tablename ORDER BY $by $ord LIMIT 100");
$no1 = $st + 1;
$no2 = $st + 100;
print "<font color=white>Showing $no1 to $no2 by order of $by $ord.
<table width='533' height='21' border='0' align='center' cellpadding='0' cellspacing='1' bordercolor='#000000' bgcolor='#FF0000'>
  <tr>
    <td width='100'><div align='center'><span class='style5'>Name</span></div></td>
    <td width='200'><div align='center'><span class='style5'>Reson</span></div></td>
    <td width='80'><div align='center'><span class='style5'>Status</span></div></td>
    <td width='200'><div align='center'><span class='style5'>E-mail</span></div></td>
<td width='200'><div align='center'><span class='style5'>IP</span></div></td>
    <td width='120'><div align='center'><span class='style5'>Added:</span></div></td>
    <td width='1200'><div align='center'><span class='style5'>Links</span></div></td>
  </tr>";

while ($s = mysql_fetch_array($sm))
{
  print "<tr class=\"off\" onmouseover=\"this.className='on'\" onmouseout=\"this.className='off'\">
    <td><font color=#333333>";
  echo stript_tags($s['name']);
  echo "</td>";
  echo "<td>";
  $str = ($s['reson']);

  if (strlen($str) <= 6)
  {
   echo stript_tags($str);
   echo "</td>";
  }
  else
  {
   $substr = substr($str, 0, 6);
   echo stript_tags($substr);
   echo "...";
   echo "</td>";
  }

  if ($s['status'] == 0)
  {
   print "<td bgcolor=white><font color=#333333>None</td>";
  }
  elseif ($s['status'] == 1)
  {
   print "<td bgcolor=yellow><font color=#333333>Abuser</td>";
  }
  elseif ($s['status'] == 2)
  {
   print "<td bgcolor=orange><font color=#333333>Beware</td>";
  }
  elseif ($s['status'] == 3)
  {
   print "<td bgcolor=red><font color=#333333>Ban</td>";
  }

  echo "<td><font color=#333333>";
  echo stript_tags($s['email']);
  echo "</td>
    <td><font color=#333333>";
  echo stript_tags($s['ip']);
  echo "</td>
    <td><font color=#333333>";
  echo stript_tags($s['date']);
  echo "</td>
<td><center><font color=#333333><a href='http://www.google.com/search?q={$s['name']}' target='_new' class='mystl'><img src='google.gif' alt='load' /></a> <a href='http://www.yahoo.comsearch?p={$s['name']}'><img src='yahoo.gif'></a> <font color=#333333><a href='index.php?user={$s['sid']}' class='mystl'><img src='view.gif'></a></td>
  </tr>";
}

print "</table>";

 

Link to comment
https://forums.phpfreaks.com/topic/44155-a-few-things/#findComment-214480
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.