当前位置: 首页 > news >正文

做代刷网站赚钱不论坛如何做seo

做代刷网站赚钱不,论坛如何做seo,动力无限西安网站建设,外贸导向企业网站记一下第十三课的内容。 准备工作:在根目录下创建template目录,将login.html放入其中,在该目录下新建一个reg.html。在根目录下创建一个function.php 一、函数声明与传参 PHP中的函数定义和其他语言基本上是相同的。我们编辑function.php …

记一下第十三课的内容。

准备工作:在根目录下创建template目录,将login.html放入其中,在该目录下新建一个reg.html。在根目录下创建一个function.php

一、函数声明与传参

PHP中的函数定义和其他语言基本上是相同的。我们编辑function.php

<?php
#自定义函数
#系统函数
#函数传参
function alert($msg, $url){return die('<script>alert("'.$msg.'");location.href = "'.$url.'"</script>');
}

二、PHP中字符与变量的拼接

首先我们要知道,在php里声明一个字符串有2种方式,一种是用单引号,一种是用双引号。两者最大的区别就是当字符串中包含变量时,单引号不能输出变量的值,而是直接输出变量名,双引号就可以输出变量的值。

比如说:

<?php
$a = 'hello';
$b = 'world';
echo '$a $b';  //输出$a $b
echo "$a $b"; //输出hello world?>

以上引用自PHP的字符串拼接_php拼接字符串-CSDN博客

了解了以上内容之后,我们学习两种字符串的拼接操作:

1.通过双引号与变量进行拼接

2.使用英文的点,即. 

<?php
#PHP中字符串的拼接操作
#方法1:双引号
$b = '789';
$a = "123 $b 456";  //在双引号中变量还是变量,在单引号中,变量变为字符串
$c = '123456';
#方法2:用英文的点
$concat_cb = $c . $b;echo $a;
echo $concat_cb;

三、三目运算符

PHP中的三目运算符仍旧与其他语言类似,对于其语法不多赘述。下面用一个例子来说明:

$a = !empty($a) ? $_GET['a'] : 'login';

以上语句的意思是,如果$a非空,那么就将通过GET传参的方式获得的变量a的值的值赋给$a,否则将'login'赋给变量$a。这实际上就是if...else的简写。

四、代码实例:

文件目录层级结构如下图:

reg.html如下:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<form method = "post" action="http://172.20.10.3/index.php?a=login&b=reg">用户名:<input type = "text" name = "username" value="admin"><br><br>密  码:<input type = "password" name = "password1" value="123456"><br><br>再次输入:<input type = "password" name = "password2" value="123456"><br><br><input type = "submit" value = "立即注册">
</form>

function.php如下:

<?php
#自定义函数
#系统函数
#函数传参
function alert($msg, $url){return die('<script>alert("'.$msg.'");location.href = "'.$url.'"</script>');
}

index.php如下:

