Gtom Posted April 25, 2007 Share Posted April 25, 2007 Hello, im pretty new to PHP and i am creating a system that allows the user to input information that is sent to a HTML file as a new line on a table, atm i am just making the php file add <tr><td>*info*</tr></td> and it works, but now i need the table to be complied the other way around with the newest information at the top so this basically needs me to have the header HTML with the table start, the newest entry then the older ones. I realize this means i will need to sepeare the file into 2 and put the new info in the middle somewhere so i was wondering the best method to do this? Thanks. Link to comment https://forums.phpfreaks.com/topic/48674-simple-write-to-middle-of-file-in-php/ Share on other sites More sharing options...
Mr. R Posted April 25, 2007 Share Posted April 25, 2007 You should put the information in a database then select it and order it by DESC Link to comment https://forums.phpfreaks.com/topic/48674-simple-write-to-middle-of-file-in-php/#findComment-238424 Share on other sites More sharing options...
Gtom Posted April 25, 2007 Author Share Posted April 25, 2007 I am using a HTML file as my database and that cannot be sorted, i dont want to use a fancy MySQL database cause its more trouble than its worth and wouldnt offer any advantage. I figured out the pointer thing so you can tell it what bit to write from but say if i tell it to write something after the 8th bit it overwrites anything after the 8th bit so is there a way i can make it not overwrite? Link to comment https://forums.phpfreaks.com/topic/48674-simple-write-to-middle-of-file-in-php/#findComment-238433 Share on other sites More sharing options...
Gtom Posted April 26, 2007 Author Share Posted April 26, 2007 OK, i will reword this so its easier to help. I need to input html into the middle of a html file using PHP, atm my system does the following: User inputs data into HTML form > Clicks Submit > Info is sent to a HTML page and is added to the end of the file using append. I need the system to be able to create a file that is like this <Header HTML> <Custom user info added via php> <Footer HTML> The Custom user info will be varying size because it gets bigger as people add more things. Any help really appreciated! Thanks again. Link to comment https://forums.phpfreaks.com/topic/48674-simple-write-to-middle-of-file-in-php/#findComment-239243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.