Why use POST to submit regular expression string output is only one point??

<?php
	header('Content-Type:text/html;charset=utf-8');
	
	$conn = mysql_connect('localhost', 'root', '19aeacv44899d4ff') or die('Could not connect: '.mysql_error());
	mysql_query('set names utf8');
	
	$db = mysql_select_db('mytest', $conn);
	if (! $db) {
		die("Can\'t use download: ".mysql_error());
	} else {
		if ($_POST) {
			echo $_POST['ListPreg'];
			$sql1 = 'UPDATE `mytest`.`spiders` SET `ListPreg` = "'.$_POST['ListPreg'].'", `ContentPreg` = "'.$_POST['ContentPreg'].
						'"'.', `EnterUrl` = "'.$_POST['EnterUrl'].'" WHERE `spiders`.`ID` = 1 LIMIT 1';
			$result1 = mysql_query($sql1, $conn);
			//mysql_free_result($result1);
			mysql_close($conn);
			exit;
			header('Location: manage.php');
		}
		$sql = 'SELECT * FROM `spiders` LIMIT 0, 30';
		$result = mysql_query($sql, $conn);
		$row = mysql_fetch_array($result);
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Acquisition management interface</title>
</head>

<body>
	<form action="manage.php" method="post">
		Acquisition management
		<hr />
		The collector described <input type="text" name="Title" id="Title" size="40" value="" /><br /><br />
		The column 
		<select name="Category">
			<option value="1">Auto Channel</option>
		</select><br /><br />
		List page. <input type="text" name="EnterUrl" value="<?php echo $row['EnterUrl'] ?>" size="60" /><br /><br />
		List page matching description <textarea name="ListPreg" cols="80" rows="4"><?php echo $row['ListPreg'] ?></textarea><br /><br />
		The content page matching description <textarea name="ContentPreg" cols="80" rows="4"><?php echo $row['ContentPreg'] ?></textarea><br /><br />
		<input type="submit" class="btn" name="Submit" value="Rule "/> <input to type=" button "class=" BTN "name=" Submit "value=" began collecting" onclick="javascript: window.open('spiders.php?cid=1');" />
	</form>
</body>
</html>


The regular expression to me:
/<li><a href="(/news/.+?.shtml)" title=".+?" target="_blank" class="fl">/

The program plans to enter a regular expression is stored in the database (as a string), but the print_r is only a little

Started by Hamiltion at October 29, 2016 - 3:08 AM

And remove the mysql_free_result (notes) will have a warning: Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in /usr/local/apache/htdocs/mytest/manage.php on line 16

Posted by Hamiltion at November 01, 2016 - 3:56 AM

1, You what browser? Apparently HTML markers in the regular analysis, this should not appear in the textarea markup phenomenon
2, mysql_free_result($result1); Before the implementation of update directive
Does not have the resources to release problem, also cannot release! Because the return is not resource, but the logical value

Posted by Hunk at November 04, 2016 - 3:57 AM