Jump to content
Sign in to follow this  
Armed Rebel

What is better?

Recommended Posts

I've just started learning PHP and I was wondering. Would it be a better idea to set a varible such as "$_GET[user_name]" as $user_info?Does it really matter? I've just been keeping it as $_GET[user_name].

Share this post


Link to post
Share on other sites

_GET defines the scope in which the variable is stored. It is always better to get in the habit of including the scope of the variable in all your calls. In ensures that a variable is not being defined in some other, unexpected, way - i.e. being hacked.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...