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 am having a real problem with a tutorial I am trying to get thru. I am running this in Dreamweaver with WAMP and PHPMyAdmin on a Vista machine. I can't figure out why this single simple line of code is not working.
or No if not keeps coming back "No". I have looked around but can't find a simple reason why this will not work. Is it my Dreamweaver or my WAMP settings or the fact that I am using Vista??? I have been working on this since yesterday and can get everything working but this simple function that is driving me crazy. I can't go any further without this. I know that you guys must cringe at some of the stupid this we ask, but I would really appreciate some help.
Copy and Pasted and it worked! Now the question is, how can I sit here and watch the video tutorial and it works just fine without this line of code? I hate to just blindly accept this fix without knowing why the author would just leave this out, and apparently doesn't need it. Seriously, thanks a bunch, I can continue now but anyone with an idea as to why this works/not works would be appreciated. Thanks again.
It's a setting in your php installation called register_globals. If it's set to on, there's automatically a variable called $whatever for any $_GET['whatever'] variable in a URL such as:
Yes it is for security reasons.
But if you set all your in risk factor variables to default meaning (ex. NULL) at the begging of the code there is no risk to use register_globals. In some cases it might be event helpful.
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
My word, how could you possibly suggest that!! Do you want your code to be not very well thought of?
Yeah, I've had a chance to look into this a little bit since it was pointed out to me. Looks like this move by PHP has critics and defenders. I really appreciate the help and follow up comments.