Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How to write false $_REQUEST, please help
Old 04-05-2011, 04:49 PM How to write false $_REQUEST, please help
Skilled Talker

Posts: 78
Name: syu
Trades: 0
This is if statement $_REQUEST if the language translated

Quote:
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

Quote:
if (!$_REQUEST['language']) {
}

Quote:
if ($_REQUEST!['language']) {
}

Quote:
if !($_REQUEST['language']) {
}
__________________
Lets help each other
basketmen is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-05-2011, 04:53 PM Re: How to write false $_REQUEST, please help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the third one
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-05-2011, 10:33 PM Re: How to write false $_REQUEST, please help
Junior Talker

Posts: 1
Trades: 0
if(!$_REQUEST['language']){} //CORRECT ***
if($_REQUEST!['language']){} //INCORRECT
if!($_REQUEST['language']){} //INCORRECT

Let me know if you have any other question.
Jesuso1410 is offline
Reply With Quote
View Public Profile
 
Old 04-06-2011, 07:26 AM Re: How to write false $_REQUEST, please help
Junior Talker

Posts: 3
Trades: 0
First one is correct. if(!$_REQUEST['language']){} this one is correct.
__________________
Girish Mathur

Please login or register to view this content. Registration is FREE
, India

Please login or register to view this content. Registration is FREE
sritechnocrat is offline
Reply With Quote
View Public Profile
 
Old 04-09-2011, 04:19 PM Re: How to write false $_REQUEST, please help
Novice Talker

Posts: 5
Trades: 0
if(!isset($_REQUEST['language'])){}
or
if(empty($_REQUEST['language'])){}

also usable
__________________

Please login or register to view this content. Registration is FREE
iTower is offline
Reply With Quote
View Public Profile Visit iTower's homepage!
 
Old 04-11-2011, 03:34 AM Re: How to write false $_REQUEST, please help
vivekar's Avatar
Webmaster Talker

Posts: 612
Trades: 0
A more efficient way is to use:
if(empty($_REQUEST['language'])) {
Do my PHP code
}

Read more on Empty() and Isset() in PHP

Do you really need to use $_REQUEST?
Generally, if you are getting from a URL use $_GET. If you are expecting from a form post method, use $_POST. You'll have better control of the inputs.

More on http://stackoverflow.com/questions/1...s-get-and-post
__________________

Please login or register to view this content. Registration is FREE
(Active since 2003) |
Please login or register to view this content. Registration is FREE

Last edited by vivekar; 04-11-2011 at 12:27 PM.. Reason: ! mistake
vivekar is offline
Reply With Quote
View Public Profile Visit vivekar's homepage!
 
Reply     « Reply to How to write false $_REQUEST, please help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.86872 seconds with 12 queries