Embedding php

Hey guys,

Im new on this forum and I have a php beginner question.

For the ease of styling and functionality I would like to embed php functions into a .htm or xml file.
I’ve seen something like {FUNCTION} before but I have no clue how this is done, I hope someone can point me in the right direction.

Kind Regards

not quite sure i get your meaning?
do you know how to write a function or are you looking for a function to do a specific task?

if you only want to learn how to write a function here’s a demo that will say ‘Hello World!’

<?php // create the function function greeting() { echo 'Hello World!'; } // call the function greeting(); [/php] will output [php]Hello World![/php] if this is not what your after, my apologies :-[ could you please post again with a little bit more info, i'll see what i can do ;)

Hehe, I most definatly know how to set a variable and echo it out, thats not the problem.
I was browsing through a pre-made website template just to learn some more, and in the .HTML files I saw embedded Php, my question is how this is done, the Xml tag looked like this for example:


  • [/php]

    Kind Regards, hope this gives some more insight in my question, and I do hope to find the answer since I have browsed through several website to find something more about this. I looked for embedding php in Xml etc, Im not even sure if im in the right direction.

    BUMP :o

    I still hope someone can give me more insight about this…

    Kind Regards,

    Hi mate, thought i’d give someone else a chance to jump in and explain but it seems there’s no takers…

    I’m not sure really, but looking at the code, in my opinion they are one of two things:

    [ul][li]constants: which will call a function/variable to do something (in this case a hyperlink and some text)[/li]
    [li]placeholders: when the script is run it will replace the string with something (in this case a hyperlink and some text)[/li][/ul]

    this is just my ‘educated’ guess, i may be wrong, i’m not sure, maybe an expert can step in and clear it up for you (and me :D)

    Ok… hehe
    Well I know some of PHP but not this advanced… so I allready showed the HTML here is the PHP connected to it…
    I still hope to learn how to use it since it seems really usefull in certain situations for example if you don’t want to rename all your .HTML files but still feel like using PHP

    if (isset($pm))
    if ($pm->check(PLUGIN_INSTALLED, ‘raidplan’))
    ‘IS_RP_INSTALLED’ => true,
    ‘IS_RP_URL’ => $this->root_path . ‘plugins/raidplan/listraids.php’,
    ‘RP_LINK_NAME’ => $user->lang[‘rp_link_name’]



    Please note that this is not coded by me…

    i see this a lot in PHPBB forums, from my understanding its a condition referring to a constant, within templates.
    when the user logs in, the site checks to see if they are allowed to see that plugin, and displays accordingly.
    If its from the install directory prior to installing the plugin, it could be just to check if the plugin is installed on the board.

    I could be completely wrong, but thats what i gather they are for.
    play WoW?


    I thought it was a XML parser, still didn’t figure this one out, but hey allready learning more then enough each day…

    Yes I play Wow :slight_smile:

    Sponsor our Newsletter | Privacy Policy | Terms of Service