LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-11-2020, 07:35 PM   #1
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Rep: Reputation: 12
Call php script from php script will not run


On my frontend script I have a choice of backing up the database file for the program. This frontend calls a php script which by itself works fine. What I am trying to do is get back from the called script to the iniating script. The insert shows what is going on(I hope).
Thanks for help in solving this, R
Attached Files
File Type: txt phpTophp.txt (933 Bytes, 14 views)
 
Old 11-11-2020, 08:18 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
One way to redirect the browser back to your "front end page" is the header function.

Code:
header("Location: /url/to/the/other/page");
There is also ways to combine front and the back together into one web page too.

Last edited by michaelk; 11-11-2020 at 08:20 PM.
 
1 members found this post helpful.
Old 11-12-2020, 03:43 PM   #3
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Original Poster
Rep: Reputation: 12
Thanks michaelk,

I used header( "refresh:10; url=PizziFrontEnd.php" ); at the very top of my script

and

echo 'Continuing in 10 seconds. Return now - click<a href="PizziFrontEnd.php"> here</a>.';

at the very bottom of my script and it works like a charm.

R
 
Old 11-12-2020, 04:04 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
FYI the web server has its own PHP interpreter which is separate from the PHP CLI command line interpreter which you were trying to run in the posted code. The php CLI interpreter should not be in the apache's users path which is one reason it failed plus it I shouldn't process it as a web page. I've run stand alone php CLI code just like any other program via exec but never tried to see what happens if it contains HTML code...

Last edited by michaelk; 11-12-2020 at 04:09 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
asterisk call out script - help understanding call files winairmvs Linux - Software 0 10-28-2010 04:52 PM
SCP a file to diff directory/change filename using PHP or call sh script fm PHP nuebelhor Red Hat 1 11-05-2009 08:03 AM
weird PHP compile issue- module shows in "php -m" but not in phpinfo call hbbtstar Linux - Software 1 08-28-2009 03:14 PM
How can I script an autologin, automatically call kde(or simillar) and call an app aboaventura Slackware 8 02-03-2007 11:00 PM
What do you call your remote control? I call mine... RHLinuxGUY General 19 10-18-2004 06:23 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration