Submit Your Article Forum Rules

Results 1 to 8 of 8

Thread: cURL, embed PHP into HTML

  1. #1
    WebProWorld MVP TrafficProducer's Avatar
    Join Date
    Jul 2003
    Posts
    1,958

    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

  2. #2
    WebProWorld MVP DaveSawers's Avatar
    Join Date
    Dec 2006
    Location
    Lunenburg, Nova Scotia, Canada
    Posts
    762

    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

  3. #3
    WebProWorld MVP TrafficProducer's Avatar
    Join Date
    Jul 2003
    Posts
    1,958

    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

  4. #4
    WebProWorld MVP wige's Avatar
    Join Date
    Jun 2006
    Posts
    3,138

    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.
    WigeDev - Freelance web and software development

  5. #5
    WebProWorld MVP TrafficProducer's Avatar
    Join Date
    Jul 2003
    Posts
    1,958

    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

  6. #6
    WebProWorld MVP DaveSawers's Avatar
    Join Date
    Dec 2006
    Location
    Lunenburg, Nova Scotia, Canada
    Posts
    762

    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

  7. #7
    Senior Member
    Join Date
    Jul 2003
    Posts
    519

    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.

  8. #8
    WebProWorld MVP TrafficProducer's Avatar
    Join Date
    Jul 2003
    Posts
    1,958

    Re: cURL, embed PHP into HTML

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

    Thanks everyone

Similar Threads

  1. What is Curl?
    By willanfei in forum eCommerce Discussion Forum
    Replies: 2
    Last Post: 05-21-2008, 11:35 PM
  2. Can you embed a PHP, ASP Microsite with an HTML Site?
    By melchapman in forum Web Programming Discussion Forum
    Replies: 7
    Last Post: 04-15-2007, 10:30 AM
  3. Page Curl Effect
    By WPW_Feedbot in forum Graphics & Design Discussion Forum
    Replies: 0
    Last Post: 03-09-2005, 12:31 AM
  4. Page Curl
    By WPW_Feedbot in forum Graphics & Design Discussion Forum
    Replies: 0
    Last Post: 01-19-2005, 01:01 AM
  5. php - curl - proxy ? help plz
    By AjiNIMC in forum Web Programming Discussion Forum
    Replies: 1
    Last Post: 10-04-2004, 07:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •