Re: embedding php inside of php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

<rant>
First a message to the ones that have responded before me:
You're correct about the nested php tags that are not doing what the
OP wanted, but you might want to take a closer look at the error
that's in the logs. In ANY CASE PHP SHOULD NOT CRASH. What if the OP
really wanted to print PHP tags inside it's textbox? That's perfectly
valid. I tested the code, and it works fine on my machine, even though
I get PHP tags inside the output.
</rant>

On Sun, Jul 1, 2012 at 2:00 AM, Tim Dunphy <bluethundr@xxxxxxxxx> 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
> 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)
>

What version of Operating System, Webserver(Apache?) and PHP are you
using? It seems like there is a bug in your PHP, so if you're not yet
at the latest version, you might want to upgrade your Webserver/PHP.

- Matijn

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux