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.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Jan 2010
    Posts
    153
    Thanks
    53
    Thanked 0 Times in 0 Posts

    php not working in divs?

    Hello, I'm not sure if I should be posting this here, but I have this round-corner box css that works fine with text and html, but doesn't seem to work with php tags.

    This code works:
    PHP Code:
    <div>
                  <
    class="spiffy">
                  <
    class="spiffy1"><b></b></b>
                  <
    class="spiffy2"><b></b></b>
                  <
    class="spiffy3"></b>
                  <
    class="spiffy4"></b>
                  <
    class="spiffy5"></b></b>

                  <
    div class="spiffyfg">
                
    Texttexttext...
                  </
    div>

                  <
    class="spiffy">
                  <
    class="spiffy5"></b>
                  <
    class="spiffy4"></b>
                  <
    class="spiffy3"></b>
                  <
    class="spiffy2"><b></b></b>
                  <
    class="spiffy1"><b></b></b></b>
                </
    div
    But not this (the box is broken, and the content of the php include show up under the box):
    PHP Code:
    <div>
                  <b class="spiffy">
                  <b class="spiffy1"><b></b></b>
                  <b class="spiffy2"><b></b></b>
                  <b class="spiffy3"></b>
                  <b class="spiffy4"></b>
                  <b class="spiffy5"></b></b>

                  <div class="spiffyfg">
                <?php include('leftheader.php'); ?>
                  </div>

                  <b class="spiffy">
                  <b class="spiffy5"></b>
                  <b class="spiffy4"></b>
                  <b class="spiffy3"></b>
                  <b class="spiffy2"><b></b></b>
                  <b class="spiffy1"><b></b></b></b>
                </div>

    Thank you

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    leftheader.php is in the same directory? It reads fine on its own?

  • #3
    Regular Coder
    Join Date
    Jul 2010
    Posts
    149
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Check leftheader.php file code

    Please remove all content in leftheader.php for temporary and something eho "hi"; and check it its display on front end.

    Because may be some error in your leftheader.php file.

  • #4
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    PHP Code:
    <?php if ( file_exists'leftheader.php' ) ) { include('leftheader.php'); }else{ echo 'directory is incorrect'; } ?>
    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
    Regular Coder
    Join Date
    Jan 2010
    Posts
    153
    Thanks
    53
    Thanked 0 Times in 0 Posts
    I only added a text line in leftheader.php, but it still doesn't work. I replaced
    PHP Code:
    <?php include('leftheader.php'); ?>
    with
    PHP Code:
    <?php echo "hi"?>
    , but that did not work either.

  • #6
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    If you go to leftheader.php, it shows up ok? And leftheader.php is in the same directory as this file (same questions as above).

    EDIT: Noticed your last post (forgot to refresh, had opened the page before i left the house). If its not showing up, its means your PHP isn't working. It is a .php extension, right? PHP server's working ok?

  • #7
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,922
    Thanks
    15
    Thanked 229 Times in 229 Posts
    When in doubt check permissions. I don't know how many times I had a problem like that only to find it was permissions.

  • #8
    Regular Coder
    Join Date
    Jan 2010
    Posts
    153
    Thanks
    53
    Thanked 0 Times in 0 Posts
    Sorry guys, I think you misunderstood, I wasn't clear enough. The problem was that there was a div in the leftheader.php page messing things up. But I fixed it and now it works

    Thanks a lot for your help


  •  

    Posting Permissions

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