Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sat Sep 10, 2005 9:46 am Reply with quote

I am using the following in a php file to display some stuff in a textarea box
Code:
 echo "            <table width='100%' border='0' cellspacing='0' cellpadding='0'>

        <tr>
          <td height='50' valign='middle' align='center'><strong>88x31 Link to Us Button(s)</strong></td>
        </tr>
      </table>
      <table width='100%' border='0' cellspacing='0' cellpadding='0'>
        <tr>
          <td align='center' width='50%'><strong>88x31</strong><br>
            <br>
            <a href='$siteurl' target='_blank' name='$alttext'><img src='$img1' border='0' alt='$alttext' /></a><br>
            <br>
            <textarea><a href=\"$siteurl\" target=\"_blank\" name=\"$alttext\"><img src=\"$img1\" border=\"0\" alt=\"$alttext\" /></a></textarea></td>";

Obviously textarea size is set in plain old html using
Code:
<textarea rows="3" cols="3"> text here blah blah </textarea>
but that does not seem to work with php.
What stupid mistake have I made?
 
View user's profile Send private message Send e-mail
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Sep 10, 2005 4:25 pm Reply with quote

Remember that PHP is, at the roots, a template engine. After all is said and done, PHP produces HTML related code to the browser. So, if you tell PHP
Code:
<?

echo "<textarea rows=\"3\" cols=\"3\"> text here blah blah </textarea>";
?>
then PHP will send <textarea rows="3" cols="3"> text here blah blah </textarea> to your browser. It doesn't care if it's valid HTML or not. So, if that code is correct then something else is affecting the code.

I just ran that code and it worked correctly
Code:
 text

here
blah
blah

What happens when you try it?
 
View user's profile Send private message
Guardian2003







PostPosted: Sat Sep 10, 2005 5:09 pm Reply with quote

Doh - how stupid am I?
I knew it was something simple - I forgot to escape the quotes!
.. think I'll get back under my rock for a while.............
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©