Jump to content

read text file and fill php form


shumonira

Recommended Posts

sorry about that. I will include more details here.

this is my form

<?php 
	$fonts = "verdana";
	$fontcolor = "#3A9BE8";
	$bgcolor = "#C3D990";
?>

<!doctype html>
<html>
<head>
	<title>Student Data</title>
	<style>
		body{
			font-family:<?php echo $fonts;?>
			
		}
		.phpcoding{
			width: 900px;
			margin: 0 auto;
			background: #ddd;
			
			min-height:400px;
		}
		
		.headeroption, .footeroption{
			background:#444;
			color:<?php echo $fontcolor; ?>;
			text-align: center;
			padding: 20px;
		}
		.headeroption h2, footeroption h2{
			margin:0;
		}
		.maincontent{
			min-height:400px;
			padding: 20px;
			background:<?php echo $bgcolor;?>
		}
	</style>
</head>
<body>

<div class="phpcoding">
	<section class="headeroption">
		<h2>Student Data</h2>
	</section>
	
	<section class="maincontent">		
		<div class = "student_data">
			<form action = "" method = "post">
				<table>
					<tr>
						<td>ID</td>
						<td><input type = "text" name = "id" /></td>
					</tr>
					
					<tr>
						<td>Name</td>
						<td><input type = "text" name = "name" /></td>
					</tr>
										
					<tr>
						<td>Exam Date</td>
						<td><input type = "date" name = "examDate" /></td>
					</tr>
					
					<tr>
						<td>Browse to upload file... </br></td>
						<td><input type = "file" name = "browseFile" /></td>
					</tr>									
					
					<tr>
						<td></br></td>
						<td><input type = "submit" name = "uploadFile" value = "Upload"/></td>
					</tr>
					
				</table>
			</form>
		</div>
	</section>
	
	<section class="footeroption">
		<h4> <?php echo "&copy All rights reserved" ?></h4>
	</section>
		
</div>

</body>
</html>

here is the text file

 

Math

1st term 30
2nd term 50
3rd term 60
English
1st term 40
2nd term 90
3rd term 70
Science
1st term 70
2nd term 60
3rd term 40

I just need to read the number. 

 

please let me know if I can do that

 

thank you

post-202794-0-15756700-1478624130_thumb.png

Link to comment
Share on other sites

In your other topic I showed you how to read the files and pick out the numbers and text. However you have now changed the format of that file to make it much more difficult.

 

You also wanted to write that file to a database table and now you want to put it in a form.

 

When you have made up your mind exactly what you do want, let us know. After all, you don't want to waste any more of our time, do you?

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.