superglobals Questions

6

Solved

So, I don't come from a huge PHP background—and I was wondering if in well formed code, one should use the 'superglobals' directly, e.g. in the middle of some function say $_SESSION['x'] = 'y'; or ...
Kittykitwe asked 16/8, 2010 at 23:24

5

Solved

I've got this message warning on Netbeans 7.4 for PHP while I'm using $_POST, $_GET, $_SERVER, .... Do not Access Superglobal $_POST Array Directly What does it mean? What can I do to correct ...
Bersagliere asked 4/11, 2013 at 12:39

2

As noted in the PHP documentation, the $_SERVER superglobal array contains two elements, REQUEST_TIME and REQUEST_TIME_FLOAT, both of which contain the timestamp of the start of the request, in var...
Illuminism asked 26/3, 2015 at 21:38

2

the INPUT_POST Parameter of the PHP filter function filter_input_array() e.g. in filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING); seems to overwrite any modification applied to the superg...
Codee asked 17/8, 2017 at 10:36

4

I am learning PHP from w3schools' PHP Tutorial. While learning PHP I came across the concept of predefined global variables i.e. Superglobals. In a curiosity to understand "Superglobals" more d...
Outrigger asked 7/1, 2017 at 18:0

2

Solved

I'm discovering secrets of PHP. I've found one thing that I don't have answer to. I would like to access variables from super-global $_SESSION in class. Everything works but PHPMD engine to check m...
Hallowed asked 17/7, 2016 at 17:23

3

Solved

Zend Framework 1 had a very simple way of parsing URL routes and setting found params in the $_GET superglobal for easy access. Sure, you could use ->getParam($something) inside the controller, but...
Doubletongued asked 5/8, 2012 at 23:11

2

Solved

I don't know maybe it's a bug. I have 2 virutalhosts on my server. virtualhost1.com virtualhost2.com if i open virtualhost1.com with port 80 (virtualhost1.com:80) $_SERVER['HTTP_HOST']='virtual...
Festatus asked 21/12, 2010 at 23:11

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

1

Solved

Are this methods a reliable way to measure a script: $time = ($_SERVER['REQUEST_TIME_FLOAT'] - $_SERVER['REQUEST_TIME']); or $time = (microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']); Which ...
Bowlder asked 24/2, 2015 at 18:48

5

Solved

As a web developer, I'm always using this approach to something like a login form or other “save” operation (ignoring the dangers of directly accessing input variables): if (isset($_POST['action']...
Shawnshawna asked 24/8, 2010 at 16:8

3

Solved

I can't find any mention of it in the documentation, but there seems to be an additional entry in the $_SERVER superglobal named UNIQUE_ID? What is this value used for? It's fairly obvious that it...
Janeljanela asked 8/8, 2014 at 5:0

2

I have generally assumed that in a PHP script I can test $_SERVER['REMOTE_ADDR'] to establish the IP address from which the request originated. However, I am starting to wonder if things are not a ...
Jeffreyjeffreys asked 24/6, 2014 at 14:5

3

Solved

Is there a place to find a list of the possible values for the PHP predefined constant PHP_OS ? I'd like to use this value for a system requirements check, but need to know how different operating ...
Seethe asked 10/4, 2009 at 20:51

1

Solved

What happens on the server to set the request time? Does it take into account the timezone for which the server is configured? I'm asking because I need to know, if I have a site that has a timezo...
Plasmasol asked 10/6, 2013 at 16:28

4

Solved

I have this framework project kind of on the backburner where I want to enforce the use of an Input class to access all superglobals like $_POST, $_GET and $_SERVER. A recent question here reminded...
Champollion asked 18/10, 2012 at 12:27

3

Solved

I recently came across this line in a PHP script: $_REQUEST['start_date']=$date; Is it allowed or useful in any way to assign something to the super global $_REQUEST variable? If there is a $_CO...
Pettitoes asked 19/6, 2012 at 8:15

1

I have a database full of website urls, the primary key is the $_SERVER["HTTP_HOST"] of the website. When a user navigates to ... lets say www.my-epic-example-url.com, It will connect the the data...
Stribling asked 27/4, 2012 at 12:27

7

Solved

I really hate global variables - maybe its the C# programmer in me but when I'm working in PHP I grit my teeth every time I have to do something like this: $strUsername = $_GET['username']; Yes,...
Ezekielezell asked 14/4, 2011 at 15:40
1

© 2022 - 2024 — McMap. All rights reserved.