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 7397915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:48:26+00:00 2026-05-29T03:48:26+00:00

I recently installed the WAMP server package on my computer at work. When I

  • 0

I recently installed the WAMP server package on my computer at work. When I first started messing around with PHP(not too long ago), I installed PHP, MySQL, and Apache manually. Well, the application I have been working on is now giving me a WHOLE BUNCH of Notice messages:

Notice: Undefined index: lookatLon in C:\wamp\www\coordinates.php on line 3

Well, as it turns out, I have learned that I am handling my assigning of $variable = $_REQUEST[‘whatever’]; all wrong. For example… I have a script that accepts a $longitude and $latitude from a $_GET[‘longitude’]; and $_GET[‘latitude’] …. but under certain circumstances, the page is loaded without any ‘longitude=’ or ‘latitude=’ in the url.

Now I am getting these notices that it isn’t liking my unset variables.

So, my question is, what is the proper way to handle a situation, where sometimes there is GET or POST information available and sometimes there isn’t. I just read that it is not a good idea to shut off the notices(which would surely fix my problem), but rather the solution is to code properly.

So what is the proper way to account for GET or POST data that may or may not be there, depending on the situation?

  • 1 1 Answer
  • 0 Views
  • 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-29T03:48:26+00:00Added an answer on May 29, 2026 at 3:48 am

    To get values you have to initialize variables, like this

    $longitude = '';
    $latitude = '';
    if (isset($_GET['longitude'])) $longitude = $_GET['longitude'];
    if (isset($_GET['latitude'])) $latitude = $_GET['latitude'];
    

    and later use assigned variables

    To control the program flow you may query the request variable directly:

    if (isset($_GET['id'])) {
      //get data
    }
    
    • DO NOT use $_REQUEST. Know where your data from and don’t let it interfere.
    • you may wish also do some validation on request variables.
    • you may keep variables in the array, if you gonna batch process them, to create an SQL statement, for example.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently installed the BIRT all in one developer program and started fooling around
I recently installed PHP APC on our server via our WHM panel (Web Host
I recently installed Windows 2008 Server to replace a crashed hard drive on a
We recently installed Team Foundation Server 2008 and we are using it for both
I recently installed PHP on IIS/Windows 7, but it isn't working. I am getting
I recently installed WAMP for actual local use. I've worked on live development servers
I recently installed VS2010 on my new computer. I got all my VS projects
I recently installed PHP 5 on IIS, however, I am unable to find a
I recently installed a Real Player on my Android. If I long press on
I recently installed a Windows Server 2008 R2. I added the role Hyper-V. I

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.