Solved

include

Posted on 2002-03-30
6
212 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
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.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

705 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