/    Sign up×
Community /Pin to ProfileBookmark

help with include/require

I have a page that goes out to mapquest and gets a result of stores and distances. The issue I am having is since we upgraded to PHP 4.3.3, the way I used to do this (using fopen, etc)does not work. I have updated my code, but using the include/require function, it displays the contents. How can I not display the contents? Below is my code. the bold line is where I have updated my code, the commented out lines above that are the old code.

$realMQpath=”http://www.riteaid.com/stores/locator/realMQ“;
#$realMQpath=”http://$HTTP_HOST/stores/locator/realMQ”;

# full HTML path to mqinterconnect cgi

$MQIC_path=”$realMQpath/mqinterconnect.cgi”;
$MQTP_path=”$realMQpath/mqtripplus.cgi”;

# reset our variables that we’re using below….

$BAD_ADDRESS=0;
$AMBIGUITIES=0;
$NOFOUND=0;
$amb=array();
//$stores=array();
$miles = “10”;
$maxshow = “1”;

$locator_fixed = “closestprox=1&closestn=100&screen=find&link=results&country=US”;

$myQuery=”$MQIC_path?$locator_fixed&zip=$zip&miles=$miles&maxshow=$maxshow”;

//$fd= @fopen ( $myQuery, “r”);
//print $myQuery;
//if (!$fd) {
//$status=”Error: Couldn’t complete MAP request. Please try again later.”;
// return;
//} else {
[B]$tmp_result=require($myQuery);[/B]
//echo $tmp_result;
if (!$tmp_result) {
$sErrs=”Error: Couldn’t complete MAP request. Please try again later.”;
} else {
//fclose($fd);
//print “tmp_result =>$tmp_result<= <br>n”;
//exit;
/*
ob_start();
eval( “?> $tmp_result” );
ob_end_clean();
*/

//print “hello”;
//print_r($store_numbers);
}
$this->$stores = $this->fill_store_specs($store_numbers);

} //End function find_stores_by_zip

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundryMar 04.2004 — Do you perhaps need to use [url=http://www.php.net/manual/en/function.file-get-contents.php]file_get_contents()[/url]?

Adam
Copy linkTweet thisAlerts:
@jrthor2authorMar 04.2004 — I seem to fixed this, by moving the ob_start() function above my $tmp_result=require($myQuery); statement.
×

Success!

Help @jrthor2 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...