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

  • Home
  • SEARCH
  • 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 577413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:09:02+00:00 2026-05-13T14:09:02+00:00

In a php page I have following code: if($_REQUEST[‘c’]!=) // I get error on

  • 0

In a php page I have following code:

if($_REQUEST['c']!="") // I get error on this line itself. Why?
{
 $pidis=(int)($_REQUEST['c']);
}

I keep getting Undefined index error.

On Googling I manage to understand that if a page is access without parameters (in URL) which we are trying to access we can get this error/warning. I believe that if a parameter is not defined in the URL it should just return empty instead of giving error/warning message.

I know that it is possible to suppress errors and warning by adding

error_reporting(E_ALL ^ E_NOTICE);

But I do not want to do this.

This same page work just fine on our company’s web server but does not work on our clients web server.

Why is this happening?

How to solve this problem?

  • 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-13T14:09:02+00:00Added an answer on May 13, 2026 at 2:09 pm

    You are getting that error because you are attempting to compare $_REQUEST['c'] to something when $_REQUEST['c'] does not exist.

    The solution is to use isset() before comparing it. This will remove the warning, since the comparison won’t happen if $_REQUEST['c'] doesn’t exist.

    if(isset($_REQUEST['c']) && $_REQUEST['c']!="")
    {
     $pidis=(int)($_REQUEST['c']);
    }
    

    It is an E_NOTICE level error, and your level of error reporting will affect whether the error shows up or not. Your client’s server has E_NOTICE level error reporting turned on, which is why it shows up there.

    It is a good idea to always develop using E_ALL so that you can catch this kind of error before moving your code to other servers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 296k
  • Answers 296k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Assuming Pages is a reference type, in which case default<T>… May 13, 2026 at 7:11 pm
  • Editorial Team
    Editorial Team added an answer You actually don't need to expose your DAO interfaces as… May 13, 2026 at 7:11 pm
  • Editorial Team
    Editorial Team added an answer Make sure your after_create :callback statement is after the has_many/belongs_to… May 13, 2026 at 7:11 pm

Related Questions

This one should be easy, I think. I have a paginated image gallery, and
I am making a simple Dynamic Website using PHP, where i allow the user
I'm using PHP 4.3.9, Apache/2.0.52 I'm trying to get a login system working that
Drupal version 6.12 I have a page whose input format is PHP. I simply
I am php page everything was working fine till today morning. Now the page

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.