War Room

Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Featured Warrior Special Offer...
"Members Of The *War Room* Discover Secrets To Immediate Success!"
Reply
 
LinkBack Thread Tools
Old 11-03-2009, 09:49 PM   #1
HyperActive Warrior
 
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
Default Is this Possible Or not?

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
Byron_Wells is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 01:05 AM   #2
Active Warrior
War Room Member
 
Join Date: Oct 2009
Posts: 67
Thanks: 6
Thanked 9 Times in 7 Posts
Default Re: Is this Possible Or not?

Yes.. just put your code in <?php ?> tag.

For example:

HTML Code:
<html>
<body>
<h1>Hello Word</h1>

<?php echo "Hello"; ?>

</body>

</html>
RichPirate is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 03:55 AM   #3
Active Warrior
War Room Member
 
Join Date: Jan 2009
Posts: 74
Thanks: 7
Thanked 4 Times in 4 Posts
Default Re: Is this Possible Or not?

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
Gimme4Free is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 05:49 AM   #4
Active Warrior
 
jwlnewsome's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 40
Thanks: 0
Thanked 5 Times in 5 Posts
Default Re: Is this Possible Or not?

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
jwlnewsome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 11:11 AM   #5
HyperActive Warrior
 
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
Default Re: Is this Possible Or not?

Quote:
Originally Posted by RichPirate View Post
Yes.. just put your code in <?php ?> tag.

For example:

HTML Code:
<html>
<body>
<h1>Hello Word</h1>
 
<?php echo "Hello"; ?>
 
</body>
 
</html>
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
Byron_Wells is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 11:12 AM   #6
HyperActive Warrior
 
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
Default Re: Is this Possible Or not?

Quote:
Originally Posted by jwlnewsome View Post
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

How did it work once?
Byron_Wells is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 12:39 PM   #7
How can I help?
War Room Member
 
Nick H's Avatar
 
Join Date: Apr 2009
Location: Oregon
Posts: 136
Thanks: 29
Thanked 48 Times in 17 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via Skype™ to Nick H
Default Re: Is this Possible Or not?

Quote:
Originally Posted by Byron_Wells View Post
Alright

I did put the following code into the html file

<?php = '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='<?=;?>';" 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="<?=;?>" TARGET="_top"><IMG SRC="http://www.warriorforum.com/images/addtocart.jpg" BORDER="0"><BR>
Add to Cart</A>
<P align=center>
<A HREF="<?=;?>" TARGET="_top"><IMG SRC="http://www.warriorforum.com/images/mastercard.gif" BORDER="0"><IMG
SRC="http://www.warriorforum.com/images/visa.gif" BORDER="0"><IMG SRC="http://www.warriorforum.com/images/amex.gif" BORDER="0"><IMG
SRC="http://www.warriorforum.com/images/diners.gif" BORDER="0"><IMG SRC="http://www.warriorforum.com/images/jcb.gif" BORDER="0"><IMG
SRC="http://www.warriorforum.com/images/discover.gif" BORDER="0"><IMG SRC="http://www.warriorforum.com/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
You have the right code in there. Rename your file from .html to .php

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
Nick H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 02:36 PM   #8
Active Warrior
 
jwlnewsome's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 40
Thanks: 0
Thanked 5 Times in 5 Posts
Default Re: Is this Possible Or not?

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).
jwlnewsome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 05:22 PM   #9
HyperActive Warrior
 
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
Default Re: Is this Possible Or not?

Quote:
Originally Posted by Nick H View Post
You have the right code in there. Rename your file from .html to .php

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.

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
Byron_Wells is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 05:28 PM   #10
HyperActive Warrior
 
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
Default Re: Is this Possible Or not?

Quote:
Originally Posted by Nick H View Post
You have the right code in there. Rename your file from .html to .php

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.

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
Byron_Wells is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 07:39 PM   #11
Warrior Member
 
Mike P Smith's Avatar
 
Join Date: Nov 2009
Posts: 20
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: Is this Possible Or not?

Quote:
Originally Posted by Byron_Wells View Post
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
The "<div>" with the onclick is what's making that entire table clickable (your cursor: pointer; style gives you the pointer).

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!
Mike P Smith is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 08:10 PM   #12
HyperActive Warrior
 
Join Date: Nov 2008
Posts: 400
Thanks: 27
Thanked 4 Times in 4 Posts
Default Re: Is this Possible Or not?

Quote:
Originally Posted by Mike P Smith View Post
The "<div>" with the onclick is what's making that entire table clickable (your cursor: pointer; style gives you the pointer).

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!
Mike

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....
Byron_Wells is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-05-2009, 05:15 PM   #13
Warrior Member
 
Mike P Smith's Avatar
 
Join Date: Nov 2009
Posts: 20
Thanks: 0
Thanked 3 Times in 3 Posts
Default Re: Is this Possible Or not?

Quote:
Originally Posted by Byron_Wells View Post
I would like the text to be in the red dashed part....
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?
Mike P Smith is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
html, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 03:06 AM.