SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How do I put a variable in this line?

    Hi,

    I'm having trouble figuring out how to get the line below to use the php variable $smilie_path. Can someone help me with it?

    Thanks.
    PHP Code:
    PRINT "<form name=\"tagboard\" action=\""; PRINT "$script_loc"; PRINT "/tags.php?add=1\" method=\"post\" target=\"tags\"> 

    // rest of the form here

    <div align=\"center\"><a href=""\"java script:emoticon('text here')\"><img src=""\"
    $smilie_path/biggrin.gif\" border=\"0\" alt=\"text here\"></a></div> 


    please ignore the 2 "" before \"$smilie... , the forum is putting those in, I don't know how to stop it.
    coiL
    "cradled in the learning curve"

  2. #2
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    really life will be much easier if you can avoid print()'ing everything ! (not sure if this answers your question but~)

    PHP Code:
    <form name="tagboard" action="<?echo $script_loc;?>/tags.php?add=1" method="post" target="tags"> 
    // rest of the form here
    <div align="center">
      <a href="javascript:emoticon('text here')">
        <img src="<?echo $smilie_path;?>/biggrin.gif" border="0" alt="text here">
      </a>
    </div>


    I used echo , but PRINT or <?=$var;?> is just as good

  3. #3
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks I did re-write it to use echo instead of print but he actual problem was that I was trying to use a variable in a function without declaring it as Global or whatever you call it.
    coiL
    "cradled in the learning curve"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •