hello,
I have this code below that is attached to a flat file like this:
Email:LastName:FirstName:Assignment1,100:Assignment2,100:Quiz1,50
someone@email.com:Doe:John:85:93:45
Here is the code:
<?php
$row=1;
$handle= fopen($full_file,'r');
$heading=True;
echo '<table>';
$data=fgetcsv($handle,1024,":");
echo '<tr>';
foreach ($data as $cell)
{
echo '<th>' .$cell. '</th>';
}
echo '<th>Overall Average</th>';
echo '</tr>';
while (($data=fgetcsv($handle,1024,":")) !==FALSE)
{
echo '<tr>';
foreach($data as $cell)
{
$average=$cell/100;
echo '<td width="50">' .$cell. ' ' .$average. '</td>';
}
//echo '<td></td>';
}
if ($row==1)
{
$heading=False;
}
$row++;
echo '</tr>';
echo '</table>';
fclose($handle);
?>
what i need to do with this code, is have an extra column added at the end where is averages out the student's scores, based on the weight of the grade that is located on row 1 and delimited by a ",".
Please help.
php/mysql auto logout after 2 hour and reset password
Hi all, This I hope will make sense. I've the following code which when a user logins in, creates a session: if (isset($_POST['submitted'])) { // Check if the form has been submitted. require_once
php multiple action on submit
I have a form which says:<form enctype='multipart/form-data' method='post' action='process.php' target='_blank'>I need to call process.php on submit or on clicking submit button. Now
insert mysql embeded videos as blobs?
Using TinyMCE my client will be able to embed images and flash videos into large columns of text which will obviously be printed out client side at a later date. What my question is that is it
Dynamic Array using glob?
Is there an easier way to do this?I am trying to get create a dyamic array based on files within the folder.Code: foreach (glob("*.jpg") as $filename) { $items = array("title"
Inserting 100x and 100y coordinates in mysql table - easy
Is there a way to insert this data into a mysql table named 'map' with the fields: 'x int 3' , 'y int 3' in an easy way with maybe a for loop or something?I want the data entered to be like this:0x
Please help - should be a simple fix.. driving me nuts
Everything seemed to be working fine. I have a table, it alphabetically lists a bunch of cities and relivant city data.However, I found out that the city is showing up only one time when I have can
Save data in input fields when they press "BACK BUTTON"
Hi, this is html form: And let's say they get a error "Please enter ur title must be more then 3 character" then they click the BACK BUTTON AND ALL THERE DATA IS GONE!!How i fix?Code:
Using system() and bringing back the results
I am aware that you can use system() within PHP to execute system commands, but I was wondering if there was a reasonable way to bring back the results every second.For example, I want a web based
Search in the PHP Files
have to search asterisk(*) in the php code of the php files .
Multiple while loops
I have several DB queries that I know should be returning results and aren't. I have a feeling it has to do with the several while loops that should be outputting the data. One more issue is that