Solved

include

Posted on 2002-03-30
6
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

726 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