Is this Possible Or not?

by 12 replies
14
I am wondering and I know this is a very stupid question but please bear with me...

I have got this php order button that I have added to an html page.. And only got it to work once. Now it doesnt.. It only works when I convert the whole html into php...

Is there anyway that I can put some php code into a standard html page and make it work without converting it all to php?

If not I have another question for you
#programming #html #php
  • Yes.. just put your code in <?php ?> tag.

    For example:

    HTML Code:
    <html>
    <body>
    <h1>Hello Word</h1>
    
    <?php echo "Hello"; ?>
    
    </body>
    
    </html>
    • [1] reply
    • Alright

      I did put the following code into the html file

      <?php $orderlink = 'http://www.your-order-link.com'; ?>
      <P ALIGN=Center style="font-family: impact; font-size: 30pt;">
      <FONT COLOR=#cc0000>Claim Your Copy Now!</FONT>
      <P>
      <CENTER><TABLE border="0" cellspacing="0" cellpadding="0">
      <TR>
      <TD><div onclick="location.href='<?=$orderlink;?>';" style="cursor: pointer;">
      <TABLE style="border: 6px dashed #cc0000; border-collapse: collapse;" cellspacing="0" cellpadding="20" bordercolor="#111111">
      <TR>
      <TD>
      <P ALIGN=Center style="font-family: Tahoma; font-size: 20pt;">
      <FONT COLOR="#004488">Regular Price <STRIKE>$297</STRIKE> Today
      $97</FONT><BR>
      <A HREF="<?=$orderlink;?>" TARGET="_top"><IMG SRC="images/addtocart.jpg" BORDER="0"><BR>
      Add to Cart</A>
      <P align=center>
      <A HREF="<?=$orderlink;?>" TARGET="_top"><IMG SRC="images/mastercard.gif" BORDER="0"><IMG
      SRC="images/visa.gif" BORDER="0"><IMG SRC="images/amex.gif" BORDER="0"><IMG
      SRC="images/diners.gif" BORDER="0"><IMG SRC="images/jcb.gif" BORDER="0"><IMG
      SRC="images/discover.gif" BORDER="0"><IMG SRC="images/PayPal.gif" BORDER="0"></A>
      </TD>
      </TR>
      <TR>
      <TD>Testing The Marketing</TD>
      </TR>
      </TABLE></div>

      </TD>
      </TR>
      </TABLE>
      </CENTER>

      It only worked once.. But not anymore... Confused
      • [3] replies
  • To make .html files interperate PHP add a htaccess file to the folder in which the files are stored with the following:
    Code:
    AddType application/x-httpd-php .php .html
  • the file for the htaccess need to be in the root of the file directory, of the html file, you wish to add the php to and saved as ".htaccess"

    the full .htaccess file will look like

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    application/x-httpd-php .php .html
    • [1] reply

Next Topics on Trending Feed

  • 14

    I am wondering and I know this is a very stupid question but please bear with me... I have got this php order button that I have added to an html page.. And only got it to work once. Now it doesnt.. It only works when I convert the whole html into php...