Can you please translate this thml line to php before I do harm to myself !!

Discussion in 'PHP' started by jacka, Sep 24, 2007.

  1. #1
    Hi

    I need to incorporate this line in a php file.
    
     <a target="_blank" href="../C27reduced/C27 
    	<?php echo $rowpdf[page_number]; ?>.pdf" ><img class="pdf" src="../images/pdflogo.gif" >	</a>
    
    HTML:
    Unortunately it is a bit too complicated for me to do.
    I do know I am supposed to to escape the double quotes,etc. but I am too new to php and its not working.

    Many thanks for your teaching.
     
    jacka, Sep 24, 2007 IP
  2. jacka

    jacka Peon

    Messages:
    165
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is my faulty attempt.
    
    	echo  "<a target=\"_blank\" href=\"../C27reduced/C27";
    	 echo ".$rowpdf[page_number]."pdf >."";
    	echo ".<img  src=\"../images/pdflogo.gif\" >	</a>." ";
    
    Code (markup):
    Thanks
     
    jacka, Sep 24, 2007 IP
  3. SoftCloud

    SoftCloud Well-Known Member

    Messages:
    1,060
    Likes Received:
    28
    Best Answers:
    2
    Trophy Points:
    120
    #3
    <?php
    echo "<a target=\"_blank\" href=\"../C27reduced/C27$rowpdf[page_number].pdf\"><img class=\"pdf\" src=\"../images/pdflogo.gif\"></a>";
    ?>
    PHP:
    Try that.
     
    SoftCloud, Sep 24, 2007 IP
  4. jacka

    jacka Peon

    Messages:
    165
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi

    You guys never seem to stop amazing me.
    Right on, first time.
    I am going to study this for next time.
    Cheers mate, much appreciated.
    jacka
     
    jacka, Sep 24, 2007 IP
  5. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #5
    <?php echo "<a target='_blank' href='../C27reduced/C27$rowpdf[page_number].pdf'><img class='pdf' src='../images/pdflogo.gif'></a>";?>
    PHP:
     
    Silver89, Sep 24, 2007 IP
  6. alexts

    alexts Well-Known Member

    Messages:
    1,126
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    125
    Digital Goods:
    1
    #6
    This way you never have to worry about escaping characters
    
    $prints=<<<EOT
    <a target="_blank" href="../C27reduced/C27
        <?php echo $rowpdf[page_number]; ?>.pdf" ><img class="pdf" src="../images/pdflogo.gif" >    </a> 
    
    EOT;
    
    echo $prints;
    PHP:
     
    alexts, Sep 24, 2007 IP
  7. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #7
    Thats usefull, whats oet stand for?
     
    Silver89, Sep 24, 2007 IP
  8. SoftCloud

    SoftCloud Well-Known Member

    Messages:
    1,060
    Likes Received:
    28
    Best Answers:
    2
    Trophy Points:
    120
    #8

    EOT stands for End-of-transmission.
     
    SoftCloud, Sep 24, 2007 IP
  9. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #9
    EOT can be anything though. It's just an example of a Heredoc string.
     
    nico_swd, Sep 24, 2007 IP