Jump to content

lx45803

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lx45803's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you thorpe! Exactly what I was looking for! I really appreciate your help. Also, my hosting provider charges a small fee for a MySQL process, so if I can go without, I do. But really, I do prefer the database route.
  2. So, if I'm understanding this correctly, this script will get 'pages' and look for a match in index.php, and when it finds one, it echoes 'stuff here'. That's not what I'm looking for. I don't want to keep my content in index.php, I want to keep the content for each separate page in its own file, so I can more easily add pages. Think of it this way: When someone accesses index.php?page=home, the PHP script loads the file 'home' from the directory it's in and outputs it. The script doesn't search for a match listed in index.php and then display the associated info. If I did it that way, index.php would be several MB in size. This way, I can easily add new pages just by uploading one small file, rather than downloading several MB of data, finding what I want to edit, editing it, and uploading it again.
  3. teng: the link you gave me was for $_POST, a particularly unhelpful solution to my problem. As much as I like submit buttons, there will no doubt come a time when I would like text links on my site. I did, however, find the link on that page to $_GET, so thank you. As for what I was describing, you both have the wrong idea in mind. I don't want to have to maintain what is essentially a directory of every page on my site, if possible, I'd like to know if PHP could work like so: <html> (Stuff) <?php echo "contents_of_$page" ?> (More stuff) </html> Not sure if this is right, but $page is supposed to indicate index.php?page=this_string_here Thanks for the help and quick replies.
  4. Chris: I do plan to learn CSS, but I have a few dozen other things to do first. :-\ As for your code, it seems to me that that might not scale very well. I'm looking for a script that I won't need to change for a long time, and as far as I can tell, that's not the case here. I want a script that starts off with static HTML up to the point where I would add content. From there, PHP kicks in, and takes a filename from the URL and outputs the contents of the file. That file will be my content for that page, formatted in HTML to fit in just like it was the content of my old pages. After displaying that file, PHP is finished, and the rest of the page is transmitted to the user. Let's use your example, www.site.com/index.php?page=home In this case, index.php is essentially an HTML file with a PHP script to load the contents of home.html and output them where my content would normally be on my old HTML pages. The rest of the script is just the HTML that comes after that content. Do you understand what I'm asking for?
  5. Be forewarned: noob ahead. ??? I need a bare-bones template script for my website, to keep my navigation and stuff consistent. After about 20 pages in HTML, I found I was missing pages whenever I updated something, unless I went back and rechecked all the pages manually. I really don't have the time for that, so I decided to whip up a little template system in PHP. Unfortunately, my PHP skills are about on par with those of your average pile of rocks. So far, all I know is that I need to remove the content from a copy of one of my pages and put the <?php and ?> tags where it used to be. After this point, I know I want to have PHP open a second file, $page or something, and send its contents to be processed as HTML, then close and let the rest of the page be sent untouched. Problem is, I don't know how to do any of that. If anyone could give me an example, or even a full working script, I would really appreciate it.
×
×
  • 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.