phplearner2008 Posted September 9, 2008 Share Posted September 9, 2008 Hi, I have expressinterest.php file where I insert values FROM, TO to database $sql = "INSERT INTO interests_sent(FROM,TO) values($FROM,$TO)"; $result = mysql_query($sql) or die("Query: " . $sql . "\n\n" . mysql_error()); $sql1 = "INSERT INTO interests_received(FROM,TO) values($FROM,$TO)"; $result1 = mysql_query($sql1) or die("Query: " . $sql1 . "\n\n" . mysql_error()); If $result is successful, I want another php file called InterestSent.php file to execute a SELECT query & echo result in that page. Similarly, if $result1 is successful, I want another php file called InterestReceived.php file to execute another SELECT query & echo result in that page. How can the files InterestSent.php and InterestReceived.php be made known that $result and $result1 were successful? I cannot use "header" tag as it will direct the page to another php file, whereas I want two other php files to execute separate queries based on the results of this page. Anyone who can help me with this? Thanks. Link to comment https://forums.phpfreaks.com/topic/123393-solved-how-to-trigger-execution-of-two-other-php-files-if-a-condition-is-satisfied/ Share on other sites More sharing options...
JasonLewis Posted September 9, 2008 Share Posted September 9, 2008 if($result){ include("InterestSent.php"); } if($result1)} include("InterestReceived.php"); } ? Link to comment https://forums.phpfreaks.com/topic/123393-solved-how-to-trigger-execution-of-two-other-php-files-if-a-condition-is-satisfied/#findComment-637316 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.