![]() | | ||||||||
| | #1 |
| Advanced Warrior Join Date: Nov 2008
Posts: 609
Thanks: 31
Thanked 1 Time in 1 Post
|
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 |
| | |
| | #2 |
| Active Warrior War Room Member Join Date: Oct 2009
Posts: 88
Thanks: 8
Thanked 10 Times in 8 Posts
|
Yes.. just put your code in <?php ?> tag. For example: HTML Code: <html> <body> <h1>Hello Word</h1> <?php echo "Hello"; ?> </body> </html> |
| | |
| | #3 |
| Active Warrior War Room Member Join Date: Jan 2009
Posts: 77
Thanks: 10
Thanked 5 Times in 5 Posts
|
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 |
| | |
| | #4 |
| Active Warrior War Room Member Join Date: Nov 2009 Location: UK
Posts: 51
Thanks: 0
Thanked 7 Times in 7 Posts
|
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 |
| | |
| | #5 | |
| Advanced Warrior Join Date: Nov 2008
Posts: 609
Thanks: 31
Thanked 1 Time in 1 Post
| Quote:
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 | |
| | |
| | #6 | |
| Advanced Warrior Join Date: Nov 2008
Posts: 609
Thanks: 31
Thanked 1 Time in 1 Post
| Quote:
How did it work once? | |
| | |
| | #7 |
| Active Warrior War Room Member Join Date: Nov 2009 Location: UK
Posts: 51
Thanks: 0
Thanked 7 Times in 7 Posts
|
Sorry byron_well misunderstood what was wanted. if you just want php to run in a html file just change the file extension as advised by Nick H. you dont really want to mess with the .htaccess file (dragons hide there).
|
| | |
| | #8 | |
| Advanced Warrior Join Date: Nov 2008
Posts: 609
Thanks: 31
Thanked 1 Time in 1 Post
| Quote:
Ok I have already done that Change over to php code.. But for some reason when in Internet explorer 8 Auto Blog Feeder the Claim Your Copy Now! part near where the order button is, is in big red letters.. However when I look in firefox browser the words are small?Also the php code that I showed covers the whole of the order button section.. At the moment the whole area is clickable.. I would like to add a second row to the table at the bottom, but not make that part clickable | |
| | |
| | #9 | |
| Advanced Warrior Join Date: Nov 2008
Posts: 609
Thanks: 31
Thanked 1 Time in 1 Post
| Quote:
Ok I have already done that Change over to php code.. But for some reason when in Internet explorer 8 Auto Blog Feeder the Claim Your Copy Now! part near where the order button is, is in big red letters.. However when I look in firefox browser the words are small?Also the php code that I showed covers the whole of the order button section.. At the moment the whole area is clickable.. I would like to add a second row to the table at the bottom, but not make that part clickable | |
| | |
| | #10 | |
| Active Warrior War Room Member Join Date: Nov 2009 Location: Charlotte, NC, USA
Posts: 30
Thanks: 2
Thanked 4 Times in 3 Posts
| Quote:
If you want to add a second row, do this: old: </TABLE></div> </TD> </TR> </TABLE> new: </TABLE></div> </TD> </TR> <tr> <td>....your new content here...</td> </tr> </TABLE> You can even use the <div> element for the content if you wish (although not required). Just make sure not to put the "onclick" there or it will be clickable. -- Mike Smith What? No Sig! | |
| | |
| | #11 | |
| Advanced Warrior Join Date: Nov 2008
Posts: 609
Thanks: 31
Thanked 1 Time in 1 Post
| Quote:
Thanks for that.. Nearly right.. I not sure if you have noticed that there is a red border around it.. If you take a look here http://www.digitalresellersvault.com...1/version1.php I would like the text to be in the red dashed part.... | |
| | |
| | #12 |
| Active Warrior War Room Member Join Date: Nov 2009 Location: Charlotte, NC, USA
Posts: 30
Thanks: 2
Thanked 4 Times in 3 Posts
| Ah - ok. Right now the table (which has the red border) is inside the <div> that contains the clickable part. So you'll need to make some changes. Right now you have this: <TD><div onclick="location.href='<?=;?>';" 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;"> ...rest of your content here... </TD> </TR> <TR> <TD>Testing The Marketing</TD> </TR> </TABLE></div> </TD> Change it to this: <TD> <TABLE style="border: 6px dashed #cc0000; border-collapse: collapse;" cellspacing="0" cellpadding="20" bordercolor="#111111"> <TR> <TD> <div onclick="location.href='<?=;?>';" style="cursor: pointer;"> <P ALIGN=Center style="font-family: Tahoma; font-size: 20pt;"> ...rest of your content here... </div> </TD> </TR> <TR> <TD>Testing The Marketing</TD> </TR> </TABLE> </TD> Noticed where I moved that "div". You still get the same functionality (well, except that the red dashed border itself won't be clickable, but every else will). You can then replace "Testing The Marketing" with any content you wish, and it will not be clickable, since it's outside the <div>. And you can just keep adding rows via "<tr><td>...content...</td></tr>". I noticed the PHP tags didn't copy over correct in my example, so just make sure those copy on your side correctly. HTH -- Mike Smith Still no advertising sig. What am I thinking? |
| | |
![]() |
|
| Tags |
| html, php |
| Thread Tools | |
| |
![]() |