Sponsored Content
Top Forums Shell Programming and Scripting Php server globals REQUEST_URI or HTTP_SERVER_VARS Post 302827755 by Scott on Sunday 30th of June 2013 03:14:43 PM
Old 06-30-2013
Think of it as an if-then-else:
Code:
if (isset($GLOBALS['HTTP_SERVER_VARS']) && isset($GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']))
  $something = $GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI'];
else
  $something = $_SERVER['REQUEST_URI'];

There are examples here: Control Structures: If - PHP Manual
This User Gave Thanks to Scott For This Post:
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl: globals and a package.

I am still learning perl and confused on this script I am revising at work. The original author uses a package, which I have left in the code; however, I cannot seem to access the global variable $dir. Code snippet: I have also tried using $RRD_MG::dir to no avail. Thank you. (6 Replies)
Discussion started by: effigy
6 Replies

2. UNIX for Advanced & Expert Users

AIX, web server, php

Hi there, I'm sorry , I can't be here every day but everytime I have a problem, I remember of you :) So, here goes the situation. I'm working with an installed AIX 5.2. I didn't make that install. I had to install php by a package that I've found in... (0 Replies)
Discussion started by: kisoun
0 Replies

3. Shell Programming and Scripting

Hiding PHP code on the server

Hi all, Sometime back, had put up a Q regarding hiding perl code. A: There is a utility known as 'pp' which comes along with PAR. Downloaded from CPAN. These people have done wonderful work I must say. Cool executables from perl scripts. Have one more... (4 Replies)
Discussion started by: sudhir_onweb
4 Replies

4. Shell Programming and Scripting

how to access globals in a function

I know any globals can be directly modified in a function without passing/returning parameters- provided the function is written within the same file. However, when I wrote functions in a saparate file (so hopefully they can be re-used by multiple script programs), and then call them from the main,... (11 Replies)
Discussion started by: bluemoon1
11 Replies

5. Web Development

php and perl on apache server

I'm having problems opening php and perl files on Apache. The server hasn't any association with those type of files by default and a window asking to choose a program to open them popups from the browser. How can I do to process them with the browser Thanks in advance. (1 Reply)
Discussion started by: capibolso
1 Replies

6. UNIX for Advanced & Expert Users

how to know which version of PHP and apache is in my server?

Hi, How to get the version of php, apache and WebSphere instealled in my server. The OS is AIX. Thanks in advance. R R VARMA (1 Reply)
Discussion started by: RRVARMA
1 Replies

7. Shell Programming and Scripting

Test Server - Forum Code Changes for PHP 5.3.10 to PHP 7

Here is some docs of my ongoing work to port this forum PHP code which is running on 5.3.10, to PHP 7. Motivation: Unfortunately, every thing that has a beginning must have an end. PHP 5.6 active support ended January 19, 2017. It will receive security support until December 31, 2018. #1 ... (7 Replies)
Discussion started by: Neo
7 Replies
MYSQL_PING(3)								 1							     MYSQL_PING(3)

mysql_ping - Ping a server connection or reconnect if there is no connection

SYNOPSIS
Warning This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include: omysqli_ping(3) bool mysql_ping ([resource $link_identifier = NULL]) DESCRIPTION
Checks whether or not the connection to the server is working. If it has gone down, an automatic reconnection is attempted. This function can be used by scripts that remain idle for a long while, to check whether or not the server has closed the connection and reconnect if necessary. Note Automatic reconnection is disabled by default in versions of MySQL >= 5.0.3. o $ link_identifier -The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect(3) is assumed. If no such link is found, it will try to create one as if mysql_connect(3) was called with no arguments. If no connection is found or established, an E_WARNING level error is generated. Returns TRUE if the connection to the server MySQL server is working, otherwise FALSE. Example #1 A mysql_ping(3) example <?php set_time_limit(0); $conn = mysql_connect('localhost', 'mysqluser', 'mypass'); $db = mysql_select_db('mydb'); /* Assuming this query will take a long time */ $result = mysql_query($sql); if (!$result) { echo 'Query #1 failed, exiting.'; exit; } /* Make sure the connection is still alive, if not, try to reconnect */ if (!mysql_ping($conn)) { echo 'Lost connection, exiting after query #1'; exit; } mysql_free_result($result); /* So the connection is still alive, let's run another query */ $result2 = mysql_query($sql2); ?> mysql_thread_id(3), mysql_list_processes(3). PHP Documentation Group MYSQL_PING(3)
All times are GMT -4. The time now is 05:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy