Topic on Manual talk:Edit.php

AUTO CREATE PAGE using php shell_exec

1
1.175.57.106 (talkcontribs)

AUTO CREATE PAGE[edit]

To create automatically an new page use the following in an shell in an QNAP 459

This will create an new page called Page_I_want_to_create

/mnt/ext/opt/apache/bin/php /share/Web/VHost_qbox4u/conf/tech/mwk/maintenance/edit.php -s "Quick edit" -m Page_I_want_to_create < /share/Web/tst/aa.txt

Using PHP
The PHP interface : /mnt/ext/opt/apache/bin/php
The Mediawiki interface :/share/Web/VHost_qbox4u/conf/tech/mwk/maintenance/edit.php
My text to inject into the new page : /share/Web/tst/boilerpage.txt
 
 $cmd = '/mnt/ext/opt/apache/bin/php /share/Web/VHost_qbox4u/conf/tech/mwk/maintenance/edit.php -s "Quick edit" -m Page_I_want_to_create < /share/Web/tst/boilerpage.txt';
 $html_body 	.= "execute:$cmd<br>";
 $html_body 	.= shell_exec($cmd);
 // exchange the \n for <br>
 $html_body 	= nl2br($html_body);
Reply to "AUTO CREATE PAGE using php shell_exec"