How to load output of a PHP Script into another script variable without file_get_contents()
Get the solution ↓↓↓I really need help of you. What i want is it that i want to load output of a PHP Script into another PHP script variable. And then echo it.
print "<ul>";
for($i=0;$i<mysqli_num_rows($govtJobsRslt);$i++){
$job = mysqli_fetch_array($govtJobsRslt);
$jobId = $job[0];
$jobTitle = $job[1];
$jobEmployer = $job[2];
$jobVacancies = $job[3];
$jobPage = $job[4];
$query2 = "SELECT employer_shortname, employer_city FROM employer WHERE employer_id = $jobEmployer";
$empDtlRslt = mysqli_query($link, $query2);
if($empDtlRslt){
$empDtls = mysqli_fetch_array($empDtlRslt);
$empShortName = $empDtls[0];
$empCity = $empDtls[1];
**$new1 = file_get_contents("http://url/summaryProvider2.phpjobId=".$jobId);**
print "<li id=\"lst$jobId\" class=\"qs\"><a href=\"/govtjobs/$jobPage\">".$empShortName." ".$empCity."-".$jobTitle."-".$jobVacancies." Posts</a> </li><div id=\"sum$jobId\" class=\"jobSummary\">".$new1."</div>";
I want to replace file_get_contents() method because this is not working on web server becasue it is disabled for security reasons.
Please tell me the other way that how can i do that??? Is it possible somehow using include() method???
Guys please help soon...
Answer
Solution:
you can use fopen just open it as a regular text file but that is not better than file_get_contents. You can also have your web server treat this file as a non php file, and then it will just spill the contents to whoever requests it so then you can use curl to the local machine to get it.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: your lock file does not contain a compatible set of packages. please run composer update.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.