Tim Dunphy | 1 Jul 02:00 2012
Picon

embedding php inside of php

Hello,

 I am trying to get the hang of php using some examples that I found
in a book. I've been making progress lately, but one thing has me a
bit stumped.

In an HTML form that I am echoing through PHP I would like to embed
smaller chunks of php in the code like so:

 echo '<br /><br />
        <form method="post" action="sendemail.php">
        <label for="subject">Subject of email:</label><br />
        <input id="subject" name="subject" type="text" value="<?php
echo $subject;?>"><br />
        <label for="elvismail">Body of email:</label><br />
        <textarea id="elvismail" name="elvismail" rows="8"
cols="40">"<?php echo $text;?>"       </textarea><br />
        <input type="submit" name="Submit" value="Submit" />
        </form>';

If I do embed the smaller chunks of php in the form the way I've just
shown you the script instantly breaks and the web page shows only a
white screen of death.

And I see this in the web server logs

[Sat Jun 30 19:12:54 2012] [notice] child pid 7769 exit signal
Segmentation fault (11)

If I remove the smaller bits of php as I show here the web page starts
(Continue reading)

Bastien | 1 Jul 02:20 2012
Picon

Re: embedding php inside of php


Bastien Koert

On 2012-06-30, at 8:00 PM, Tim Dunphy <bluethundr <at> gmail.com> wrote:

> Hello,
> 
> I am trying to get the hang of php using some examples that I found
> in a book. I've been making progress lately, but one thing has me a
> bit stumped.
> 
> 
> In an HTML form that I am echoing through PHP I would like to embed
> smaller chunks of php in the code like so:
> 
> 
> echo '<br /><br />
>        <form method="post" action="sendemail.php">
>        <label for="subject">Subject of email:</label><br />
>        <input id="subject" name="subject" type="text" value="<?php
> echo $subject;?>"><br />
>        <label for="elvismail">Body of email:</label><br />
>        <textarea id="elvismail" name="elvismail" rows="8"
> cols="40">"<?php echo $text;?>"       </textarea><br />
>        <input type="submit" name="Submit" value="Submit" />
>        </form>';
> 
> 
> 
> If I do embed the smaller chunks of php in the form the way I've just
(Continue reading)

Robert Williams | 1 Jul 08:34 2012

Re: Re: php batch/queue framwork

Zend Server includes a job queue.

<http://www.zend.com/en/products/server/zend-server-job-queue>

It supports queuing up jobs directly in the UI or via a PHP API, and it includes a variety of scheduling and
load management options.

--
Bob Williams

Notice: This communication, including attachments, may contain information that is confidential. It
constitutes non-public information intended to be conveyed only to the designated recipient(s). If the
reader or recipient of this communication is not the intended recipient, an employee or agent of the
intended recipient who is responsible for delivering it to the intended recipient, or if you believe that
you have received this communication in error, please notify the sender immediately by return e-mail and
promptly delete this e-mail, including attachments without reading or saving them in any manner. The
unauthorized use, dissemination, distribution, or reproduction of this e-mail, including
attachments, is prohibited and may be unlawful. If you have received this email in error, please notify us
immediately by e-mail or telephone and delete the e-mail and the attachments (if any).

--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Tim Streater | 1 Jul 14:01 2012
Picon

Re: [PHP] embedding php inside of php

On 01 Jul 2012 at 01:00, Tim Dunphy <bluethundr <at> gmail.com> wrote: 

> I am trying to get the hang of php using some examples that I found
> in a book. I've been making progress lately, but one thing has me a
> bit stumped.
>
> In an HTML form that I am echoing through PHP I would like to embed
> smaller chunks of php in the code like so:
>
>
> echo '<br /><br />
>        <form method="post" action="sendemail.php">
>        <label for="subject">Subject of email:</label><br />
>        <input id="subject" name="subject" type="text" value="<?php
> echo $subject;?>"><br />
>        <label for="elvismail">Body of email:</label><br />
>        <textarea id="elvismail" name="elvismail" rows="8"
> cols="40">"<?php echo $text;?>"       </textarea><br />
>        <input type="submit" name="Submit" value="Submit" />
>        </form>';


You don't need the nested echoes. Just concatenate instead:

echo '<br /><br />
       <form method="post" action="sendemail.php">
       <label for="subject">Subject of email:</label><br />
       <input id="subject" name="subject" type="text" value="' . $subject . '"><br />
       <label for="elvismail">Body of email:</label><br />
       <textarea id="elvismail" name="elvismail" rows="8"
(Continue reading)

Yared Hufkens | 1 Jul 14:06 2012
Picon

Re: embedding php inside of php

If you are using PHP 5.4 or short_open_tag is 1, you can also do this:

Some HTML text here<?=subject?>some more HTML text<?=$text?>and finally other stuff here

