Jump to content

Pulling information from file


mrbios

Recommended Posts

Hi Everyone,

 

Let me start by saying i need any help put to me in dumb person terms, i know nothing but the bare bare basics of most web coding let alone php, enough to make very simple pages and forms.

 

On to my problem... What i am aiming for us a single web page which takes a list of names from a file, generates a 2 column table, makes the second column into boxes where data can be entered in to, then i want it to be submitted to email in the form of a html email, the email doesn't need any fancy formatting or colour scheme, just want the the table of names and entered information sent

 

Now this is how far i have got (with help obviously):

<body>
	<h1 align="center"><u>7B Praise Points</u></h1>
	<div id="contact-wrapper">
  			<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" id="contactform">
<?php 

$file = file("7B.txt"); 
$count = 0;
print "<table cellspacing='2'>\n 
<tr><td>Student Name</td><td>Number of Praise Points</td></tr>\n"; 

foreach($file as $line){ 
$line = trim($line); 
$split = split("\t",$line); 
print "<tr>\n<td>$split[0]<input name='name$count' type='hidden' value='$split[0]'></td>\n<td>$split[1]<input name='points$count' type='hidden' value='$split[1]'></td>\n</tr>"; 
$count++;
} 

print "</table>"; 

?>
  <p>
    <input name="submit" type="submit" value="Submit">
  </p>
</form>
	</div>
</body>

So i've got it generating the table from the list of names in the file called "7B.txt" all i need to be able to do is making the second column in to a data entry box and generating the email
Starting with the first problem of making the second column in to data entry boxes how do i go about doing this?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/214509-pulling-information-from-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.