###Invoke Program
PHP:
1.create myscript.php source file
2./usr/local/zendsvr/bin/php-cli myscript.php
RPG:
| <form id="myform"> | |
| <input id="CustomerName" name="CustomerName" type="text" /> | |
| <input id="Phone" name="Phone" type="text" /> | |
| ... | |
| </form> | |
| <script type="text/javascript"> | |
| //Pull in all the data from the HTML form called myform | |
| var postData = $("#myform").serializeObject(); | |
| CREATE TABLE LIB.MYJSON ( | |
| ID BIGINT, | |
| DATA CLOB); | |
| <? | |
| $post = new Post(); | |
| $post->title = 'My first blog post!!'; | |
| $post->author_id = 5; | |
| $post->save(); | |
| # save runs SQL to insert the row into the db |
| WITH xx (CST_NAME, CST_COL_CNT, CST_SCHEMA, CST_TABLE) AS | |
| ( | |
| SELECT CONSTRAINT_NAME, CONSTRAINT_KEYS, CONSTRAINT_SCHEMA, TABLE_NAME FROM QSYS2.SYSCST A | |
| WHERE CONSTRAINT_TYPE = 'PRIMARY KEY' AND TABLE_NAME='MYTABLE' | |
| ) | |
| SELECT CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME FROM QSYS2.SYSCSTCOL, xx where | |
| xx.CST_SCHEMA = CONSTRAINT_SCHEMA AND | |
| xx.CST_TABLE = TABLE_NAME AND | |
| xx.CST_NAME = CONSTRAINT_NAME |
| <? | |
| class EmailValue | |
| { | |
| protected $value; | |
| public function __construct($emailAddress) | |
| { | |
| //sanitize for DB (NULL bytes, HTML and PHP tags stripped) | |
| $emailAddress = strip_tags($emailAddress); | |
| //Supposedly does more than strip tags | |
| $emailAddress = xss_clean($emailAddress); |
| <? | |
| try | |
| { | |
| $user="BOB"; | |
| $id="2"; | |
| $db=new PDO("ReplceW/ConnectionString"); | |
| $stmt=$db->prepare("UPDATE `users` SET user=:user WHERE ID =:ID"); | |
| $stmt->bindParam(":user",$user); | |
| $stmt->bindParam(":id",$id); | |
| $stmt->execute(); |
| <? | |
| $os = php_uname("s"); | |
| $phpversion = floatval(substr(phpversion (),0,3)); | |
| if($phpversion<5.6) | |
| { | |
| if($os=="OS400") | |
| { | |
| $defaultcafile = "/QOpenSys/QIBM/ProdData/SC1/OpenSSL/openssl-0.9.7d/cert.pem"; | |
| } | |
| else if ($os=="Linux") |
###Invoke Program
PHP:
1.create myscript.php source file
2./usr/local/zendsvr/bin/php-cli myscript.php
RPG:
| <tr> | |
| <td>storeEval</td> | |
| <td>new Array("","qa.","dev.");</td> | |
| <td>application_environment_array</td> | |
| </tr> | |
| <tr> | |
| <td>getEval</td> | |
| <td>index=0;</td> | |
| <td></td> | |
| </tr> |
| { | |
| "require": { | |
| "facebook/webdriver": "~1.0" | |
| } | |
| } |