Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007

    How to write false $_REQUEST, please help

    This is if statement $_REQUEST if the language translated

    if ($_REQUEST['language']) {

    i need to set the opposite, if the language not translated, what its looks like, please help

    which one is correct? or no one of them

    if (!$_REQUEST['language']) {

    if ($_REQUEST!['language']) {

    if !($_REQUEST['language']) {
    Lets be stable diligent person

  2. #2
    Join Date
    Jun 2007
    if (!$_REQUEST['language']) {

  3. #3
    Join Date
    Apr 2008
    Montreal, Qc., Canada
    PHP will throw a notice if "language" index isn't found in the URL with the above suggestion.

    Use this, instead :

    PHP Code:
    if (!isset($_REQUEST['language']))
    'Index nout found.';

  4. #4
    You can use empty() function, which checks is variable empty or not.
    If you use isset() function it will fail if $_REQUEST['language']='' because variable is SET to empty string.

    Function empty() checks if variable IS EMPTY or not.
    This IMO is better solution:

        echo 'Index not found.';

Similar Threads

  1. Replies: 0
    Last Post: 10-09-2009, 10:38 AM
  2. $_GET, $_POST and $_REQUEST not working....
    By jaseeey in forum Hosting Security and Technology
    Replies: 3
    Last Post: 11-03-2008, 03:24 AM
  3. $var = 'FALSE' or FALSE
    By seodevhead in forum Programming Discussion
    Replies: 2
    Last Post: 11-14-2005, 04:45 PM
  4. $_POST and $_REQUEST crossing
    By PlanetWebHost in forum Programming Discussion
    Replies: 11
    Last Post: 10-13-2005, 12:03 PM
  5. Replies: 13
    Last Post: 08-26-2002, 02:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts