I was wondering how I can execute an include like create.php?id=10000 within a script. I know that allow_url_include must be turned on but I really do not watn to do that.
I was looking into cURL, but that seems to read the file out to the page?
Executing A URL
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Executing A URL
How about using a function to pass the id to?
Re: Executing A URL
How would I go about that?
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Executing A URL
Well what was going to happen inside create.php?
Re: Executing A URL
Problem is on the next page headers are being sent. So I don't think that this will work anyways.
I am doing it like so.
Problem is in the file create.php I am using header() for the creation of the PDF. So I am getting headers already sent errors.
I am doing it like so.
Code: Select all
<?php
$_GET["temp"] = true;
$_GET["id"] = "10000";
include("create.php");
?>Re: Executing A URL
I have come up with a solution. Anyone interested here it is:
Curl was the way to go.
Code: Select all
<?php
$ch = curl_init("http://www.websitename.com/modules/create.php?temp=true&id=" . $row["id"] . "");
curl_exec($ch);
curl_close($ch);
?>- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Executing A URL
Or you could have used an include
Code: Select all
$temp=1;
$id=$row['id'];
include("create.php");