Jump to content

Putting info in a file.. in a certain location?


Recommended Posts

Hey, i have made a blog script, just for fun, andn it works great but when i go to the add blog page, and fill it out, it puts it into a file called blog.php, and it adds it to the bottom, is there a way i can add it to a specific location?
Blog.php(example):
Welcome! to our site yay!(stays here)

(New content here)

(Old content gets pushed down here)
This would be waaaaaaaay easier with a database, but you're basically going to have to read the file into an array, shift part of the array, insert the new content in the blank space and write the data back out to the file.

This is why databases exist. This is a very inefficient way to handle this problem.
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.