Jump to content

Everyone stumped? SOLVED! Re: New to PHP - developing CMS


johnnytickets

Recommended Posts

I managed to figure this out using output buffer and writing entire contents to a file.

 

Hi, I'm new to PHP but have dabbled for awhile, but have been designing websites for a long time. In my search for a simple CMS for clients I decided to make my own using PHP and am having great success except for one thing.. the file does not save. I'm probably missing something basic as I usually do because I tend to jump in too far at the beginning. Anyway, here's the situation...

 

I have a simple user interface that allows for text updates, ability to change fonts and font color, and ability to upload images.. all through simple form elements. We'll call this "junk.php" (i call everything junk until it isn't anymore)

 

It is processed though another file called junk2.php which displays everything just as it should.. updated text, photos, all the html is in place, etc... junk2 also passes the textual content to a file called junk.text (set to w to overwrite) and that's brought up as the current text whenever the admin page (junk.php) is opened up.. works great except that junk2 (the destination file) is only sort of a "temp" file. If I open another browser and go to junk2.php, nothing shows except for a few things that were sort of "hard coded" into the file initially.

 

I guess my question is .. is there a way (when I pass the data from junk, to junk2) to have the data save to junk2.php permanently (or at least until it's edited to again) or do I have to use file open, write, and close for each little element that exists on the page.

 

Please help if you can. trying to learn this on my own has been both rewarding and frustrating at the same time. I've made some major breakthroughs but now I'm stuck at what should be the simplest part.

Thanks,

JT

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.