Solved

include

Posted on 2002-03-30
6
207 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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 receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

861 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