I'm having a problem getting this to work..
I got 3 files,
start.C - Where i got my main() function
Menu.C & Menu.h - Where I'm trying to use hash_map
start.C
#include <iostream>
#include "Menu.h"
using namespace std;
int main() { /* test code here */ return 0; }
Menu.h ... (1 Reply)
Each thread has a copy of auto variables within a function, but variables
declared as static within a function are common to all threads. To circumvent
this can static variables be placed outside the function. If so, will the
scope of the variable be file only or will it be extern, and will each... (7 Replies)
My awk script searches for specified patterns in a text file and stores these values into mem variables.
Once this is done I want to Insert these values into a table.
How can I avail of the variable values outside the scope of awk script....
One method that I have tried is to write the... (7 Replies)
Heres an example.....
<~/abc>$ cat textfile
line 1
line 2
line 3
line 4
line 5
<~/abc>$ cat try.sh
#/bin/ksh
for runs in 1 2 3
do
A=$runs
echo "Inside A : $A"
done
echo "Outside A : $A" <- works fine (1 Reply)
I call my script with two parameters
myscript.sh aaa bbb
What is the way to access $1 and $2 values inside a function? I call the function like this
myfuntion $1 $1
but inside of the function, $1 and $2 are empty. Any suggestions? thank you in advanced. (1 Reply)
If I set a variable within a while-read loop, sometimes it's local to the loop, sometimes it's global, depending on how the loop is set up. I'm testing this on a Debian Lenny system using both bash and dash with the same results.
For example:
# Pipe command into while-read loop
count=
ls -1... (2 Replies)
Hi,
I want to know about the variable scope in shell script.
How can we use the script argument inside the function?
fn () {
echo $1 ## I want this argument should be the main script argument and not the funtion argument.
}
also are there any local,global types in shell script?
if... (3 Replies)
Friends,
I am using ksh under SunoS. This is what I have
In file1.sh
NOW=$(date +"%b-%d-%y")
LOGFILE="./log-$NOW.log"
I will be using this file through file1.sh as log file.
I have another script file2.sh which is being called inside my file1.sh. I would like to use the same log... (6 Replies)
Discussion started by: dahlia84
6 Replies
LEARN ABOUT PHP
import_request_variables
IMPORT_REQUEST_VARIABLES(3) 1 IMPORT_REQUEST_VARIABLES(3)import_request_variables - Import GET/POST/Cookie variables into the global scope
SYNOPSIS
bool import_request_variables (string $types, [string $prefix])
DESCRIPTION
Imports GET/POST/Cookie variables into the global scope. It is useful if you disabled register_globals, but would like to see some vari-
ables in the global scope.
If you're interested in importing other variables into the global scope, such as $_SERVER, consider using extract(3).
Warning
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
PARAMETERS
o $types
- Using the $types parameter, you can specify which request variables to import. You can use 'G', 'P' and 'C' characters respec-
tively for GET, POST and Cookie. These characters are not case sensitive, so you can also use any combination of 'g', 'p' and 'c'.
POST includes the POST uploaded file information.
Note
Note that the order of the letters matters, as when using " GP", the POST variables will overwrite GET variables with the
same name. Any other letters than GPC are discarded.
o $prefix
- Variable name prefix, prepended before all variable's name imported into the global scope. So if you have a GET value named "
userid", and provide a prefix " pref_", then you'll get a global variable named $pref_userid.
Note
Although the $prefix parameter is optional, you will get an E_NOTICE level error if you specify no prefix, or specify an
empty string as a prefix. This is a possible security hazard. Notice level errors are not displayed using the default error
reporting level.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
import_request_variables(3) example
<?php
// This will import GET and POST vars
// with an "rvar_" prefix
import_request_variables("gp", "rvar_");
echo $rvar_foo;
?>
SEE ALSO
$_REQUEST, register_globals, Predefined Variables, extract(3).
PHP Documentation Group IMPORT_REQUEST_VARIABLES(3)