Simple PHP question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dodger21
    Confirmed User
    • Jan 2003
    • 2680

    #1

    Simple PHP question

    How do I assign this html string to a php variable and then how do I call that variable in my html?

    This is the string I want to assign to a php variable

    <a href="somelink.htm" onMouseOver="window.status='blahblahblah';return true" onMouseOut="window.status='';return true">
    icq: 237055440
  • phpslave
    Confirmed User
    • Jan 2003
    • 548

    #2
    the message board will problem take this and fuck it up with hahahaha or somebullshit, but here;

    $str = "<a href=\"somelink.htm\" onMouseOver=\"window.status='blahblahblah';return true\" onMouseOut=\"window.status='';return true\">";
    ?>

    <!-- then in your html -->

    <?=$str?>

    <!-- or -->
    <?
    print $str;
    ?>

    there are many ways to do it

    PHP Code:
    $str = "<a href=\"somelink.htm\" onMouseOver=\"window.status='blahblahblah';return true\" onMouseOut=\"window.status='';return true\">";
    ?>
    
    <!-- then in your html -->
    
    <?=$str?>
    
    <!-- or -->
    <?
    print $str;
    ?>

    Comment

    • dodger21
      Confirmed User
      • Jan 2003
      • 2680

      #3
      Thanks. I had everything right except for escaping the quotes. WTF is the hahaha shit?
      icq: 237055440

      Comment

      • stev0
        Confirmed User
        • Aug 2003
        • 6801

        #4
        Originally posted by dodger21
        Thanks. I had everything right except for escaping the quotes. WTF is the hahaha shit?
        That's the board censoring words

        Comment

        • Doc911
          Confirmed User
          • Feb 2004
          • 3695

          #5
          If you don't like all the escaping you can save the data in a txt file and do

          <?
          $string = "file.txt";
          file_get_contents($string);
          print ("$string");
          ?>


          For PHP/MySQL scripts ICQ 161480555 or email [email protected]

          Comment

          Working...