php
mysql_query("insert into guahao values('".$name."','".$nl."','".$shouji."','".$sname."','".$info."')");
echo"开头";
{
$b = 'class'.$i;
echo $b;
}
echo"结尾";
或者
if($i==1) echo"开头";
if($i==1) echo"结尾";
//这不很简单吗
$folder="C:\wamp\www\d";
$fp=opendir($folder);
while(false!=$file=readdir($fp)){
if($file!='.'?$file!='..'){
$file="$folder/$file";
$arr_file[]=$file;
if(is_array($arr_file)){
while(list($key,$value)=each($arr_file)){
echo?$value;
$key=file_get_contents($value);
if?(preg_match($_patten,$key))?{
file_put_contents($value,?$a);
closedir($fp);
index.php 录入页代码form id="form1" name="form1" method="post" action="login.php"
tr
input type="text" name="User_name" id="User_name" / /td
/tr
tdinput type="Password" name="User_Password" id="User_Password" //td
td
input type="submit" name="button" id="button" value="提交" /
/table
/form login.php提交页代码?
error_reporting(0);
$mysql_username = "root";
$mysql_database ="first";
mysql_connect($mysql_servername , $mysql_username , $mysql_password);
mysql_select_db($mysql_database);
$U_name=$_POST['user_name'];
$U_passowrd=$_POST['user_password'];
if ($U_name $U_passowrd){
$sql = "SELECT * FROM admin WHERE U_name = '$U_name' and U_password='$U_passowrd'";
$res = mysql_query($sql);
$rows=mysql_num_rows($res);
if($rows){
header("location='c.php'");
exit;
echo "script language=javascriptalert('用户名密码错误');history.back();/script";
}else {
echo "script language=javascriptalert('用户名密码不能为空');history.back();/script";
最好不要用中文文件名
$content = file_get_contents('shuju.txt');
echo 'shuju.txt 内容:'.$content;
if(isset($_GET['action'])){
if($_GET['action']==1){
file_put_contents('open.txt','');
echo '创建打开.txt';
file_put_contents('close.txt','');
echo '创建关闭.txt';
input type="button" value="打开" onclick="window.location='?action=1'"
PHP是一种可以嵌入到HTML中的运行在服务器端的脚本语言,所以为了体现PHP的特性我们可以分两种模式来实现PHP代码
①.、 PHP嵌入到HTML中,例如index.php
html
head/head
body
!--因为PHP嵌入到HTML中,所以需要完全区分PHP代码和HTML代码--
//输出hello?world
echo?'hello?world;
/body
/html
//输出
echo?'hello?world';
//不需要闭合标签
以上就是土嘎嘎小编为大家整理的求一个超简单的php代码相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!