![]() |
PHP help
Hi, can anybody help me? I was fiddling with my site's layout a while ago, didn't change anything important, and then, my PHP code stopped working.
<?php if ($id == $null) include("home.php"); else include("$id.php"); ?> Does anybody know why? It's the exact same code I've always used... |
You sure your host still supports it? O.o
I dun see anything wrong with it... |
did you accidently delete any files?
do any of your new files contain an ext different from .php...I dunno either... |
Code:
Edit: PHP should behave the same way as Java and C++ with the null keyword. You just need to enter "null", since it's not a variable. I hope you a 404 page script on your site in case someone tries to enter a bad value for $id. Your script doesn't have a failsafe if block. It's also considered better form to oraganise the code as I did (above). |
Yeah, I try to keep my site as organised as possible. And yes my host supports it, all pages on my site are linked by index.php?id=... and when you click the links they show up... I'll try what Hades said, thanks.
|
| All times are GMT -8. The time now is 4:52 PM. |
![]()
© 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.
Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.