I solved the problem myself.
Following command works:
export CONTENT_LENGTH=4; export REQUEST_METHOD=POST; export SCRIPT_FILENAME=
test.php ; export CONTENT_TYPE=application/x-www-form-urlencoded; echo s=44
| php-cgi
output:
X-Powered-By: PHP/5.2.3-1ubuntu6.3
Content-type: text/html
44
a wor
Thanks guys!
This (From Tul/Sokolewicz):
$html = preg_replace('#(<[/]?img.*>)#U', '', $html);
worked perfectly! I'm just learning this stuff so its extremly hard for me... i
have been messing around with PHP for years but rarely even dipped my toes into
the REGEX part as I think it would be e
Hi,
I'm writing a simple httpd with php support via cgi/fastcgi. I tried several
ways to pass POST data to php-cgi (by writing to child process's stdin from
parent process), however, none of them worked
Here's the most simple not working example:
$ export CONTENT_LENGTH=4; export HTTP_METHOD=POS
Jim Lucas wrote:
M. Sokolewicz wrote:
Ryan A wrote:
Hey All,
After searching I found this regex to remove img tags from a post,
but running it is giving me an error, being a total noob with regex i
have no idea what the heck is wrong heres the whole script as its
tiny:
$html = " hello
M. Sokolewicz wrote:
Ryan A wrote:
Hey All,
After searching I found this regex to remove img tags from a post, but
running it is giving me an error, being a total noob with regex i have
no idea what the heck is wrong heres the whole script as its tiny:
$html = " hello ".'width="272" hei
Sorry for the long post, but I thought it would explain much of my
thinking... Anyway, here we go...
Jeremy Mcentire wrote:
You may have meant the while loop to iterate over $row =
fetch_object($res) ...
You are correct, I was simply trying to get the concept across. But you
are correct,
Ryan A wrote:
Hey All,
After searching I found this regex to remove img tags from a post, but running
it is giving me an error, being a total noob with regex i have no idea what the
heck is wrong heres the whole script as its tiny:
'. " Paul! ";
$html =
preg_replace('\s]+))?)+\s*|\s*)/?
Hey All,
After searching I found this regex to remove img tags from a post, but running
it is giving me an error, being a total noob with regex i have no idea what the
heck is wrong heres the whole script as its tiny:
'. " Paul! ";
$html =
preg_replace('\s]+))?)+\s*|\s*)/?>',
'', $html);
Hi list!
__halt_compiler(). Does anyone use it?
I've used it obsessively in my past two "projects" to store data
(specifically CSV) in the PHP files. These two "projects" consisted of
only one file, and I didn't want to clutter everything and involve
databases and/or XML files.
Your thoughts?
-
dav wrote:
Hi,
I have question about \0 character with DOM :
What to do with the character \0 ? encode this character to obtain :
? or skip the character with str_replace("\0", '',
$cdata) ?
CDATA is raw data and why it doesnt get magically encoded. If you remove
the charac
Robert Cummings wrote:
On Sun, 2008-03-16 at 11:42 -0700, Jim Lucas wrote:
Robert Cummings wrote:
Imagine 200 customers in your example... your example will hit the DB
201 times. The above hits the DB twice.
My code was intended to get the concept across. Thanks for the
suggestions though.
On Sun, 2008-03-16 at 11:42 -0700, Jim Lucas wrote:
> Robert Cummings wrote:
> > Imagine 200 customers in your example... your example will hit the DB
> > 201 times. The above hits the DB twice.
>
> My code was intended to get the concept across. Thanks for the
> suggestions though.
Ah, ok. I'
On Sun, Mar 16, 2008 at 1:50 AM, dav <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have question about \0 character with DOM :
>
>$cdata = 'foo' . "\0" . 'bar';
>
> $dom = new DOMDocument('1.0', 'utf-8');
> $dom->formatOutput = true;
>
> $container = $dom->createElement('root');
> $blob =
Here's how I'd do it.
getRecordId();//Or, you can put this inside the heredoc with {}
//heredoc
$str= <<
txt;
if (!empty($emp_row->getField('testfield')) print $str;
else print "Non Print";
?>
[EMAIL PROTECTED] wrote:
Hello Folks,
I would like to be able to wrap a 'form' inside a php '
Richard Heyes wrote:
Hi,
Going off the subject alone, you might want to investigate the
__tostring() magic method that you can define to handle objects being
cast to a string. Also, there's a whole bunch of magic methods that you
can use to handle PHP operations on user defined objects:
htt
Robert Cummings wrote:
Imagine 200 customers in your example... your example will hit the DB
201 times. The above hits the DB twice.
My code was intended to get the concept across. Thanks for the
suggestions though.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Thank you everybody for these great tips!
--
Thanks - RevDave
Cool7 @ hosting4days . com
[db-lists]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
after talking w/ marcus it sounds like theyve explicitly decided not to
support objects in the aforementioned context.
-nathan
On Sat, Mar 15, 2008 at 6:02 PM, Jim Lucas <[EMAIL PROTECTED]> wrote:
> It has been brought to my attention that with Perl and Ruby, you can use
> Objects as the value of the key within an array. The examples that were
> shown to me make me think that this would be an awesome ability to have
> wi
Hi,
Going off the subject alone, you might want to investigate the
__tostring() magic method that you can define to handle objects being
cast to a string. Also, there's a whole bunch of magic methods that you
can use to handle PHP operations on user defined objects:
http://uk.php.net/manual/
Hi,
I have question about \0 character with DOM :
formatOutput = true;
$container = $dom->createElement('root');
$blob = $dom->createElement('blob');
$blob->appendChild($dom->createCDATASection($cdata));
$container->appendChild($blob);
$dom->appendChild(
21 matches
Mail list logo