Hi I have a student form.
<?php
$fonts = "verdana";
$fontcolor = "#3A9BE8";
$bgcolor = "#faaa3c";
?>
<!doctype html>
<html>
<head>
<title>Php Syntax</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>Name</td>
<td><input type = "text" name = "name" /></td>
</tr>
<tr>
<td>City</td>
<td><input type = "text" name = "city" /></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>
<tr>
<td></br></td>
<td><input type = "submit" name = "save" value = "Save"/></td>
</tr>
</table>
</form>
</div>
</section>
<section class="footeroption">
<h4> <?php echo "© All rights reserved" ?></h4>
</section>
</div>
</body>
</html>
I have a text file "marks.txt". the text file looks like this. 3 terms marks are there for Math, Economics & English.
I want to upload the data from this text file to MySQL table. I just need the numbers, so how can I avoid the String (Math, Economics and English).
please help me. I don't know how to get data from text file.