关于php获取变量有关问题
关于php获取变量问题
- PHP code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->@$judge=$_GET["speed"]; if(@$keyboard=$_GET["keyboard"]){ $keyboardfinal=100; } if(@$judge==1){ if($keyboard0){ @$keyboardfinal=50; } } if(@$judge==2){ if(@$keyboard0){ $keyboardfinal=50; } } if(@$judge==3 && (@$keyboard0)){ $keyboardfinal=50; }
如上代码~为什么在第二,三,四个if语句中,即使条件成立任然无法使$keyboardfinal=50;成立为什么呢?
------解决方案--------------------
@$judge=$_GET["speed"];
为什么变量前面加@有什么特别效果吗?
------解决方案--------------------
不明白楼主为什么要加那么多错误控制符,如果不报出错误,你怎么修改代码呢?
将楼主的代码修改了下:
- PHP code
$judge = 1; $keyboard = 35; $keyboardfinal = null; switch($judge){ case 1: if($keyboard0) $keyboardfinal=50; break; case 2: if($keyboard0) $keyboardfinal=50; break; case 3 && ($keyboard0): $keyboardfinal=50; break; } echo "keyboardfinal-->>".$keyboardfinal; #50 <br><font color="#e78608">------解决方案--------------------</font><br>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Razer recently introduced the Snap Tap feature for perfect counter-strafing on the Huntsman V3 Pro keyboards, and Wooting responded to community requests with Snappy Tappy (formerly SOCD). These hardware-based keyboard features make it easier to coor

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

What is AMP Coin? The AMP token was created by the Synereo team in 2015 as the main trading currency of the Synereo platform. AMP token aims to provide users with a better digital economic experience through multiple functions and uses. Purpose of AMP Token The AMP Token has multiple roles and functions in the Synereo platform. First, as part of the platform’s cryptocurrency reward system, users are able to earn AMP rewards by sharing and promoting content, a mechanism that encourages users to participate more actively in the platform’s activities. AMP tokens can also be used to promote and distribute content on the Synereo platform. Users can increase the visibility of their content on the platform by using AMP tokens to attract more viewers to view and share

While integrated keyboard cases for iPad have their obvious advantages, there are downsides too, such as the added weight and bulk to an otherwise thin tablet, and the inability to use it with other devices, or even other iPad versions. Logitech’s ne

Retro mechanical keyboards are all the rage these days, with the likes of the IBM Model M — although not technically mechanical — having gone from e-waste to veritable geek gold in recent years. However, the Model M isn't the only attractive keyboard

Retro mechanical keyboards are all the rage these days, with the likes of the IBM Model M — although not technically mechanical — having gone from e-waste to veritable geek gold in recent years. However, the Model M isn't the only attractive keyboard

Getting started in a hobby like mechanical keyboards can be rather daunting at first. There are almost too many options to choose from, and many of the most popular recommended brands on sites like Reddit are exorbitantly expensive. Fortunately, a li

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。
