⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add.php

📁 基于Fase 4 RDF/RSS语法分析器
💻 PHP
字号:
<?if ($submit) {		$fp = fopen ("sites", "w");	echo "<div align=\"center\">";	echo "<table width=\"475\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\"><tr><td>";		for ($i = 0; $i <= $_POST['count']; $i++) {		if ($_POST['chk_'.$i]) {			echo "<font color=\"red\">deleting ".$_POST['title_'.$i]." : ".$_POST['url_'.$i]."</font><br>";		} elseif ($_POST['url_'.$i]) {			echo "adding ".stripslashes($_POST['title_'.$i])." : ".$_POST['url_'.$i]."<br>";			fputs($fp, stripslashes($_POST['title_'.$i]).", ".htmlspecialchars($_POST['url_'.$i])."\n");		}	}				echo "<br></td></tr></table></div>";	fclose($fp);	unset($rdf_arr);}	$fp = fopen ("sites", "r");if ($fp) {		while (!feof($fp)) {		$line_arr = explode (",", fgets($fp, 1024));		if ($line_arr[1]) {				$rdf_arr = array_merge( $rdf_arr, array(trim($line_arr[0])=>trim($line_arr[1])) );		}	}		if (sizeof($rdf_arr) > 0) { ksort($rdf_arr); }	fclose($fp);	$i = 0;	?><div align="center"><form method="post"><table width="475" border="0" cellspacing="0" cellpadding="2" class="border">	<tr>		<td>			<table width="475" border="0" cellspacing="0" cellpadding="4" class="menu">				<tr>					<th align="left">Del</th>					<th align="left">Title</th>					<th align="left">Url to RSS</th>				</tr><?				if (sizeof($rdf_arr) > 0) {					foreach ($rdf_arr as $key=>$val) {			?>						<tr>							<td><input type="checkbox" name="<?= "chk_".$i ?>" value="1"></td>							<td><input type="text" name="<?= "title_".$i ?>" size="20" value="<?= trim($key) ?>"></td>							<td><input type="text" name="<?= "url_".$i ?>" size="60" value="<?= trim($val) ?>"></td>						</tr><?						$i++;					}				}?>				<tr>					<td>&nbsp;</th>					<td><input type="text" name="<?= "title_".$i ?>" size="20"></td>					<td><input type="text" name="<?= "url_".$i ?>" size="60"></td>				</tr>				<tr>					<td colspan="3" align="right">						<input type="hidden" name="count" value="<?= $i ?>">						<input type="submit" name="submit" value="Update">						<input type="button" name="cancel" value="Back" onclick="javascript: window.location = 'index.php'"></td>							</tr>			</table>		</td>	</tr></table></form></div><?	} else {		echo "Couldn't open sites file. Please make sure that the text file 'sites' exists in this directory and is world writeable"; 	}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -