Page 1 of 1

Executing A URL

Posted: Fri May 09, 2008 10:21 am
by icesolid
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?

Re: Executing A URL

Posted: Fri May 09, 2008 10:49 am
by aceconcepts
How about using a function to pass the id to?

Re: Executing A URL

Posted: Fri May 09, 2008 11:50 am
by icesolid
How would I go about that?

Re: Executing A URL

Posted: Mon May 12, 2008 9:04 am
by aceconcepts
Well what was going to happen inside create.php?

Re: Executing A URL

Posted: Mon May 12, 2008 9:15 am
by icesolid
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.

Code: Select all

<?php
$_GET["temp"] = true;
$_GET["id"] = "10000";
include("create.php");
?>
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.

Re: Executing A URL

Posted: Mon May 12, 2008 12:26 pm
by icesolid
I have come up with a solution. Anyone interested here it is:

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);
?>
Curl was the way to go.

Re: Executing A URL

Posted: Tue May 13, 2008 3:59 am
by aceconcepts
Or you could have used an include

Code: Select all

 
$temp=1;
$id=$row['id'];
 
include("create.php");