php转jsp 贴代码《Bulletproof Ajax中文版》没看过 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 formlogic.php如下:<?$output = '';$required = array('email','name','message');$errors = array();if (isset($_REQUEST['submit'])) { foreach ($required as $field) { if (empty($_REQUEST[$field])) { $errors[$field] = 'this is required'; } } if (count($errors)<1) {// Send an email $output.= '<p class="feedback">'; $output.= 'Thank you for getting in touch'; $output.= '</p>'; echo $output; return; }}$output.= '<form method="post" id="contactform" action="'.$_SERVER['PHP_SELF'].'">';$fields = array( 'name' => 'text', 'email' => 'text', 'message' => 'textarea');foreach ($fields as $field => $type) { $output.= '<p>'; $output.= '<label for="'.$field.'">'; $output.= ucwords($field); if (isset($errors[$field])) { $output.= ' <strong class="error">is required</strong>'; } $output.= '</label>'; switch ($type) { case 'textarea': $output.= '<textarea name="'.$field.'" id="'.$field.'" cols="30" rows="10">'; if (isset($_REQUEST[$field])) { $output.= htmlspecialchars($_REQUEST[$field]); } $output.= '</textarea>'; break; default: $output.= '<input type="text" name="'.$field.'" id="'.$field.'"'; if (isset($_REQUEST[$field])) { $output.= ' value="'.htmlspecialchars($_REQUEST[$field]).'"'; } $output.= ' />'; break; } $output.= '</p>';}$output.= '<p><input type="submit" name="submit" value="Submit" /></p></form>';echo $output;?> php 的语法,太差劲了... 怎么看也不习惯.... 呵呵 不虽然勉强可以读下去,但是太不习惯了.头大,你还是到php社区去,让那边的仁兄帮你注释一下吧. 关于java算法 tomcat调试出错 一个关于myeclipse自动生成表对应的映射文件和JAVA文件 请问大家平时都是用什么工具来整理源代码的? josn 转为数组 刚学者问题 怎么判断字符传为空? 请教: tomcat 装上,后该怎么配置,才能运行. 问两个非常简单的问题? help!!!菜鸟求助!如何配置iis与resin,才能让我的站点能支持jsp! 为什么ie没有打开文件保存对话框 如何在Eclipse中使用JavaMail啊?
} if (count($errors)<1) {// Send an email $output.= '<p class="feedback">';
$output.= 'Thank you for getting in touch';
$output.= '</p>'; echo $output;
return; }
}$output.= '
<form method="post" id="contactform" action="'.$_SERVER['PHP_SELF'].'">';$fields = array(
'name' => 'text',
'email' => 'text',
'message' => 'textarea'
);foreach ($fields as $field => $type) { $output.= '
<p>';
$output.= '
<label for="'.$field.'">';
$output.= ucwords($field);
if (isset($errors[$field])) {
$output.= ' <strong class="error">is required</strong>';
}
$output.= '</label>'; switch ($type) { case 'textarea':
$output.= '
<textarea name="'.$field.'" id="'.$field.'" cols="30" rows="10">';
if (isset($_REQUEST[$field])) {
$output.= htmlspecialchars($_REQUEST[$field]);
}
$output.= '
</textarea>';
break; default:
$output.= '
<input type="text" name="'.$field.'" id="'.$field.'"';
if (isset($_REQUEST[$field])) {
$output.= ' value="'.htmlspecialchars($_REQUEST[$field]).'"';
}
$output.= ' />';
break; } $output.= '
</p>';}$output.= '
<p>
<input type="submit" name="submit" value="Submit" />
</p>
</form>
';echo $output;?>
头大,你还是到php社区去,让那边的仁兄帮你注释一下吧.