Jump to content

elentz

Members
  • Posts

    228
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

elentz's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. I got netbeans and used it to make the page, and (After the light went on)and I realized what benanamen was saying, voila it all came together and works the way I want it to. Thanks everyone for the patience and nudging in the direction I needed to go.
  2. got me on that one. I use Winsyntax for text, never trusted Notepad that much
  3. Actually nothing. I will try them out. Do either one had the head slap function for bone head entries??
  4. I didn't include the php in the code i last posted. That is working. Suggestion for a fdee ide?
  5. Here is what I have now. I think I fixed the broken tag. The table renders with 3 cols and 2 rows with borders all around. <body> <style> table, th, td { border: 1px solid black; } </style> <table> <tr> <th>Temp</th> <th>Pressure</th> <th>Humidity</th> </tr> <tr> <th>?php echo $t; ?</th> <th>?php echo $p; ?</th> <th>?php echo $hum; ?</th> </tr> </table> </body> </html> I result I get in the 1st col 2nd row ?php echo $t; ? the next ?php echo $p; ? and the last ?php echo $hum; ? The result I expect are the vaiables that print in the PHP code. I really appreciate the help
  6. Hmm, Didn't work I got ?php echo $t; ? in the cell
  7. I have a php page that gets data from several txt files. I want to take those variables and put them into a table. I don't quite know how to make it work. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="refresh" CONTENT="15" /> <title>Lentz Abode</title> </head> <?php //File to read $file = '/sys/bus/w1/devices/28-000004d139da/w1_slave'; //Read the file line by line $lines = file($file); //Get the temp from second line $temp = explode('=', $lines[1]); //Setup some nice formatting (i.e. 21,3) $temp = number_format($temp[1] / 1000, 2, '.', ''); $temp_f = number_format(($temp * 9.0 / 5.0 + 32.0),2,'.',''); $fahrenheit=$temp*9/5+32; $temp1=number_format($fahrenheit,1); print"<h4>The Kitchen Temp is: $temp1</h4>"; //*************BME280 code ******************** //Barometric PressureBME280 $pressure=file_get_contents("/var/www/html/BME280/pressure.txt"); $press=$pressure*0.0002952998751; $p=number_format($press,2); //Humidity BME280 $humidity=file_get_contents("/var/www/html/BME280/humidity.txt"); $hum=number_format($humidity/1000,2); //Temperature BME280 $temp2=file_get_contents("/var/www/html/BME280/temp.txt"); $t=number_format(($temp2 /1000 * 9.0 / 5.0 + 32.0),1,'.',''); print "<h4>The Barometric Pressure is: $p</h4>"; print "<h4>The Humidity is: $hum%</h4>"; print "<h4>The Temperature is: $t</h4>"; ?> <body> <style> table, th, td { border: 1px solid black; } </style> <table width="30%" <tr> <th>Temp</th> <th>Pressure</th> <th>Humidity</th> </tr> <tr> <th>$t</th> <th>$p</th> <th>%hum</th> </tr> </table> </body> </html>
  8. mac_gyver You are 100% correct, in what I want to do. It sounds like you have some history with this type of project. This project will reside on every machine I sell and will be on the same network as the phones. I am only familiar with using TFTP for provisioning the phones. If I use the http provisioning I can turn off the tftp server. There is an option to use HTTP but I do not know how it operates. As you say it might be the better way to do this with the page creating the information "on the fly" so to speak. I will have to look into how that works. I have a couple of weeks before the powers that be at my company will be breathing down my neck to roll this out. I did not pursue putting all the configuration elements into a DB. I thought it would be easier to create the files individually. I really appreciate your help in all this.
  9. Mac_gyver, Thank you for your explanation. I think I am starting to get it. Although I am wondering if I have not thought this out enough and this is not the way to achieve what I ultimately need to do. Ultimately, I need to take the extension number, and the secret and insert it into a text file that is named the template name and then rename that file the mac address.cfg. There could be 5 files to be created/appended or 105 of them. It will be dynamic. I have already figured out creating the template files and how to append them. The form I posted retrieves the extension, secret, MAC and template information from three DB tables. The Mac and the Template are then on this form I have "assigned" to each other. I thought it would be easier to insert all this into a new table. Maybe you could advise me if I should pursue the help in this thread or go another way. Thanks
  10. Here is the form code: <form action="insert.php" method="post"> <?php error_reporting(E_ALL); ini_set('display_errors','On'); $link = mysql_connect("localhost", "", "") or die ('Error connecting to mysql' . mysql_error()); mysql_select_db("cqadmin"); $sql2 = "SELECT extension, secret from extensions;"; $result2 = mysql_query($sql2) or die(mysql_error()); echo "<table border='3'> <tr> <th>Extension #</th> <th>Secret</th> <th>MAC Address</th> <th>Template</th> </tr>"; while($row = mysql_fetch_array($result2)) { $sql = "SELECT id , mac FROM phones order by mac;"; $result = mysql_query($sql) or die(mysql_error()); $sql1 = "SELECT id , templatename FROM templates order by templatename;"; $result1 = mysql_query($sql1) or die(mysql_error()); echo "<tr>"; echo "<td>" . $row['extension'] . "</td>"; echo "<td>" . $row['secret'] . "</td>"; echo "<td> <select name='phone'>"; while($rowA = mysql_fetch_array($result)) { echo '<option value="' . $rowA['id'] . '">' . $rowA['mac'] . '</option>'; } echo "</select></td>"; echo "<td><select name='template'>"; while($rowB = mysql_fetch_array($result1)) { echo '<option value="' . $rowB['id'] . '">' . $rowB['templatename'] . '</option>'; } echo "</select></td>"; echo "</tr>"; } echo "</table>"; ?> <input type="submit" value="Submit your selections"> </body> </html> Here is the insert.php file <?php echo "You got here"; //***********Get the Assignment information ************* $ext = $_POST['extension']; $password= $_POST['secret']; $macaddress = $_POST['mac']; $template = $_POST['template']; Echo "$ext"; Echo "$password"; Echo "$macaddress"; Echo "$template"; ?> When I hit the submit button I get "You got here" I know big deal... I know I need to use Mysqli instead of mysql as well. I am pretty sure I need to use a while loop but I do not know how to apply it to multiple rows. There will be an unknown number of rows each time this form is used. There are 4 strings of data to be inserted into the DB table each time. I put the other code in the insert file to see if I would get anything.
  11. mac_gyver, The info is in a form that the user fills out. Your third comment is what I am looking for. So an example of how to do that would be great! Thanks
  12. I have a form with a table with columns and many rows. The form uses Post and submits to an insert.php I am looking for an example of how I can insert the table info into a mysql table. I know I should use a while loop but unsure how to step through the form info. Can someone suggest or provide and example that I can follow, or a tutorial somewhere? Thanks
  13. Thanks for the direction guys!
  14. I freely admit I am pretty green in alot of this stuff. I have a php page that runs arp-scan and returns information on MAC addresses for the network. It takes 10 seconds probably. I am looking for a visual indication to tell the user that the scan is in progress. I have no idea what this is even called. Can someone point me in the direction I need to go to figure this out? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.