By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,420 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

NEED HELP. Call another PHP Page in PHP

P: 2
Hello, it is my first time here and I am basically a beginner at programming PHP.

I need help regrading PHP calling.

Suppose I have a page named Index.php for a site and wanted to call a page named navigator.php into the page itself. The navigator.php page is made with PHP scripts and HTML tags. Sorry I forgot the codes at home because I don't have internet connection there.

I tried using the file() function but it doesn't execute my session code in the navigator.php.

Can there be any possible way to get around this?

I'll update this post with the codes so everyone can help me analyze this. Thanks.
Apr 25 '07 #1
Share this Question
Share on Google+
3 Replies


P: 7
Hello, it is my first time here and I am basically a beginner at programming PHP.

I need help regrading PHP calling.

Suppose I have a page named Index.php for a site and wanted to call a page named navigator.php into the page itself. The navigator.php page is made with PHP scripts and HTML tags. Sorry I forgot the codes at home because I don't have internet connection there.

I tried using the file() function but it doesn't execute my session code in the navigator.php.

Can there be any possible way to get around this?

I'll update this post with the codes so everyone can help me analyze this. Thanks.

The easiest way is to probably use the HTML <iframe> tag. That is if you really want to "embed" the other php page into the main php page.

<iframe src="navigator.php" scrolling="auto"></iframe>

file() is good for getting non-php files like xml, text and other stuff like that, but probably not for what you want here. Check out php.net for function descriptions.

If navigator.php contains functions that you want to run on your main page, just use the include statement in your main page:

<?php
include ("navigator.php");
?>

Hope this helps.
Apr 25 '07 #2

P: 8
Hello, it is my first time here and I am basically a beginner at programming PHP.

I need help regrading PHP calling.

Suppose I have a page named Index.php for a site and wanted to call a page named navigator.php into the page itself. The navigator.php page is made with PHP scripts and HTML tags. Sorry I forgot the codes at home because I don't have internet connection there.

I tried using the file() function but it doesn't execute my session code in the navigator.php.

Can there be any possible way to get around this?

I'll update this post with the codes so everyone can help me analyze this. Thanks.
I am not sure this will help u or not but i think if u want to use the index.php in the navigator.php u can do this by using require (),or include() function .may be these help u.u can read about this at php.net official site of php.

Hope it may help u.
Good Luck
Apr 25 '07 #3

P: 2
Thanks for the help guys, i'll try it later, then i'll post for updates. Thank you again
rogerpride
The easiest way is to probably use the HTML <iframe> tag. That is if you really want to "embed" the other php page into the main php page.

<iframe src="navigator.php" scrolling="auto"></iframe>

file() is good for getting non-php files like xml, text and other stuff like that, but probably not for what you want here. Check out php.net for function descriptions.

If navigator.php contains functions that you want to run on your main page, just use the include statement in your main page:

<?php
include ("navigator.php");
?>

Hope this helps.
jadoo
I am not sure this will help u or not but i think if u want to use the index.php in the navigator.php u can do this by using require (),or include() function .may be these help u.u can read about this at php.net official site of php.

Hope it may help u.
Good Luck
Apr 26 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.