1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How To Use Php Within An Html Site .

Discussion in 'HTML & Website Design' started by kamran210, Feb 14, 2013.

  1. #1
    Is it possible to integrate an Php script into an html site . Like on blogger or any other Html platform? Need to put a submission script on my blog. Any Options?
     
    kamran210, Feb 14, 2013 IP
  2. BlueRex

    BlueRex Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    well you have to make that file .php, that way the server will know that theres php in that file and will look for it to execute it, and to insert the script just use <?php ur script goes inside here ?> where u want to put it and you are ready to rock :)
     
    BlueRex, Feb 14, 2013 IP
  3. eldiablo

    eldiablo Active Member

    Messages:
    200
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    80
    #3
    It is possible if it's your own server. You can have file named myfile.html and it will run php code inside of it (don't mix this with rewriting .php file to become .html)...

    So if you add this line to your .htaccess file all .html and .htm files will be executed as .php files and you can have php code within .html file.
     
    eldiablo, Feb 14, 2013 IP
  4. a1technology

    a1technology Greenhorn

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    PHP is an HTML-embedded server-side scripting language. The goal of the language is to allow web developers to write dynamically generated pages quickly. NTC Hosting offers its clients high quality PHP and HTML hosting services. Our servers are configured so as to ensure maximum performance for both your HTML and PHP-based applications and the non-interruptible functioning of your websites.

    When building a complex page, at some point you will be faced with the need to combine PHP and HTML to achieve your needed results. At first point, this can seem complicated, since PHP and HTML are two separate languages, but this is not the case. PHP is designed to interact with HTML and PHP scripts can be included in an HTML page without a problem.

    In an HTML page, PHP code is enclosed within special PHP tags. When a visitor opens the page, the server processes the PHP code and then sends the output to the visitor's browser. Actually it is quite simple to integrate HTML and PHP. A PHP script can be treated as an HTML page, with bits of PHP inserted here and there.

    PHP in HTML using short_open_tag: If you want to shorten your code as much as possible, you can go for the short_tags option. This will save you from typing <?php at the beginning of the code, shortening it to just <?. In order to enable this, you should update the php.ini file and turn the "short_tags" setting from "Off" to "On".

    HTML in PHP using echo: A possible way to integrate HTML tags in a PHP file is via the echo command.however, affect the HTML Code Coloring option in most HTML/PHP editors, which allows for easy understanding of the role of HTML tags. You should escape each double quote within the HTML code with a backslash.
     
    a1technology, Apr 29, 2013 IP
  5. cadsii

    cadsii Well-Known Member

    Messages:
    220
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #5
    blogspot does not allow php on their servers, you can use jquery for your submission instead of php, im pretty sure they allow jquery
     
    cadsii, May 3, 2013 IP
  6. anil verma

    anil verma Member

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #6
    u can create php file in host it some place and after that u have call it from it
    
    <script src="http://yourhost.com/yourfile.php"></script>
    Code (markup):
     
    Last edited by a moderator: May 5, 2013
    anil verma, May 5, 2013 IP
  7. varul

    varul Member

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #7
    You can use php script wherever your using these tags
    <?php
    PHP:
    for php script or code starts from here and the tag
    ?>
    PHP:
    inform the server the php code or script ended up here. The php code may be calling a php file or inline coding. But ensure you are using both the php opening and closing tag to process the HTML by using PHP.
     
    varul, May 8, 2013 IP
  8. awaissadiq99

    awaissadiq99 Member

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #8
    Blogger doesnt support PHP ...and you cant use Php in HTML file
    but you can use HTML In PHP file
     
    awaissadiq99, May 8, 2013 IP