Forum Moderators: coopster
I have built 2 scripts.
1. checks the status of something, and runs script 2 if nessacary.
2. does an xml import.
I want to be able to get the "check status" script to call this "xml import" script if a certain condition is met, I also want my user to be able to "force" the "xml import" whenever they want.
Basically, I don't want to have to write the code in "xml import" again in "check status".
Is there a way that I don't have to repeat the code?
I'm going to look into the script having a function getXMLData(); and see if I can include that script, which has the common include in it, then call the scripts functions.... Im grasping at straws though.
if (condition)
include('importscript.php');
as for your common include issue..dunno.. perhaps put a conditional in the importscript to check for the session handler so it doesn't include if called from the "check status" script.
this is assuming the import script does't require any input of any type because it would just do its thing and finish (import, clean up, end).