WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Passing VARS on PHP cmdline (argv)
Categories : Variables, PHP Update Picture
Rasmus Lerdorf
Date : Oct 23rd 1998
Grade : Be the 1st to grade this Code Example
Viewed : 9563
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Rasmus Lerdorf
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

> When running the php cgi executable from a bash command line (eg. ./php
> script.php3), how do I pass a var to the script? (eg. ./php
> script.php3?var=something)

./php script.php3 abc def

This will set $argv[1] to "abc" and $argv[2] to "def"

Now, if you want to pass it an argument similar to the CGI ?var=something
then you need to set this in the QUERY_STRING environment variable.

So, for a Bourne-shell based call:

QUERY_STRING="var=something" ./php script.php3



A quick way set data from a form to a function or other places where you can lose scope.
Categories : PHP, HTML and PHP, Variables
The following snippet gives complete info about all submitted HTTP_POST_VARS and HTTP_GET_VARS
Categories : Variables, HTTP, PHP
Passing variables by reference.
Categories : Variables, PHP
Display variables when a form is submitted using POST/GET
Categories : PHP, Functions, Variables, Debugging
A class to put get and post variables in hidden form elements. Works on scalars, normal arrays, associative arrays.
Categories : Algorithms, Variables, Arrays, PHP, PHP Classes
How to pass an array to a function, or how to define a function wich recieves an array.
Categories : Variables, PHP, Arrays
Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET
Categories : Algorithms, HTML and PHP, PHP, Variables
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
PHP Dump in html format the contents of one array variable with a recursive list of the nested array variables inside.
Categories : PHP, Arrays, Variables
Initialize global variables for every field in a table. This version requires that phplib is installed on your server.
Categories : Global Variables, MySQL, PHP, Variables
Functions to read a template file and fill in PHP variables. It will also fill in array variables, displaying parts of the template multiple times.
Categories : PHP, Variables, Filesystem
How to display a PHP variable value from a selectbox without reloading the page by merging PHP and Javascript variables.
Categories : PHP, Java Script, Variables
Dump the contents of a PHP variable in html format with a recursive list of subfolders and files from a given root directory.
Categories : PHP, Directories, Variables, Arrays
A database abstraction layer for the PHP Oracle 8 module (available from PHP 3.0.5). It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface.
Categories : Databases, Oracle, PHP, Arrays, Variables
Working with files - return an array of files within a directory
Categories : PHP, Strings, Variables, Filesystem