Jump to content

[SOLVED] Best Way to do this?


Lamez

Recommended Posts

Can you give any more information ?

 

Something like this maybe,

 

$string = $_POST['string'];
$sql = mysql_query("SELECT * FROM `table_name` WHERE `string`='$string'");
if (mysql_num_rows($sql) >= 1){
echo "Existing String";
} else {
echo "String Not In Table";
}

Wow that worked wonders, thank you so much, here is how I used that code:

 

<?php
  //begin checking for blacklisted...
  
 	//$par = parse_url($n_url);
	//$n_url = $par['host'];//grab base url
	$n_url = addwww($n_url);//add www
        //$n_url = addPro($n_url);//add http://
        $string = $_POST['string'];
        $sql = mysql_query("SELECT * FROM `blacklist` WHERE `url`='".$n_url."'");
	$r = mysql_fetch_array($sql);
         if (mysql_num_rows($sql) >= 1){
	  $_SESSION['o_url'] = $r['url'];
           header("Location: ?url=".$black);
          }
	  


  //end check, everything cleared...
?>

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.