isset Questions

5

Solved

I want to make sure that certain fields are posted as part of the form but I don;t mind if some are empty values. The 'required' validation rule won't work as I am happy to accept empty strings. I...
Azerbaijan asked 3/7, 2013 at 14:24

4

Solved

I don't understand the difference between isset() and !empty(). Because if a variable has been set, isn't it the same as not being empty?
Universal asked 14/12, 2013 at 11:56

1

I'm aware of the benchmarks for isset() vs empty(), but I have code I need to execute only when the argument is null. This is in a function that executes many times so I'd like to optimize it. I ...
Preparation asked 2/7, 2017 at 6:11

1

I have several submit inputs (buttons) on a page, with the following issetconditions: if ( isset( $_POST[ 'noranTelChecks' ] ) ) { // user requested noranTelCheck sheet header( 'location: noranTe...
Inconsequential asked 1/4, 2017 at 11:44

8

Solved

I am looking to expand on my PHP knowledge, and I came across something I am not sure what it is or how to even search for it. I am looking at php.net isset code, and I see isset($_GET['something']...
Caponize asked 25/8, 2012 at 23:17

17

Solved

From the isset() docs: isset() will return FALSE if testing a variable that has been set to NULL. Basically, isset() doesn't check for whether the variable is set at all, but whether it's set to...
Brythonic asked 6/1, 2009 at 20:46

3

I am new to php and handling server side. I have a domain "www.example.co.in". And another addon domain "www.example.com". I have created a new folder "www.example.com" at the root folder(public_h...
Redound asked 9/12, 2016 at 12:3

11

Solved

Is there something in javascript/jQuery to check whether variable is set/available or not? In php, we use isset($variable) to check something like this. thanks.
Marja asked 20/11, 2010 at 8:1

8

Solved

I'm coding a worksheet app for a printer company. I'm getting flood of forms. For every single input field I have to check if the $_POST variables are set, and if, so echo back the value. (In cas...
Euphuism asked 11/4, 2011 at 15:2

1

if(isset($_GET['a'] or $_GET['b'])){ echo "ok"; }else{ echo "no"; } i have two var for one condition when isset $_GET['a'] or $_GET['b'] always echo ok either echo no
Syntactics asked 17/8, 2015 at 22:57

3

Solved

Is there a way to check if an array index exists or is null? isset() doesn't tell you whether the index doesn't exist or exists but is null. If I do : isset($array[$index]) || is_null($array[...
Doi asked 9/3, 2013 at 11:43

4

Solved

Is $_SERVER['SERVER_ADDR'] always set? Should I check with isset() or is that unnecessary? I need to get the IP of the site so I can find out if it's 127.0.0.1/localhost
Nitpicking asked 10/8, 2011 at 22:51

8

Solved

I am creating a form and am just looking for more efficient ways to do things. What I have so far is: <p><input type="text" name="transmission" value="" /></p> <p><input...
Jointed asked 19/9, 2011 at 22:17

6

Solved

Note - I know pretty much about empty() and isset(), what I am asking is the most proper/efficient way of using them. I've just saw at php.net this sentence under empty() reference: No warn...
Southwestwardly asked 9/12, 2014 at 14:2

9

Solved

I'm writing quite often this line of code: $myParam = isset($params['myParam']) ? $params['myParam'] : 'defaultValue'; Typically, it makes the line very long for nested arrays. Can I make it sh...
Silken asked 21/11, 2011 at 18:25

3

Recently, I've attempted to be tricky and assign a variable inside of an isset function. I tried to do it like so if(isset($accountid =$_POST['Recipient'])) { // my code here ... } However, w...
Hifi asked 16/7, 2014 at 12:41

3

Is there a concise way to check if a variable is set, and then echo it without repeating the same variable name? Instead of this: <?php if(!empty($this->variable)) { echo '<a href="', ...
Crocein asked 12/4, 2013 at 11:30

3

Solved

I have basically coded a code which populates a list of categories from my database then you are able to select which to delete. I have the issue with the delete code which does not seem to work d...
Natalienatalina asked 21/4, 2014 at 21:1

8

In my project, I have a wrapper class for $_SESSION, so session variables can be accessed by $session->var. I was trying to check if session variables were set or not using isset: if (!isset($t...
Barca asked 20/3, 2012 at 6:17

3

Solved

I'm trying to make functions like empty() and isset() work with data returned by methods. What I have so far: abstract class FooBase{ public function __isset($name){ $getter = 'get'.ucfirst($n...
Anglophobia asked 5/6, 2011 at 11:23

4

Solved

I've noticed on XAMPP that strict error reporting is on and I get undefined index errors now. I just have two small questions (I'm still learning here): I know you don't have to declare variables ...
Wack asked 7/12, 2011 at 1:16

2

Solved

There is a lot of SO questions about the subject, notably this one, but it does not help me. There is an ambiguity between property_exists and isset so before asking my question, I'm going to point...
Donatello asked 24/5, 2013 at 7:32

3

although i used if(isset()) still get Notice: Undefined index: user_name in C:\xampp\htdocs\www\jq\182-186 Users online sample application\users.php here is part of PHP code if (isset($_POST['...
Couldst asked 2/1, 2014 at 11:29

3

Solved

I have a function f that takes two parameters (p1 and p2): If for the parameter p2 no value was passed to the function, the value of p1^2 should be used instead. But how can I find out within the ...
Barrens asked 1/11, 2011 at 9:55

4

Solved

I need to check if php://input exists/isset. Does it work with PHP isset() ? What is the proper way to check it?
Madaih asked 25/9, 2013 at 17:43

© 2022 - 2024 — McMap. All rights reserved.