Search
Left Quote    It is possible to store the mind with a million facts and still be entirely uneducated.
- Alec Bourne    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Including
  This user is online  Guest
  Subject: "Including" Posted: @ 3:04 pm on Dec 08 2005   
Unregistered
Ok, well at the moment the code seems to be fine. Its just that I can't include it into my main index file. I try including the registration page with

Code:
$page = $_GET["pag e"];

switch($page) {
case 'register':
include "content/r egister.php&quo t;;
break;


the form shows up but when I click submit it just clears the form but doesn't actually add the entry. Any help would be appreciated. PS. These is a really great tutorial, Thanx.

    Viewed: 8,184 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Including" Posted: @ 1:40 am on Dec 09 2005    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

just do this:

Code:


<?php
include($_SERVE R['DOCUMENT_RO OT'].'/path/t o/file/the_file .php');
?>





-bs0d | AllSyntax.com

    Viewed: 8,175 Times | Reply to This | To top
  This user is online  Guest
  Subject: "re: Including" Posted: @ 5:52 am on Dec 09 2005    
Unregistered

That still doesn't seem to work since I am using a templating system. http://codewalk ers.com/tutoria ls/58/



    Viewed: 8,169 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Including" Posted: @ 4:52 pm on Dec 09 2005    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

If its thats much of a problem, then just paste the php code into your template, rather than including it.




-bs0d | AllSyntax.com

    Viewed: 8,161 Times | Reply to This | To top
  This user is online  Guest
  Subject: "re: Including" Posted: @ 2:00 am on Sep 20 2006    
Unregistered

I too am using a template system so the pages I want the comments on are all called from a .tpt and I have no idea how to add the code into my current template and then call apon it...



    Viewed: 7,918 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Including" Posted: @ 2:43 am on Sep 20 2006    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Open the code of your template page and insert this code. Modify the path to match where you decided to store the comments.php script.


Code:


<? include($_SERVE R['DOCUMENT_RO OT'].'/path/t o/comments_scri pt.php'); ?>



I posted this solution above. I dont believe having at template system would keep this from working. This needs to go where php can be executed.

I never tested including this code with a template system. If you're looking into code like this I would recommend designing your own site to prevent problems just like this. This way, you're in complete control.

This site has articles that can help you get started.

Here are a few key articles:
  1. Site Design Made Simple
  2. Simple PHP Tutorial
  3. Complete Members System
How ever, I believe each article on this site is important- thats why they're here so read up and post any questions you come across in the appropriate FORUMS< /a>




-bs0d | AllSyntax.com

    Viewed: 7,912 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank