Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 549399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:10:50+00:00 2026-05-13T11:10:50+00:00

alot of time in programming the value of variables are passed through url parameters,

  • 0

alot of time in programming the value of variables are passed through url parameters,
in php;

if (isset($_GET['var'])) {$var = $_GET['var'];}

But if that does not execute, we will have an unset variable, in which may cause errors in the remaining of the code, i usually set the variable to ” or false;

else {$var = '';}

I was wondering what are the best practices, and why : )

thank you!

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:10:50+00:00Added an answer on May 13, 2026 at 11:10 am

    create a function

    function get($name, $default = "") {
       return isset($_GET[$name]) ? $_GET[$name] : $default;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, I decided that it's time to learn a new skill, programming objective-c. My
I have created my first site and put alot of time into it and
I've being reading alot on how node.js can be used to add real time
So i created a web site a long time ago using a designer alot
I've spent a lot of time googling this and testing in my program, but
I'm not sure this is possible, but is there a way, using template programming
This question goes beoynd just programming, but I'd like to get some input on
I've just started programming with Java, so might appear as silly question, but I
First off, I'm very new to PHP (and programming in general) and I'm trying
Vim has alot of plugins, and it's a real versatile time tested text editor.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.