Jump to content


Photo

How should this be written?


  • Please log in to reply
2 replies to this topic

#1 tgavin

tgavin
  • Members
  • PipPipPip
  • Advanced Member
  • 176 posts
  • LocationNaples, FL

Posted 13 February 2005 - 12:33 AM

How should the following be written? [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]echo \"<input name=\\"upmasthead\\" type=\\"radio\\" value=\\"0\\" title=\\"$radioTY\\" onclick=\\"MM_openBrWindow(\'pref_image_browser.php?img=pmasthead&amp;id=$row_rs_newsletter[\'id\']\',\'browser\',\'width=700,height=200\')\\"> Yes\n\";[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

$row_rs_newsletter['id'] is tripping me up.
I've tried enclosing it in () but that didn't work.

Thanks!
A noble spirit embiggens the smallest man.
- Jebediah Springfield

#2 ashoogy

ashoogy
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 13 February 2005 - 12:48 PM

Hi there,

it should be written as follows:

[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]echo \"
        <input name=\\"upmasthead\\" type=\\"radio\\" value=\\"0\\" title=\\"$radioTY\\" onclick=\\"MM_openBrWindow(\'pref_image_browser.php?img=pmasthead&amp;id=\'\".$row_rs_newsletter[\'id\'].\"\',\'browser\',\'width=700,height=200\')\\"> Yes\n

        \";[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]

#3 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 13 February 2005 - 04:46 PM

just think of it this way: when you are using an array variable inside of quotes, you don't need to use the single quotes in the brackets "[]"... like this:
[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]
echo \"<input name=\\"upmasthead\\" type=\\"radio\\" value=\\"0\\" title=\\"$radioTY\\" onclick=\\"MM_openBrWindow(\'pref_image_browser.php?img=pmasthead&amp;id=$row_rs_newsletter[id]\',\'browser\',\'width=700,height=200\')\\"> Yes\n\";
[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users