Solved

include

Posted on 2002-03-30
6
198 Views
Last Modified: 2013-11-18
I want to include in my page wmview.php?ArtCat=1

<?php include "/path/wmview.php?ArtCat=1";  ?>
did'n work!

how can I do this?


10x
0
Comment
Question by:polinoma
6 Comments
 
LVL 5

Expert Comment

by:andriv
ID: 6907794
<?php include "/path/wmview.php?ArtCat=1";  ?>

Remove the query string

<?php
 include("/path/wmview.php")
 


//The include will pull the file into the current one and then you can use the variable
$ArtCat = 1;
?>
0
 
LVL 2

Expert Comment

by:Marsman_
ID: 6907828
If you only want to include the output of this phpfile use:


<?
  readfile("/path/wmview.php?ArtCat=1");  
?>
0
 
LVL 2

Accepted Solution

by:
Marsman_ earned 50 total points
ID: 6907835
If your code allows it you better use andriv's code with A small adjustment, because it doesn't make a connection to your own server:

<?
$ArtCat = 1;
include("/path/wmview.php")
?>

The $artcat=1 has to be before the include because the included php now can read it and see the variable has a value of 1.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Expert Comment

by:Joseph_Fung
ID: 6910034
An alternate solution (which I believe does not work if your server is in safemode) is to use the full HTTP path to the file.

<?
 include("htp://www.myserver.com/path/wmview.php?ArtCat=1");  
?>

The reason this works is that the include creats a new GET query for the page which PHP parses and returns the output.
0
 

Expert Comment

by:Joseph_Fung
ID: 6910035
I appologize for the typo in my last post - that code sample should read

<?
include("http://www.myserver.com/path/wmview.php?ArtCat=1");  
?>
0
 

Author Comment

by:polinoma
ID: 6910177
Thanks for the answer :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article discusses how to create an extensible mechanism for linked drop downs.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now