David Dorward mumbled the following on 17/05/2005 08:19:
> don wrote:
>
>
>>echo "<iframe class=\"iframe\" width=\"600px\" height=\"230px\"
>>src=\"search_table.php?description=\"" . $description . "\">";
>
>
> Which will come out as something like:
>
> <iframe class="iframe" width="600px" height="230px"
> src="search_table.php?description="YOURDESCRIPTION ">
....which also appears to have an extra quote mark within the src itself.
> Try:
>
> ?>
> <iframe class="iframe" width="600" height="230"
> src="search_table.php?description=<? php
> echo htmlentities(urlencode($description));
> ?>">
> Alternative content
> </iframe>
> <?php
or, purely in PHP:
<?php
$description = htmlentities(urlencode($_REQUEST['description'];
echo '<iframe class="iframe" width="600" height="230"
src="search_table.php?description="'.$description. '">';
?>
There's no need to echo everything with double quotes ("), as most of it
is just a string, so you can save a little bit of processing time by
making PHP parse it as just a string, and not evaluate it for any PHP
inside of it, by using single quote instead ('). It also makes the code
neater by saving having to escape double quotes inside the string.
--
Gazza
Mobile Number Network Checker -
http://mnnc.net/
Creative writing & Poems -
http://garyjones.co.uk/
Leovanna Leonbergers -
http://leovanna.co.uk/