Easy PHP Question

Discussion in 'PHP' started by gray929, Jul 27, 2008.

  1. #1
    Problem solved.


    So, if you look at my blog you will see I added an advertise button in the top bar.

    I want to use the aboutus.php/aboutus.tpl page I have for the about us page for the advertise page.

    How can I go about that?

    I copied both the aboutus.php and aboutus.tpl and tried renaming them to advertise.php/advertise/tpl (no idea what I'm doing) so that when I went into the top bar this would work:

     <a class="btn-nav" href="{$smarty.const.DOC_ROOT}/advertise.php">{l}ADVERTISE{/l}</a>
    PHP:
    Please tell me what I am doing wrong. Feel free to make fun of me. =( Thanks!
     
    gray929, Jul 27, 2008 IP
  2. Submerged

    Submerged Active Member

    Messages:
    132
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #2
    I'm a little confused by the two separate pages - what is a ".tpl" page? If this is something called in the aboutus.php page, like a javascript include?
     
    Submerged, Jul 27, 2008 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #3
    .tpl is the default file extension for Smarty files. (Smarty template engine).


    I'm not really sure what your actual problem is, though? I'm guessing it's displaying the wrong template? If so, scroll to the bottom of advertise.php, and make sure it's using the correct file name in a line similar to this:
    
    $smarty->display('advertise.tpl');
    
    PHP:
     
    nico_swd, Jul 27, 2008 IP
  4. gray929

    gray929 Banned

    Messages:
    278
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I phrased that wrong. I copied the aboutus.php template since that is the exact way I want my advertising page to look. But, I can't rename the copy advertise.php.

    I guess it would be easier for me to just upload the php file again. How do I upload php files? Thanks.
     
    gray929, Jul 27, 2008 IP