PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I made a site for my old elementary school when I was designing and testing it I put it on my server. It worked fine. But when I put the site up on their server the PHP in the site no longer works. I don't know PHP really at all but here is the code that is giving me trouble:
Note that I know for a fact that PHP is supported by the school's server. Any help would be really appreciated I have played around with this for a while and have done a lot of web searches but haven't been able to solve my problem. Thanks
So I should replace the $tab with $_GET['tab']? And I should do that everywhere that $tab is right now? Also what sort of bad things could happen with the code as it is now? Thanks.
So register_globals is turned off. I read the link that you sent me and tried a few more things, but I seem to be completely lost. This is really my first stab at PHP and what I am using right now another kid at school gave me, so I am really not all that comfortable with the language yet. But I felt like I should use this so that it would make it easier for the woman at my old elementary school to update. Thanks for your help so far, I think i am just missing something.
Thank You so much!!! And I am sure that Jonesboro Elementary school thanks you to. Thanks to you guys those poor little kids get a working web site now
Just FYI, using $_GET['tab'] everywhere is bad. There is absolutely no validation and not sanitization/filtration on that. What I would have done is left $tab where you had, and somewhere before that, had something like this:
<?php
// Set the tab var from the querystring
$tab = isset($_GET['tab']) ? $_GET['tab'] : '';
// Spend some time making sure the data that was
// passed to the querystring is not going to take
// down your server or compromise your users
/* ... doing that here ... */
// Now use it in the original context of the code.
?>
<?php
// Set the tab var from the querystring
$tab = isset($_GET['tab']) ? $_GET['tab'] : '';
// Spend some time making sure the data that was
// passed to the querystring is not going to take
// down your server or compromise your users
/* ... doing that here ... */
// Now use it in the original context of the code.
?>
@Everah: What does the ? $_GET['tab'] : " do in the above example? I've never seen that before.
Just as a note, it is not something I recommend developers use unless it is a simple and easy to understand case. I tend to favor complete control structures versus short ones like that.