LinuxQuestions.org
Visit Jeremy's Blog.
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
 
LinkBack Search this Thread
Old 12-14-2005, 08:20 PM   #1
Dave Kelly
Member
 
Registered: Aug 2004
Location: Todd Mission Texas
Distribution: Linspire
Posts: 213

Rep: Reputation: 30
Tutorial Needed


I am in need of a tutorial on putting php code in a bash script code. I have spent a full day over the last 3 searching google and read tons of stuff, none answers the questions I have. I know nothing of php and very little bash.

I have downloaded and installed the 'class.phpmailer' package.

1. I want the php code to reside on my computer not a server somewhere. Is that possible? I have apache running and I understand that is getting fairly standard across most distros?
2. What exactly would the calling code look like in the bash script?

The php call will need to go here"
Quote:
If [ "$TIMEFRAME" -gt 1209600 ] ; then
Insert php code here
echo $url" * "$admin_email $TIMEFRAME >> TLDPreminderlog
And Here
Quote:
cp TLDPreminderlog LDPremind.$suffix
rm -f TLDPreminderlog
cp TLDPnoresponcelog LDPnoresponce.$suffix
rm -f TLDPnoresponcelog
Insert php code here
I don't need to learn php, just how to do the above.
 
Old 12-14-2005, 09:51 PM   #2
freegianghu
Member
 
Registered: Oct 2004
Location: somewhere in the street
Distribution: Window$
Posts: 192

Rep: Reputation: 30
Code:
PHP_EXEC=php -r

if [ "$TIMEFRAME" -gt 1209600 ] ; then
    $PHP_EXEC 'echo "Insert php code here\n";'
    echo $url" * "$admin_email $TIMEFRAME >> TLDPreminderlog
if
#   And Here
cp TLDPreminderlog LDPremind.$suffix
rm -f TLDPreminderlog
cp TLDPnoresponcelog LDPnoresponce.$suffix
rm -f TLDPnoresponcelog
$PHP_EXEC 'echo "Insert php code here\n";'
 
Old 12-14-2005, 11:05 PM   #3
Dave Kelly
Member
 
Registered: Aug 2004
Location: Todd Mission Texas
Distribution: Linspire
Posts: 213

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by freegianghu
Code:
PHP_EXEC=php -r

if [ "$TIMEFRAME" -gt 1209600 ] ; then
    $PHP_EXEC 'echo "Insert php code here\n";'
    echo $url" * "$admin_email $TIMEFRAME >> TLDPreminderlog
if
#   And Here
cp TLDPreminderlog LDPremind.$suffix
rm -f TLDPreminderlog
cp TLDPnoresponcelog LDPnoresponce.$suffix
rm -f TLDPnoresponcelog
$PHP_EXEC 'echo "Insert php code here\n";'
That code line
Code:
$PHP_EXEC 'echo "Insert php code here\n";'
should look something like this?

Code:
$PHP_EXEC 'echo "class.phpmailer.php $To="$admin_email" $Sender="daveekelly@earthlink.net" $Subject="LDP Mirror Update Check" $Body="A routine check of the timestamp.txt show that your mirror has  not been updated on over 2 weeks. If you are having trouble could you please check with Tillie." $AltBody="There is no HTML code sent" $Username="daveekelly" $Password="xxxxxxxx"\n";'

Thanks for your reply.
Dave
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apache2 basic tutorial needed exodist Linux - Networking 1 02-22-2005 08:24 PM
Step by step tutorial on Installing Identd needed sloik2000 Linux - Software 0 08-15-2004 10:16 AM
ipfw tutorial needed duerra *BSD 2 01-26-2004 09:18 AM
wanting to run a mail server from slackware.. Tutorial needed. VioLaToR Linux - Software 0 01-20-2004 07:55 PM
a tutorial needed dog-god Linux - Newbie 6 08-24-2002 10:06 PM


All times are GMT -5. The time now is 05:38 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration