![]() |
| ||||||||
|
|||||||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
HyperActive Warrior
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
|
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: 67
Thanks: 6
Thanked 9 Times in 7 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: 74
Thanks: 7
Thanked 4 Times in 4 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
Join Date: Nov 2009
Location: UK
Posts: 40
Thanks: 0
Thanked 5 Times in 5 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 | |
|
HyperActive Warrior
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
|
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 | |
|
HyperActive Warrior
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
|
Quote:
How did it work once? | |
|
|
|
|
|
#7 | |
|
How can I help?
War Room Member
Join Date: Apr 2009
Location: Oregon
Posts: 136
Thanks: 29
Thanked 48 Times in 17 Posts
|
Quote:
For instance, if you have "index.html" then rename that one file to "index.php" Be sure you have a good HTML document with the proper HTML headers and tags. And be sure to remove any .htaccess code that you might have inserted trying to get this to work. | |
|
"Sonny, true love is the greatest thing in the world. Except for a nice MLT... mutton, lettuce and tomato sandwich, where the mutton is nice and lean and the tomato is ripe" - Miracle Max
|
||
|
|
|
|
|
#8 |
|
Active Warrior
Join Date: Nov 2009
Location: UK
Posts: 40
Thanks: 0
Thanked 5 Times in 5 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).
|
|
|
|
|
|
#9 | |
|
HyperActive Warrior
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
|
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 | |
|
HyperActive Warrior
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
|
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 | |
|
|
|
|
|
#11 | |
|
Warrior Member
Join Date: Nov 2009
Posts: 20
Thanks: 0
Thanked 3 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! | |
|
|
|
|
|
#12 | |
|
HyperActive Warrior
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
|
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.... | |
|
|
|
|
|
#13 |
|
Warrior Member
Join Date: Nov 2009
Posts: 20
Thanks: 0
Thanked 3 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 | |
|
|
![]() |