很多站长朋友们都不太清楚phppbulic,今天小编就来给大家整理phppbulic,希望对各位有所帮助,具体内容如下:
本文目录一览: 1、 php环境如何配置 2、 我想编写一个软件 比如计算器 要怎么做 求大神叫我 3、 php运行不了结果 网页拒绝访问 4、 php中flase字符怎么转换bool型 5、 php如何关联两个或者多个数据表? php环境如何配置1)、下载WAMP
所谓WAMP,是指在Windows系统(W)下安装Apache网页服务器(A)以及MySQL数据库(M)和PHP脚本引擎(P)而搭建起来的PHP网络服务器环境,当然,在LAMP环境肯定是比WAMP环境要好的,可是由于Windows的易用性,所以,我们在做前期开发或者测试某些CMS的时候,使用WAMP环境甚至很方便更实用一些。WAMP即这些单个软件共同组成了一个强大的Web应用程序平台。
2)、下载开发工具ZendStudio
Zend Studio是PHP 集成开发环境,具备功能强大的专业编辑工具和调试工具,支持PHP语法加亮显示,支持语法自动填充功能,支持书签功能,支持语法自动缩排和代码复制功能,内置一个强大的PHP代码调试工具,支持本地和远程两种调试模式,支持多种高级调试功能。
windows版 Zend Studio 8.0.1下载
2、安装程序
1)、WAMP 安装步骤图解
把WAMP下载到
选择WAMP安装路径,也可以默认路径。
SMP服务器地址
PHP 邮件服务器默认Email
设置启动浏览器。
安装完成,显示图片。
3、配置环境
安装完成后默认是英文。
设置WAMP语言。您可以设置其他的语言,当然我们设置为Chinese(中文)
WAMP重启以后就为中文了。您就可以通过WAMP去配置PHP环境了。
添加一个Alias目录,(就像在IIS上配置一个虚拟目录)
添加一个Alias目录名称。
设置Alias目录名称指向的物理路径。
4、PHP调试
在C:\wamp\phpDemo文件夹中添加Index.php文件,这时就可以在index.php 编写PHP代码了。
在浏览器地址栏中输入: 如果能看到上图PHP服务器配置相关信息,说明您的PHP服务器配置成功。
你可以直接访问 就可以查看刚才编写的index.php程序。显示页面执行的结果。
2)、PHP开发工具ZendStudio安装图
Zend Studio安装过程很简单,点击“Next”、“Next"基本就可以搞定。
安装完成后,你就可以添加一个PHP项目,编写你的PHP网站。在创建PHP项目时,要填写项目名称和保持路径。
这是你就可以在项目中添加PHP文件。编写PHP页面。
5、PHP开发环境
点击运行,就可以在Zend Studion IDE中浏览PHP页面执行的内容。
我想编写一个软件 比如计算器 要怎么做 求大神叫我那就要看你会什么语言了,c ,c#,java,vb 等等,太多了。给你个php代码,做参考:
form name="myform" method="POST">
008 <tr>
009 <script language = "javascript">
010 </script>
011 <td><input type="text" name="text1"/></td><br/>
012 <td><input type="text" name="sign" value="+"/<?$_GET['add']?></td><br/>
013 <td><input type="text" name="text2"/></td><br/>
014 <td><input type="text" name="text3"/></td><br/>
015 <td><input type="button" name="count" value="="/></td><br/>
016 <td><input type="text" name="equals"/></td><br/>
017 <td><input type="reset" name="reset"/></td><br/>
018 </tr>
019 <tr>
020 <script language = "javascript">
021 function count(text3){
022 var text1 = parseint(document.form.text1.value);
023 var text2 = parseint(document.form.text2.value);
024 }
025 switch(text3){
026 case 0:
027 document.form.text3.value = text1 + text2;
028 break;
029 case 1:
030 document.form.text3.value = text1 - text2;
031 break;
032 case 2:
033 document.form.text3.value = text1 * text2;
034 break;
035 case 3:
036 document.form.text3.value = text1 / text2;
037 break;
038 default(text3 = text1/text2!=0){
039 document.form.text3.value = text1/text2;
040 }
041 }
042 </script>
043 <td><input type="text" name="text1"/></td><br/>
044 <td><input type="text" name="sign" value="-"/><?$_GET['sub']?></td><br/>
045 <td><input type="text" name="text2"/></td><br/>
046 <td><input type="text" name="text3"/></td><br/>
047 <td><input type="button" name="count" value="="/></td><br/>
048 <td><input type="text" name="equals"/></td><br/>
049 <td><input type="reset" name="reset"/></td><br/>
050 </tr>
051 <tr>
052 <script language = "javascript">
053 </script>
054 <td><input type="text" name="text1"/></td><br/>
055 <td><input type="text" name="sign" value="*"/><?$_GET['mul']?></td><br/>
056 <td><input type="text" name="text2"/></td><br/>
057 <td><input type="text" name="text3"/></td><br/>
058 <td><input type="button" name="count" value="="/></td><br/>
059 <td><input type="text" name="equals"/></td><br/>
060 <td><input type="reset" name="reset"/></td><br/>
061 </tr>
062 <tr>
063 <script language = "javascript">
064 </script>
065 <td><input type="text" name="text1"/></td><br/>
066 <td><input type="text" name="sign" value="/"/><?$_GET['div']?></td><br/>
067 <td><input type="text" name="text2"/></td><br/>
068 <td><input type="text" name="text3"/></td><br/>
069 <td><input type="button" name="count" value="="/></td><br/>
070 <td><input type="text" name="equals"/></td><br/>
071 <td><input type="reset" name="reset"/></td><br/>
072 </tr>
073 </form>
074 <?php
075 class calculate{
076 pbulic $text1;
077 public $text2;
078 public $text3;
079 function add($text1,$text2){
080 $text3 = $text1 + $text2;
081 $this->text1=$text1;
082 $this->text2=$text2;
083 echo "$_GET[add]";
084 }
085 function sub($text1,$text2){
086 $text3 = $text1 - $text2;
087 $this->text1=$text1;
088 $this->text2=$text2;
089 echo "$_GET[sub]";
090 }
091 function mul($text1,$text2){
092 $text3 = $text1 * $text2;
093 $this->text1=$text1;
094 $this->text2=$text2;
095 echo "$_GET[mul]";
096 }
097 function div($text1,$text2){
098 $text3 = $text1 / $text2;
099 $this->text1=$text1;
100 $this->text2=$text2;
101 echo "$_GET[div]";
102 }
103 function getresult(){
104 echo $text3 = ($text1 + $text2). ".$_GET[add]";
105 echo $text3 = ($text1 + $text2). ".$_GET[sub]";
106 echo $text3 = ($text1 + $text2). ".$_GET[mul]";
107 echo $text3 = ($text1 + $text2). ".$_GET[div]";
108 }
109
110 }
111 ?>
php运行不了结果 网页拒绝访问apache2.2的httpd配置中需要将PHP设置为可识别的脚本类型。
在httpd.conf中配置
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
PHPIniDir "c:/php"
然后重启apache2.2
--------------------------
下载 index.html是因为默认目录index使用的 index.html
在httpd.conf中修改
DirectoryIndex index.html变为下面内容
DirectoryIndex index.php index.html
php中flase字符怎么转换bool型<?php
function p($title,$mybool){
echo "<pre>".$title;
echo var_dump($mybool)."</pre>";
}
class foo {
function do_foo() {
echo "你好!";
}
}
echo"<pre>PHP中的其他类型转化为Bool类型</pre>";
//零
$n0=boolval(0);
p("零:",$n0);
//正整数
$n=boolval(2);
p("正整数:",$n);
//负整数
$nx=boolval(-2);
p("负整数:",$nx);
//字符空格
$ss=boolval(" ");
p("字符空格:",$ss);
//空字符串
$sn=boolval("");
p("空字符串:",$sn);
//字符串
$s=boolval("chinacion");
p("字符串:",$s);
//空数组
$an=boolval(array());
p("空数组:",$an);
//数组
$a=boolval(array(0=>1));
p("数组:",$a);
//null类型
$nu = boolval(NULL);
p("NULL:",$nu);
//object
$bar = new foo;
$bar;
$obj = boolval($bar);
p("Object:",$obj);
php如何关联两个或者多个数据表?至少三个方法可以实现:
一、使用视图来实现多表联合查询,
例如:创建视图:create view userstoposts as select u.name,u.qq,p.post_id,p.title, p.contents, p.contents from users as u,posts as p where u.name=p.name
二、直接使用表联合查询
例如:select u.name,u.qq,p.* from users as u,posts as p where u.name=p.name
三、结合PHP语言实现
例:1、
<?php
$Sql="select *from posts";
$Result=@mysql_query($Sql);
while($rows=mysql_fetch_assoc($Result)){
$sql1="select name,qq from users where name='".$rows['name']."'";
$result1=@mysql_query($sql1);
$rows1=mysql_fetch_assoc($result1);
$OUTPUT[]=array(
'name'=>$rows['name'],
'qq'=>$rows1['qq'],
'post_id'=>$rows['post_id'],
'title'=>$rows['title'],
'contents'=>$rows['contents']
);
}
print_r($OUTPUT);//可以你需要的结果输出
?>
关于phppbulic的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。