shumonira Posted November 8, 2016 Share Posted November 8, 2016 Hi I have a text file. I want to upload the data to php form after clicking the upload button and then it will show the data to the next page. is there anyone who can help me please. thank you Quote Link to comment https://forums.phpfreaks.com/topic/302488-read-text-file-and-fill-php-form/ Share on other sites More sharing options...
Barand Posted November 8, 2016 Share Posted November 8, 2016 is there anyone who can help me please. Not from the paltry amount of information you have given us so far Quote Link to comment https://forums.phpfreaks.com/topic/302488-read-text-file-and-fill-php-form/#findComment-1539083 Share on other sites More sharing options...
cyberRobot Posted November 8, 2016 Share Posted November 8, 2016 You could start here: http://php.net/manual/en/features.file-upload.php Quote Link to comment https://forums.phpfreaks.com/topic/302488-read-text-file-and-fill-php-form/#findComment-1539084 Share on other sites More sharing options...
shumonira Posted November 8, 2016 Author Share Posted November 8, 2016 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 "© 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 Quote Link to comment https://forums.phpfreaks.com/topic/302488-read-text-file-and-fill-php-form/#findComment-1539091 Share on other sites More sharing options...
Barand Posted November 8, 2016 Share Posted November 8, 2016 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? Quote Link to comment https://forums.phpfreaks.com/topic/302488-read-text-file-and-fill-php-form/#findComment-1539092 Share on other sites More sharing options...
shumonira Posted November 8, 2016 Author Share Posted November 8, 2016 I am really sorry for that. I tried this. now I think if I do this way, this will be better. I am really sorry. Quote Link to comment https://forums.phpfreaks.com/topic/302488-read-text-file-and-fill-php-form/#findComment-1539093 Share on other sites More sharing options...
Barand Posted November 8, 2016 Share Posted November 8, 2016 You might find it better to load the file into the database then use the form to edit the database Quote Link to comment https://forums.phpfreaks.com/topic/302488-read-text-file-and-fill-php-form/#findComment-1539104 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.