Solved

include

Posted on 2002-03-30
6
200 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

776 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