Jump to content

How Do I include this file please?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
byronwells

byronwells

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts
Alright Guys

I really need your help.. I have got this php file that I have created that I wish to use for this page layout Untitled Document

This is what I would like it to look like
http://www.digitalre..../contactus.php

This is the code for contact.php page


<?php


include_once ("header.php");



// get contact page info from database


$q = "select * from ".$prefix."site_settings";

$v = $db->get_a_line($q);


$contact_page = $v['contact'];

$contact_page = stripslashes($contact_page);


// display contact page

$returncontent = preg_replace ("/\[\[(.*?)\]\]/e", "$$1", $contact_page);

$returncontent = preg_replace("/[$]/","$",$returncontent);

echo $returncontent;


include_once ("footer.php");


?>




My first question is as follows:

How do I tell the content page to read that file.. Every time I do it using the include_once and then link to that file it displays it incorrectly..

My second question is:
I need help in moving the contents code to the contactus.php page... I explain more when I get the first question done

#2
Feral

Feral

    Programmer

  • Members
  • PipPipPipPip
  • 162 posts
I don't really understand your question, what file are you wanting to include? is it another php file or is it a text file.

Either way to include the contents of another page into your page there are the ways.
1.) with include/require or include_once/require_once functions.
2.) by using fopen to open and read the contents of a file.
3.) by using an iframe to display another page inside of your current page.

The clearer you are and the more information you provide the better we can help you out.

#3
byronwells

byronwells

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts

Feral said:

I don't really understand your question, what file are you wanting to include? is it another php file or is it a text file.

Either way to include the contents of another page into your page there are the ways.
1.) with include/require or include_once/require_once functions.
2.) by using fopen to open and read the contents of a file.
3.) by using an iframe to display another page inside of your current page.

The clearer you are and the more information you provide the better we can help you out.

I am trying to get that file to read the contactus.php page. But have it displayed right...

#4
semprance

semprance

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
What is it that's not causing it to be 'displayed right'?