On StackO: "pass variable cli on linux to web page"
I have a web server on linux using apache with php support, II'm glad user1772519 is aware of what a kludge it is to use sed to edit the PHP file. But the way the if was constructed? Tsc, tsc...
have a client machine that have open in a browser an specific web page
from the server, the page is refreshing every second because its shows
and email address when postfix receive and email
this is the code of the file mounted in the server called mish.php
<?php $mail=NULL if ($mail == NULL) goto end else echo $mail; end: echo."awaiting mail"; ?>
However I do not understand how to pass the
sed -i '2s/.*/$mail="email@example.com";/' /var/www/emergencia/mish.php
and in consecuence the page shows now the email as desired.
I am aware that using
sedto do this is a kludge but do not understand PHP/LAMP architecture enough to pass the variable in the right way - can this be done with bash, php cli, perl, via
$_GET, etc.? What would be the proper practice?
heh - you realise that's after a few edits - stack overflow is a collaborative wiki... I invite you especially to look at the first edit - [the revision log]