I have created two pages
index.php
this page is the main page. and i have included
include(jawab.php?a=default) in this page
---------------------------------------------
jawab.php
in this page i have used
$_SERVER["PHP_SELF"];
in the anchor tag
I have the problem here.
when i click the anchor in the index.php the jawab.php is not opening in freshly instead it is opened there it self.
and the $_SERVER["PHP_SELF"] is taking value
index.php instead of jawab.php when include as mentioned above.
how can i overcome this problem.
I am stuck using include () function
Moderator: General Moderators
- thomas777neo
- Forum Contributor
- Posts: 214
- Joined: Mon Mar 10, 2003 6:12 am
- Location: Johannesburg,South Africa
Try This Instead
Hi
First of all I don't think you can send variables through the include statement. To get around this you could do this:
(this would automatically include the $a variable)
But you wanted the page you include to open freshly, thus you could use the header function.
This should work a bit better
Cheers
First of all I don't think you can send variables through the include statement. To get around this you could do this:
Code: Select all
$a="default";
include("whatever.php"); //note the syntaxBut you wanted the page you include to open freshly, thus you could use the header function.
Code: Select all
$header = "Location: http://localhost/your_site/whatever.php?val=" . $val . "&reportname=" . $reportname. "&parm=" .$parm;
header("$header");Cheers
Re: I am stuck using include () function
$_SERVER[PHP_SELF] is working perfectly. it's your understanding of it that is the issue.harsha wrote:I have created two pages
index.php
this page is the main page. and i have included
include(jawab.php?a=default) in this page
---------------------------------------------
jawab.php
in this page i have used
$_SERVER["PHP_SELF"];
in the anchor tag
I have the problem here.
when i click the anchor in the index.php the jawab.php is not opening in freshly instead it is opened there it self.
and the $_SERVER["PHP_SELF"] is taking value
index.php instead of jawab.php when include as mentioned above.
how can i overcome this problem.
it can only refer to the page that it is in.
same thing with your include issuetry bookmarking http://www.php.net
the seardch function feature should have explained the include issue