Am 01.07.2012 14:01, schrieb Tim Streater:
> On 01 Jul 2012 at 01:00, Tim Dunphy <bluethundr <at> gmail.com> wrote: 
>
>> I am trying to get the hang of php using some examples that I found
>> in a book. I've been making progress lately, but one thing has me a
>> bit stumped.
>>
>> In an HTML form that I am echoing through PHP I would like to embed
>> smaller chunks of php in the code like so:
>>
>>
>> echo '<br /><br />
>>        <form method="post" action="sendemail.php">
>>        <label for="subject">Subject of email:</label><br />
>>        <input id="subject" name="subject" type="text" value="<?php
>> echo $subject;?>"><br />
>>        <label for="elvismail">Body of email:</label><br />
>>        <textarea id="elvismail" name="elvismail" rows="8"
>> cols="40">"<?php echo $text;?>"       </textarea><br />
>>        <input type="submit" name="Submit" value="Submit" />
>>        </form>';
>
> You don't need the nested echoes. Just concatenate instead:
>
> echo '<br /><br />
>        <form method="post" action="sendemail.php">
(Continue reading)

RGraph.net support | 2 Jul 01:21 2012
Picon

Hello again

Hi,

Just thought I'd say hello again. Back to brush up on my PHP a little
after a bit of a break - more reading than replying I'd imagine. I
have some pretty bad jokes too that I might surreptitiously insert
here and there...

Cheers.

-- 
Richard Heyes, RGraph.net support
RGraph: JavaScript charts for your website
http://www.rgraph.net

--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

tamouse mailing lists | 2 Jul 09:52 2012
Picon

Re: Hello again

On Sun, Jul 1, 2012 at 6:21 PM, RGraph.net support <support <at> rgraph.net> wrote:
> Just thought I'd say hello again. Back to brush up on my PHP a little
> after a bit of a break - more reading than replying I'd imagine. I
> have some pretty bad jokes too that I might surreptitiously insert
> here and there...

Welcome back. Friday is mainly the free-for-all day (philosophical
questions, puns, jokes)

--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Ford, Mike | 2 Jul 12:04 2012
Picon

RE: Re: php form action breaks script

> -----Original Message-----
> From: Tim Dunphy [mailto:bluethundr <at> gmail.com]
> Sent: 28 June 2012 01:18
> 
> Hey guys,
> 
> It's been a little while since I've toyed with this, and I hope you
> don't mind my coming back to you for some more advice. But I've
> enjoyed some limited success with David R's advice regarding adding
> some strong quoting to the mix. Here is what I last tried -
> 
>  <form method="post" action="' . $_SERVER['[PHP_SELF'] .'">

Wow! That's completely wacko! (OK, just looked at the full code and
seen it's in the middle of a single-quoted echo, so it's not that bad
after all :). You've got a spare [ in there -- the notice saying
Undefined index: [PHP_SELF should have alerted you to this, as the
index you want is just plain PHP_SELF.

   <form method="post" action="' . $_SERVER['PHP_SELF'] .'">

> The pages do work, and the form checking code does its job (empty
> text
> displays what information is missing). Except that there is an
> annoying message that appears on screen and in the logs -
> 
> Notice: Undefined index: subject in
> /Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendema
> il.php
> on line 23 Notice: Undefined index: elvismail in
(Continue reading)

Nick Chalk | 2 Jul 13:58 2012

Destructor not called when extending SimpleXMLElement

Afternoon all.

I seem to be having a little trouble with extending the
SimpleXMLElement class. I would like to add a destructor to the
subclass, but am finding that it is not called.

Attached is a minimal demonstration of the problem. The XMLConfig
class extends SimpleXMLElement, and its destructor is not called. The
XMLConfig2 class, which does not use inheritance, does have its
destructor called.

The test platform is CentOS 6.2, with PHP version 5.3.3.

What am I missing?

Thanks for your help.
Nick.

-- 
Nick Chalk.

Loadbalancer.org Ltd.
Phone: +44 (0)870 443 8779
http://www.loadbalancer.org/
Attachment (minimal_test.php): application/x-httpd-php, 568 bytes
--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
(Continue reading)

Erwin Poeze | 2 Jul 14:55 2012
Picon

Re: Destructor not called when extending SimpleXMLElement

Interesting problem. I would expect it to work too. I assume it is a bug.

2012/7/2 Nick Chalk <nick <at> loadbalancer.org>

> Afternoon all.
>
> I seem to be having a little trouble with extending the
> SimpleXMLElement class. I would like to add a destructor to the
> subclass, but am finding that it is not called.
>
> Attached is a minimal demonstration of the problem. The XMLConfig
> class extends SimpleXMLElement, and its destructor is not called. The
> XMLConfig2 class, which does not use inheritance, does have its
> destructor called.
>
> The test platform is CentOS 6.2, with PHP version 5.3.3.
>
> What am I missing?
>
> Thanks for your help.
> Nick.
>
> --
> Nick Chalk.
>
> Loadbalancer.org Ltd.
> Phone: +44 (0)870 443 8779
> http://www.loadbalancer.org/
>
> --
(Continue reading)


Gmane