Run PHP file

Hello Experts,

Is there an easy way to run a PHP file? E.g. I would like to run this file during one of my scripts.

invoice_creater.php?id='.$row_tabledata['id'].'&uniqueID='.$uniqueid.'&action=save

Seems like fopen() isn't really the solution to that.

Thanks in advance!
sittinDuckAsked:
Who is Participating?
 
Mohamed AbowardaConnect With a Mentor Software EngineerCommented:
You can use cURL:
http://php.net/manual/en/curl.examples.php

This way will allow you to run script inside or outside your server.
0
 
svgmucCommented:
You can exec() /usr/bin/php with the script name as the argument.
0
 
Dave BaldwinFixer of ProblemsCommented:
There are several ways to run external programs on this page: http://us2.php.net/manual/en/function.exec.php
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
chemdryCommented:
Not sure the setting that your using it in but you might want to look at using a ajax call. I like using jquey for that
purpose
and you can get information back from the call with a success and let the customer know that the invoice seas sent or what not
0
 
Loganathan NatarajanLAMP DeveloperCommented:
You may simply include the file during your page call.  like this,

include_once("invoice_creater.php?id='.$row_tabledata['id'].'&uniqueID='.$uniqueid.'&action=save");
0
 
hernst42Commented:
You could just try:

$invoice = file_get_contents('http://example.com/your/path/invoice_creater.php?id='.$row_tabledata['id'].'&uniqueID='.$uniqueid.'&action=save');
0
 
Vimal DMConnect With a Mentor Senior Software EngineerCommented:
Hai,

You can go for ajax execution of the file,which is of xml parsing method,even more to say of background process

1) You may go throw the link below

http://www.degraeve.com/reference/simple-ajax-example.php

Just you can post the values.
invoice_creater.php?id='.$row_tabledata['id'].'&uniqueID='.$uniqueid.'&action=save
0
 
Ray PaseurCommented:
I think I would use file_get_contents() or CURL to run the script and retrieve the output into a data string.  Make sure that you have used urlencode() on all your arguments to the script.
0
 
kumaranmcaCommented:
I think url based file write/read its not possible try file_get_content() function or curl..Refer the below url it might be help your needs.

http://davidwalsh.name/download-urls-content-php-curl
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.