Board index   FAQ   Search  
Register  Login
Board index php forum :: Bar Free time

c type includes

Bar discussions . Talk about everything not only php !. Guests are welcome here , forum registration is not required.

Moderators: macek, egami, gesf

c type includes

Postby Guest, the new-old guy » Wed Mar 19, 2003 5:35 pm

I want to thank you in advance for your help with my (probably obvious) question. Is there a way to use includes within the PHP code so that I can place functions in another file.

<?php

If(yes)
{
Calculate();
Display();
PromptResponse();
}

?>

Where Calculate(), Display(), and PromptResponse() code is actually written in another file (the include file).

Thank you for your help. I like to make pages as clean as possible, if I can move all functions to another file, I will be happy again. :lol:
Guest, the new-old guy
 

Postby Xerpher » Wed Mar 19, 2003 7:48 pm

use this function: include()
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada

Postby Guest, the new-old guy » Fri Mar 21, 2003 1:16 pm

Thank you, I will give it a try.
Guest, the new-old guy
 

Postby Guest, the new-old guy » Fri Mar 21, 2003 5:02 pm

I was able to pull in executable PHP code and have it run. Is there a way to select specific parts of an include file, or am I forced to pull in the complete file.

ie:
test.php contains;

<?php

include 'TestInclude.php';

?>

The file TestInclude.php contains multiple functions, but I only want to bring in the function I need, not all. How can I accomplish this?
Guest, the new-old guy
 

Postby Xerpher » Sat Mar 22, 2003 1:59 am

Using include, yes, the whole thing. Using fread() no, you can select line numbers.
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada


Return to Free time

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron