bscotyb Posted April 16, 2012 Share Posted April 16, 2012 i am a student trying to figure this out and no matter what i do it is not coming up correctly I am trying to use this weeklyReport1Boles.html: <html><head> <title>Weekly Report</title> <link rel ="stylesheet" type="text/css" href="sample.css" /></head><body> <h1>Weekly Report</h1> <p> <form action = "weeklyReport1Boles.php" method = "post" > <p> <input type = "submit" value = "Display the Report" /></p> </form> </body> </html> TO PULL data from weeklyDataBoles.txt lines 1-8 1 236.00 2 284.00 3 148.00 4 128.00 5 0.00 6 110.00 7 0.00 8 the resulting web page should be: Weekly Report TOTAL INCOME FROM PAINT CONTRACTS: $0.00 AVG DAILY INCOME FROM PAINT CONTRACTS: $0.00 NUMBER OF DAYS with NO INCOME: . ny php code is : <?php $total = $_POST['total']; $avgDailyIncome = $_POST['avgDailyIncome']; $badDays = $_POST ['badDays']; $paintFile = fopen("weeklyDataBoles.txt","r"); $year = fgets($weeklyDataBoles);$total = 0; for ($count= 1; $count <=7; $count = $count +1) { $ nextDay = fgets($weeklyDataBoles); $total = $total + $nextDay; } fclose($weeklyData); $avgDailyIncome = $total/7; print("<p>TOTAL INCOME FROM PAINT CONTRACTS: "); print("$".number_format($total, 2)."</p>"); print("<p>AVG DAILY INCOME FROM PAINT CONTRACTS: "); print("$".number_format($avgDailyIncome, 2)."</p>"); print("<p>NUMBER OF DAYS with NO INCOME: $badDays.</p>"); ?> </body> </html> I am very inexperienced and would love any help offered. Please remember I am a student so my code may be in the shambles already. ty Quote Link to comment https://forums.phpfreaks.com/topic/261014-gonna-do-this-rite/ Share on other sites More sharing options...
l0gic Posted April 16, 2012 Share Posted April 16, 2012 Pretty much, you want to post the same thing multiple times, ignore answers and not read manuals. Quote Link to comment https://forums.phpfreaks.com/topic/261014-gonna-do-this-rite/#findComment-1337709 Share on other sites More sharing options...
bscotyb Posted April 16, 2012 Author Share Posted April 16, 2012 i am not asking for much, i am trying and i am really confused all i was really asking for was a little help, i am sorry if my inexperience is a bad thing here, i am trying as hard as i can to understand just having alot of problems getting it Quote Link to comment https://forums.phpfreaks.com/topic/261014-gonna-do-this-rite/#findComment-1337712 Share on other sites More sharing options...
l0gic Posted April 16, 2012 Share Posted April 16, 2012 Answer was in your last thread.. <?php ... $paintFile = fopen("weeklyDataBoles.txt","r"); $year = fgets($weeklyDataBoles); // Replace $weeklyDataBoles with the file you're actually opening $paintFile ... ?> Quote Link to comment https://forums.phpfreaks.com/topic/261014-gonna-do-this-rite/#findComment-1337717 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.