I'm trying to create a php page which takes data from my python code and show them as a table.
r = requests.post('http://localhost/index.php', data={"iv":a,"ven":b,"hem":c,"card":d,"ecg":e}) print(r.text) In above code, I post data then print it to check if everything is okay. My r.text output
<table><tr><th>IV Pump</th><th>Ventilator</th> <th>Heart Monitor</th><th>Cardiac Machine</th><th>Echocardiogram</th></tr><tr><td>off</td><td>on</td><td>off</td><td>off</td><td>off</td></tr></table> which seems fine because I can get a,b,c,d,e (on/off basically). However when I open my index.php I cannot see those "on"s and "off"s. I am newbie on server things, PHP, etc. My mistake is probably very dummy. Should I store post data in somewhere? My index.php:
<?php $iv=$_REQUEST['iv']; $ven=$_REQUEST['ven']; $hem=$_REQUEST['hem']; $card=$_REQUEST['card']; $ecg=$_REQUEST['ecg']; echo '<table>'; echo '<tr>'; echo '<th>IV Pump</th>'; echo '<th>Ventilator</th> '; echo '<th>Heart Monitor</th>'; echo '<th>Cardiac Machine</th>'; echo '<th>Echocardiogram</th>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo $iv; echo '</td>'; echo '<td>'; echo $ven; echo '</td>'; echo '<td>'; echo $hem; echo '</td>'; echo '<td>'; echo $card; echo '</td>'; echo '<td>'; echo $ecg; echo '</td>'; echo '</tr>'; echo '</table>'; ?> My r.text is ok, but in web page I cannot see request data, the table cells are empty. What is the difference? As I know r.text returns the page content, so index.php must be wrong, I guess it is about storing the data.