- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Paramater passing - PHP
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2007 02:13 AM
тАО02-21-2007 02:13 AM
Further to my last thread in which I got PHP to work at DCL level, I now need to know how to pass paramaters to a PHP script called from DCL. I assume this can be done but can't find any references either on the web or in the manual.
Thanks for any hints
Regards
Paul
PS. for anyone interested, I am experimenting with the FPDF package to create PDFs from text files. With some interesting anomolies, it seems to work well and I can recommend it (so far!)
PB
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2007 02:16 AM
тАО02-21-2007 02:16 AM
SolutionI also saw a2html that converts normal listings with cobol style tables to html with tables (that you can move to XL with the right mouse button).
Fwiw
Wim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2007 03:24 AM
тАО02-21-2007 03:24 AM
Re: Paramater passing - PHP
"Like every shell application, the PHP binary accepts a number of arguments but your PHP script can also receive arguments. The number of arguments which can be passed to your script is not limited by PHP (the shell has a certain size limit in the number of characters which can be passed; usually you won't hit this limit). The arguments passed to your script are available in the global array $argv. The zero index always contains the script name (which is - in case the PHP code is coming from either standard input or from the command line switch -r). The second registered global variable is $argc which contains the number of elements in the $argv array (not the number of arguments passed to the script)."
Rob.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2007 03:34 AM
тАО02-21-2007 03:34 AM
Re: Paramater passing - PHP
Ummm... wow... that (at first attempt!) seems to do the trick. 20 out of 10!
Thanks muchly
(Though for general interest I'd still like to know how to pass the params so I don't have to ask again in another contect)
Best regards
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2007 09:00 PM
тАО02-21-2007 09:00 PM
Re: Paramater passing - PHP
I'm sorry - I missed your message earlier- it is entirely correct as I since discovered. Using this call:
php test_param.php P1=1 P2=2 P3=3
Where the file is:
print_r($argv);
print_r($argc);
?>
Produces:
Content-type: text/html
X-Powered-By: PHP/4.3.2
Array
(
[0] => test_param.php
[1] => p1=1
[2] => p2=2
[3] => p3=3
)
As you can see, arg 0 is the script name followed by args 1-n in the array. I bet if I echoed $argc it would have given the correct result.
Many thanks
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2007 09:50 PM
тАО02-21-2007 09:50 PM