Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Dec 2000
Posts: 730
deutscher moderator / v5 specialist
deutscher moderator / v5 specialist
Offline
Joined: Dec 2000
Posts: 730
how can I start a PHP script from a prel sript?

I have sometimes a problem with a mySQL server. Every time it is away i will start a PHP script to get the current systeminfo. Do anyone know how to code this??


TIA
joking

Sponsored Links
Joined: Aug 2000
Posts: 335
Member
Member
Offline
Joined: Aug 2000
Posts: 335
Code
#!/usr/bin/perl -wT

use strict;

print <<END;
Status: 302 Moved
Location: http://www.example.com/yourscript.php
END

exit;

Joined: Dec 2000
Posts: 730
deutscher moderator / v5 specialist
deutscher moderator / v5 specialist
Offline
Joined: Dec 2000
Posts: 730
can i start a script without Location or img ?

Joined: Aug 2000
Posts: 335
Member
Member
Offline
Joined: Aug 2000
Posts: 335
Perl and PHP are different languages. Perl can't directly interpret a PHP script, and vice versa.

Are the Perl and PHP scripts CGI scripts, or shell scripts?

You'll have to explain more about what problem you're trying to solve.

Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
Addition to Dave: if you can call the php script from shell, you can try exec() and system()

or, if you just want to get the output of that php script, you can use a socket to connect, or use LWP...

Sponsored Links
Joined: Dec 2000
Posts: 730
deutscher moderator / v5 specialist
deutscher moderator / v5 specialist
Offline
Joined: Dec 2000
Posts: 730
Thanks, I've coded it with system()...

Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
also, if you want to capture output (set it to a perl variable), you can use backticks

$result = `SHELL COMMAND`;

or use qx//;

$result = qx/SHELL COMMAND/;

`` and qx// are (nearly) the same...


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)