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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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