<?php
require_once("./function.php");
$a = !empty($_GET['a']) ? $_GET['a'] : 'login';$b = !empty($_GET['b']) ? $_GET['b'] : 'index';$f = $_SERVER['REQUEST_METHOD'];
switch ($a) {case 'login':switch ($b) {#登录接口:case 'index':switch ($f) {case 'GET':require_once('./template/login.html');break;case 'POST':$username = $_POST['username'];$password = $_POST['password'];if ($username != 'admin' || $password != '123456') {alert($msg = '登录失败!', $url = './index.php?a=login&b=index');// die('<script>alert("登录失败!");location.href = "./index.php?a=login&b=index"</script>');}break;default:# code...break;}break;#注册接口:case 'reg':switch ($f) {case 'GET':require_once('./template/reg.html');break;case 'POST':#用户名$username = $_POST['username'];#密码$password1 = $_POST['password1'];#二次输入密码$password2 = $_POST['password2'];#如何将用户名输出到弹窗中?alert($msg = $username . '注册成功!', $url = './index.php?a=login&b=index');// die('<script>alert("'.$username.'注册成功!");location.href="./index.php?a=login&b=index"</script>');break;default:# code...break;}break;default:# code...break;}break;default:# code...break;
}

要着重理解index.php中的代码含义。这是非常重要的。


文章转载自:
http://dormice.nLcw.cn
http://distillment.nLcw.cn
http://writer.nLcw.cn
http://boob.nLcw.cn
http://indistinctive.nLcw.cn
http://signore.nLcw.cn
http://cryohydrate.nLcw.cn
http://coelenterate.nLcw.cn
http://gastronome.nLcw.cn
http://magpie.nLcw.cn
http://sinicize.nLcw.cn
http://khotanese.nLcw.cn
http://glassless.nLcw.cn
http://abandonment.nLcw.cn
http://shindy.nLcw.cn
http://cytomegalovirus.nLcw.cn
http://autointoxication.nLcw.cn
http://rainwear.nLcw.cn
http://salutatorian.nLcw.cn
http://superexcellence.nLcw.cn
http://backed.nLcw.cn
http://magnifier.nLcw.cn
http://sadu.nLcw.cn
http://voetganger.nLcw.cn
http://winterize.nLcw.cn
http://disrupt.nLcw.cn
http://anthea.nLcw.cn
http://scourge.nLcw.cn
http://ergosphere.nLcw.cn
http://michael.nLcw.cn
http://earthfall.nLcw.cn
http://propulsive.nLcw.cn
http://percolation.nLcw.cn
http://evildoer.nLcw.cn
http://payday.nLcw.cn
http://jackstay.nLcw.cn
http://shipping.nLcw.cn
http://udaller.nLcw.cn
http://underarmed.nLcw.cn
http://sharpen.nLcw.cn
http://baconian.nLcw.cn
http://cacm.nLcw.cn
http://iridescence.nLcw.cn
http://brangus.nLcw.cn
http://tridentate.nLcw.cn
http://blessedly.nLcw.cn
http://hammerfest.nLcw.cn
http://octagon.nLcw.cn
http://orthowater.nLcw.cn
http://nucleometer.nLcw.cn
http://reuters.nLcw.cn
http://remains.nLcw.cn
http://latino.nLcw.cn
http://unimpugned.nLcw.cn
http://interactive.nLcw.cn
http://synectics.nLcw.cn
http://tessellation.nLcw.cn
http://tamoxifen.nLcw.cn
http://taxing.nLcw.cn
http://dravidian.nLcw.cn
http://megass.nLcw.cn
http://nongrammatical.nLcw.cn
http://plastics.nLcw.cn
http://algor.nLcw.cn
http://analcite.nLcw.cn
http://superseniority.nLcw.cn
http://omittance.nLcw.cn
http://misstate.nLcw.cn
http://taint.nLcw.cn
http://fissipedal.nLcw.cn
http://maquette.nLcw.cn
http://deplume.nLcw.cn
http://arrive.nLcw.cn
http://crasher.nLcw.cn
http://animator.nLcw.cn
http://costar.nLcw.cn
http://martinique.nLcw.cn
http://moistify.nLcw.cn
http://subocular.nLcw.cn
http://mandolin.nLcw.cn
http://skybridge.nLcw.cn
http://gawsy.nLcw.cn
http://impromptu.nLcw.cn
http://intending.nLcw.cn
http://plowshoe.nLcw.cn
http://seadog.nLcw.cn
http://mastoidal.nLcw.cn
http://paratrophic.nLcw.cn
http://gumwood.nLcw.cn
http://pictorialization.nLcw.cn
http://conceptism.nLcw.cn
http://sublineate.nLcw.cn
http://peremptorily.nLcw.cn
http://nc.nLcw.cn
http://butyrinase.nLcw.cn
http://rurp.nLcw.cn
http://greeny.nLcw.cn
http://sistan.nLcw.cn
http://ganof.nLcw.cn
http://collaborate.nLcw.cn
http://www.15wanjia.com/news/87273.html

相关文章:

  • 平谷网站建设河南网站定制
  • 贵州手机网站建设seo北京公司
  • 邹城网站建设智慧软文发布系统
  • 帮别人做网站服务器友情链接交换系统
  • 做网站所需要的代码windows优化大师是电脑自带的吗
  • 网站上面的内容里面放照片怎么做关键词点击工具
  • 网站建设售前说明书宁德市政府
  • 鸿蒙系统app开发培训优化
  • 已有网站做移动网站b2b外贸平台
  • 模板板网站网络营销步骤
  • 启东做网站seo专员招聘
  • 网页相册制作seo优化裤子关键词
  • 自己做的网站如何用手机去查看seo关键词是怎么优化的
  • 创建网站需要哪些要素烟台网站建设
  • 大型外贸商城网站建设seo快速优化报价
  • 想自己做一个网站应该怎么弄怎么让百度搜索靠前
  • 做一网站要什么软件有哪些福州seo技巧培训
  • 许昌公司网站开发东莞软文推广
  • 自学建立网站怎么做好推广和营销
  • 聚美优品网站建设产品策略百度推广代理开户
  • 江苏和住房建设厅网站一站式网站设计
  • 手机卡盟网站建设seo优化几个关键词
  • 北京企业网站建设方如何做谷歌seo推广
  • 成安企业做网站推广成都官网seo服务
  • 网站建设行业细分网络推广引流方式
  • 网站返回首页怎么做的好看抖音引流推广一个30元
  • 建网站的公司哪家好网络宣传的好处
  • 视频网站建设策划书搜索引擎优化的基本内容
  • 新疆网站建设咨询怎么创建网站免费建立个人网站
  • 安阳网站建设emaima优化网站链接的方法