when i click on rock, paper,scissors it still displays all $items and if i type in (for example) '?item=example' it stil displays all $items... and i have checked all of my code...
You don't have to check if a function equals TRUE or FALSE. If it's true if(isset($_GET['item'])) works the same if you checked if it's equal to true. And when it comes to false you can just use if(!in_array($item,$items)) instead of checking if it actually returns false. The exclamation point will do the same. And since the isset function checks if the variable EXISTS, it does not check if it has a value. You can do $item = $_GET['item'] and as long ?item= is in the URL it will return true.
@lifeg0eson666 The isset() function does return true if the variable is set (has a value other than NULL), and not if the variable exists. I may be wrong, so can you explain what you mean by the variable existing?
Great tutorial!
Please check out my PHP Game tutorial, I hope you'll find it interesting! :)
CyberSpaceFilms 2 months ago
Love the wallpaper ♥♥♥
TheRyanneCruz 3 months ago
when i click on rock, paper,scissors it still displays all $items and if i type in (for example) '?item=example' it stil displays all $items... and i have checked all of my code...
scfcFaNaTiC 9 months ago
thanks, I am learning php to make a brower game and this is really great
wixnarara 10 months ago
@wixnarara me too!!:D
amirdj3 9 months ago
no tutorial for Win XP
7Mehtab 10 months ago
what program do you code in? is it only for mac's ?
GardartHD 10 months ago
@GardartHD You can make it with Notepad++
R3AP3RPT 9 months ago
This has been flagged as spam show
@GardartHD
You can make it with Notepad++
R3AP3RPT 9 months ago
Can you make a zip file with the source code and the files you used?
LegendMachine 1 year ago
program for record ?
tarik884 1 year ago
i like your name, its unique.
rune500125 1 year ago
MAC sucks :)
iron888888 1 year ago
@iron888888 you suck dick
aimerlicious 1 year ago
Can i have a link for the wallpaper? :)
CriminalCity01 2 years ago
thx but can you give as a source code....
funnyfacesproduction 2 years ago
can i use notepad?
funnyfacesproduction 2 years ago
yes
bowersbros 2 years ago
@funnyfacesproduction yes, but it'd be better if you got an IDE like eclipse with the php dev add-on
ThePhpdev 1 year ago
This has been flagged as spam show
BOOORING! As simple as:
switch($_GET['human']){
case $_GET['human']:($computer==$_GET['human'])?"draw";break:NULL /*NO BREAK */;
case 0:($computer==1)?"win":"lose";break;
case 1:($computer==2)?"win":"lose";break;
case 2:($computer==0)?"win":"lose";break;
}
//SQL
Doyubi 2 years ago
@Doyubi
dude, this script doesn't even work btw, you don't need to put a semi-colon after a comment...
scfcFaNaTiC 9 months ago
Can We Get a source ?
3446698 2 years ago 15
@3446698
NO! FUCKING SCRIPT SKIDDLE!!!
iPhpMaster 1 year ago
@iPhpMaster Haha. I know what what im talking about. Source As in All the files. Really Dood. I know what im talking about. Grow up Haha
3446698 1 year ago
Nice video, but your code is very unoptimized...
ignas2526 2 years ago
If you do if($_GET['item']) that checks to see if it exists and HAS a value. This method is generally more efficient than using isset
lifeg0eson666 2 years ago
Thanks, I know I don't have to add ( == TRUE ) but I prefer that, but I never paid attention to make sure it had a value.
ScoobyDooobyD00 2 years ago
Good tutorial for beginners though, good job.
lifeg0eson666 2 years ago 8
Thanks
ScoobyDooobyD00 2 years ago 5
You don't have to check if a function equals TRUE or FALSE. If it's true if(isset($_GET['item'])) works the same if you checked if it's equal to true. And when it comes to false you can just use if(!in_array($item,$items)) instead of checking if it actually returns false. The exclamation point will do the same. And since the isset function checks if the variable EXISTS, it does not check if it has a value. You can do $item = $_GET['item'] and as long ?item= is in the URL it will return true.
lifeg0eson666 2 years ago
@lifeg0eson666 The isset() function does return true if the variable is set (has a value other than NULL), and not if the variable exists. I may be wrong, so can you explain what you mean by the variable existing?
Aggregate02 2 weeks ago
nice vid man! :D
crazymanny00 2 years ago