1 Jul 2012 02:00
embedding php inside of php
Tim Dunphy <bluethundr <at> gmail.com>
2012-07-01 00:00:04 GMT
2012-07-01 00:00:04 GMT
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)
RSS Feed