Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: PHP template

  1. #1
    New Coder
    Join Date
    Oct 2009
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts

    PHP template

    NVM- finally got it working... the only problem I'm having is:

    The file being called and displayed is displaying with extra space where the <br> tag is used. There's about 5 pixels of new space added where normally they'd be flush against eachother... what is going on?
    Last edited by ilovetechno; 10-21-2009 at 10:04 PM.

  • #2
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    you need a server capable of running PHP

    If you have online hosting it's likely it already supports php

    If you don't, google for Xampp and apache friends, it's an all in one PHP/MySQL/Apache package that lets you develop offline, as it were.

    To see if your server supports php

    PHP Code:
    <?php echo 'If I can read this, my server supports PHP'?>
    put that in a file, save it as page.php, and load it in your browser. You'll need to upload it to your host first of course.

    If you can read the text, your server supports php

    if it doesn't you need to get a php enabled server, or research in to alternatives like xampp

  • #3
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    php has to be installed on a server for it to work. if you are trying to run from your computer. google "wamp server" and download it. once installed, post here and will help on the next steps.
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #4
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    Quote Originally Posted by met View Post
    you need a server capable of running PHP

    PHP Code:
    <?php echo 'If I can read this, my server supports PHP'?>
    Its a bit misleading as you will be able to see "it".
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #5
    New Coder
    Join Date
    Oct 2009
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    I'm working on a site hosted by ICDSOFT.. do i have to install anything on there? Its not the webhost I prefer/know best so I really don't know my way around it very well or know how to begin using PHP on it

  • #6
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    Quote Originally Posted by Phil Jackson View Post
    Its a bit misleading as you will be able to see "it".
    true dat

    so

    put this in a php file

    PHP Code:
    <?php phpinfo(); ?>
    if php is installed on your server you will see a tonne of information.

  • #7
    New Coder
    Join Date
    Oct 2009
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Ok that works and I see the info on the page, so I'm not sure where I'm going wrong

  • #8
    New Coder
    Join Date
    Oct 2009
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    I'm going to post the codes I'm trying and maybe someone can see where I'm going wrong...

    header.php
    PHP Code:
    <head>
    <
    link rel="stylesheet" type="text/css" media="all" href="main.css" />
    </
    head>
    <
    body>
    <
    center>
    <
    a href="www.cas...s.com"><img src="images/ctempbann.jpg" border=0></a><br>
    <
    img src="images/intim.jpg" border=0><br>
    <
    table width=800 border=0  bgcolor=#000000>
    <td width="100%" bgcolor="#000000" height="28" align="center">
    ...
    Lengthy menu goes here..
    </
    td></tr></table>
    </
    body
    template.htm
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link rel="stylesheet" type="text/css" media="all" href="main.css" />
    <style type="text/css">
    body {background-color: #ff99cc;}
    A:link {text-decoration: none}
    A:visited {text-decoration: none}
    A:active {text-decoration: none}
    A:hover {text-decoration: none}
    </style>
    </script>
    </head>
    <body>
    <center>
    <?php include 'header.php'; ?>
    <br>
    <table width=800 border=0 bordercolor=ffffff bgcolor=#ffffff cellpadding="0" cellspacing="0">
    <tr><td id="tdimage" width=169 valign="top">
    <br><br><br><br><br><br><br><br><br><br><br><center><a href="sizechart.htm"><font class="heading">SIZE CHART</a></td><td></td>
    <td valign="top"><br><br><b class="heading"><center>PRODUCT NAME HERE</b>
    <br><br><br><br><br><br>
    </td></tr></table>
    </body>
    </html>
    and nothing shows up

  • #9
    New Coder
    Join Date
    Oct 2009
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    When I change the page I'm trying to file-call to to .php, there are 3 error notes that say
    Warning: include() [function.include]: URL file-access is disabled in the server configuration in hmm.php on line 16

    Warning: include(http://www.spmstudio.com/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in hmm.php on line 16

    Warning: include() [function.include]: Failed opening 'header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in hmm.php on line 16


    MEH Im going to rip my hair out! I've been googling and googling for DAYS and I for the life of me cannot find anything to explain to me how exactly I fix this. Or change the settings, because I do not see a single place on my hosting site filemanager or main page or anything to be able to configure php settings

  • #10
    New Coder
    Join Date
    Oct 2009
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    OK so I made a php.ini file just adding the "allow_url_fopen = On" part to it and that finally made it work, but there are big spaces displayed whenever there is a <br> in that file, how do I stop that?

  • #11
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    PHP Code:
    <?php include 'header.php'?> // <?php include("header.php"); ?>
    i dont know about the spaces.
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #12
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by ilovetechno View Post
    MEH Im going to rip my hair out!
    Greetings,

    ilovetechno, if you are working on an account at ICDSoft, you can simply contact our support on these matters - either at our support site, or by email. Our support staff respond to all support tickets within several minutes and to all emails usually within 10-15 minutes. I am sure they can help you .

    I see you got some of your issues straightened out.
    About the php.ini file: If you entered only "allow_url_fopen = On", you might have other things not working. You can check the FAQ at suresupport.com on modifying php.ini files, or simply contact support for assistance.

    As per the multiple spaces - in the code of your template.htm there are multiple <br>s (<br><br><br><br><br><br><br><br><br>). Is it possible that you are seeing these multiple <br>s? Again, you can count on our support to help you on the matter.

    Best to all!
    Zafir Slavov,
    ICDSoft Team

  • Users who have thanked icdsoft for this post:

    ilovetechno (10-21-2009)

  • #13
    New Coder
    Join Date
    Oct 2009
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by icdsoft View Post
    Greetings,

    I see you got some of your issues straightened out.
    About the php.ini file: If you entered only "allow_url_fopen = On", you might have other things not working. You can check the FAQ at suresupport.com on modifying php.ini files, or simply contact support for assistance.

    As per the multiple spaces - in the code of your template.htm there are multiple <br>s (<br><br><br><br><br><br><br><br><br>). Is it possible that you are seeing these multiple <br>s? Again, you can count on our support to help you on the matter.

    Best to all!
    Zafir Slavov,
    ICDSoft Team
    When you say I might have other problems after using that allow code, do you mean other php problems or other general problems? Because currently the only thing I wanted to use the php for is the include function so that I can template the header.

    No, the other break tags are just for spacing in the body content, not the header that I'm including.

    Anyways, I had a feeling it was the Mozilla platform and I just looked at it on Internet Explorer and the extra spaces are not there, so I guess its just the little differences in how the different platforms read code differently.

    Thanks for the help! If I have anymore questions I'll direct them to the support team

  • #14
    New Coder
    Join Date
    Oct 2009
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Finally figured it out... was using the wrong Doctype. Switched to transitional and now no extra spaces!! Now if only I could just figure out why I can't get divs to work...!

  • #15
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by ilovetechno View Post
    When you say I might have other problems after using that allow code, do you mean other php problems or other general problems? Because currently the only thing I wanted to use the php for is the include function so that I can template the header.
    I am sorry for answering a bit late. When you create a php.ini file in a certain folder, the global php.ini file on the server is overridden. Thus, all PHP settings for this folder are reset to the values of a default PHP installation (besides the one you set in your php.ini file). The PHP settings on our servers differ from the default PHP installation - for example, some values such as max_execution_time and memory_limit are higher on our servers, than in the default PHP installation.
    If you are using simple includes and you do not have any complex scripts - most probably there will be no difference for you.

    Good to hear that you solved the extra spaces problem.

    Best,
    Zafir Slavov,
    ICDSoft Team


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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