Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Sending PHP Tags In PHP CLI

Sending PHP Tags In PHP CLI
Thread Tools
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Aug 10, 2004, 05:09 AM
 
Hi guys,

I have an app that uses the PHP CLI for rendering PHP. So far it works, but I have a problem. I have to send the CLI a file, instead I would like to send it code. Now I realise I can do this with -r, but the problem is that it doesn't seem to be able to handle the <? ?> tags, or any tags. Any possible way of doing this? Remember, I can't use a custom PHP version since it has to be standard on all computers.

Thanks,
Oliver
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Aug 10, 2004, 08:58 PM
 
Originally posted by iOliverC:
I have an app that uses the PHP CLI for rendering PHP. So far it works, but I have a problem. I have to send the CLI a file, instead I would like to send it code. Now I realise I can do this with -r, but the problem is that it doesn't seem to be able to handle the <? ?> tags, or any tags. Any possible way of doing this? Remember, I can't use a custom PHP version since it has to be standard on all computers.
The "-r" option will not handle a mix of HTML and PHP. To do that, feed the php command line tool from standard input or from a file:

From a file:
Code:
php somefile.php
From standard input:
Code:
echo "<?php phpinfo() ?>" | php
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Aug 12, 2004, 02:17 PM
 
Originally posted by Arkham_c:
The "-r" option will not handle a mix of HTML and PHP. To do that, feed the php command line tool from standard input or from a file:

From a file:
Code:
php somefile.php
From standard input:
Code:
echo "<?php phpinfo() ?>" | php
Great, I should get to grips with the Terminal more .

Thanks,
Oliver
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:30 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2