iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
IT Discussion Forum Having IT issues? Got IT questions? Who doesn't? If you can't get your Apache to work with your MySQL or your php is choking on your ODBC... Let's see if we can help you come up with some ideas.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-29-2008, 11:16 AM
TrafficProducer's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: United Kingdom
Posts: 1,642
TrafficProducer RepRank 3TrafficProducer RepRank 3TrafficProducer RepRank 3
Question cURL, embed PHP into HTML

Embeded PHP in HTML refuses to display. A direct PHP call functions.

HTML with Embeded PHP does not display

A direct PHP call functions

I've tried various .htaccess, using AddType application/x-httpd-php .htm .html at this time

and various httpd.conf, this is blank for PHP at this time.

My new host say it is using cURL because of security, (Is it this is causing problems).

So how, easy way please, I get PHP to display embeded withing HTML pages?

Any help, gratefully received
Reply With Quote
  #2 (permalink)  
Old 01-30-2008, 09:10 AM
DaveSawers's Avatar
WebProWorld Veteran
 
Join Date: Dec 2006
Location: Calgary, Alberta, Canada
Posts: 492
DaveSawers RepRank 3DaveSawers RepRank 3
Default Re: cURL, embed PHP into HTML

You have to rename the page to use the .php extension. It doesn't matter if the content is mostly (or even all) HTML.

So rename your test_php.html to test_php.php and it'll work just fine.
__________________
Dynamic Software Development
www.activeminds.ca
Reply With Quote
  #3 (permalink)  
Old 01-30-2008, 09:21 AM
TrafficProducer's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: United Kingdom
Posts: 1,642
TrafficProducer RepRank 3TrafficProducer RepRank 3TrafficProducer RepRank 3
Default Re: cURL, embed PHP into HTML

The issue I want .html (with PHP in them)

I just think this is more user, (and maybe search engine), frendly

Thany You
Reply With Quote
  #4 (permalink)  
Old 01-30-2008, 10:59 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: cURL, embed PHP into HTML

Because of cURL, I think you need to use AddHandler, instead of just AddType. AddType changes the MIME type of the document, and the server should process the document according to that new MIME type. Because the MIME type does change, this is not the issue. The issue is that the server doesn't know what to do with a document of type application/x-httpd-php, so it simply serves the document to the client. AddHandler creates a specific link between the file extension and the script handler. I would still recommend trying the following:

AddHandler php5-script .html
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #5 (permalink)  
Old 01-30-2008, 11:50 AM
TrafficProducer's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: United Kingdom
Posts: 1,642
TrafficProducer RepRank 3TrafficProducer RepRank 3TrafficProducer RepRank 3
Default Re: cURL, embed PHP into HTML

I've triesd a few AddHandler ... but no joy. I'm looking for a different host, (yet again)

Have tried:-

AddHandler x-httpd-php .html .htm

AddHandler php5-script .html

Thank you
Reply With Quote
  #6 (permalink)  
Old 01-30-2008, 04:36 PM
DaveSawers's Avatar
WebProWorld Veteran
 
Join Date: Dec 2006
Location: Calgary, Alberta, Canada
Posts: 492
DaveSawers RepRank 3DaveSawers RepRank 3
Default Re: cURL, embed PHP into HTML

Quote:
Originally Posted by TrafficProducer View Post
I just think this is more user, (and maybe search engine), frendly
Really? Why?
__________________
Dynamic Software Development
www.activeminds.ca
Reply With Quote
  #7 (permalink)  
Old 02-04-2008, 11:21 PM
WebProWorld Veteran
 
Join Date: Jul 2003
Location: Bristol, UK
Posts: 521
carbonize RepRank 0
Default Re: cURL, embed PHP into HTML

The extension of your web page makes no difference to neither your users nor search engines. If the php scripts you are trying to include are on your site then I recommend using include or require over cURL as they put less demand on the resources and are faster.
__________________
Carbonize
Reply With Quote
  #8 (permalink)  
Old 02-05-2008, 07:18 AM
TrafficProducer's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: United Kingdom
Posts: 1,642
TrafficProducer RepRank 3TrafficProducer RepRank 3TrafficProducer RepRank 3
Default Re: cURL, embed PHP into HTML

I've moved to a better host, without these issues.

Thanks everyone
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > IT Discussion Forum

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you embed a PHP, ASP Microsite with an HTML Site? melchapman Web Programming Discussion Forum 7 04-15-2007 11:30 AM
Page Curl Effect WPW_Feedbot Graphics & Design Discussion Forum 0 03-09-2005 01:31 AM
Embed flunks -- now what do I do? Weedy Lady Graphics & Design Discussion Forum 4 03-02-2005 02:57 PM
Page Curl WPW_Feedbot Graphics & Design Discussion Forum 0 01-19-2005 02:01 AM
php - curl - proxy ? help plz AjiNIMC Web Programming Discussion Forum 1 10-04-2004 08:12 AM


All times are GMT -4. The time now is 12:14 PM.



Search Engine Optimization by vBSEO 3.3.0