Div tags with PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lawrence.hunt@gmail.com

    Div tags with PHP

    I cant seem to get CSS to work with my PHP code. An example is this:

    <?php if (isset($_GET['addstory'])): // If the user wants to add a
    story
    ?>

    <div id="storyform" >

    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    <label>Type your story here:<br />
    <textarea name="storytext " rows="10" cols="40">
    </textarea></label><br />
    <input type="submit" value="SUBMIT" />
    </form>

    </div>

    <?php elseif (isset($_GET['addcomment'])): // If the user wants to add
    a comment
    ?>

    <div id="commentform ">

    <form action="<?php echo $_SERVER['PHP_SELF'].'?comment='.
    ($_GET['addcomment']); ?>" method="post">
    <label>Type your comment here:<br />
    <textarea name="commentte xt" rows="10" cols="40">
    </textarea></label><br />
    <input type="submit" value="SUBMIT" />
    </form>

    </div>


    The CSS for this is:

    #storyform {
    position: absolute
    top: 200px
    left:300px
    width:724px
    height: 500px

    }

    #commentform {
    position: absolute
    top: 200px
    left:300px
    width:724px
    height: 500px

    }



    Nice and basic but should it not move the forms somewhere in the middle
    of the screen. Currently they are still positioned as if there was no
    styling :S

    I have added other div tags outside of the php i.e. for a navbar
    etc.and they work fine.

    Any help would be much appreciated :D
    Thanks

  • Chuck Anderson

    #2
    Re: Div tags with PHP

    lawrence.hunt@g mail.com wrote:
    I cant seem to get CSS to work with my PHP code. An example is this:
    >
    <?php if (isset($_GET['addstory'])): // If the user wants to add a
    story
    ?>
    >
    <div id="storyform" >
    >
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    <label>Type your story here:<br />
    <textarea name="storytext " rows="10" cols="40">
    </textarea></label><br />
    <input type="submit" value="SUBMIT" />
    </form>
    >
    </div>
    >
    <?php elseif (isset($_GET['addcomment'])): // If the user wants to add
    a comment
    ?>
    >
    <div id="commentform ">
    >
    <form action="<?php echo $_SERVER['PHP_SELF'].'?comment='.
    ($_GET['addcomment']); ?>" method="post">
    <label>Type your comment here:<br />
    <textarea name="commentte xt" rows="10" cols="40">
    </textarea></label><br />
    <input type="submit" value="SUBMIT" />
    </form>
    >
    </div>
    >
    >
    The CSS for this is:
    >
    #storyform {
    position: absolute
    top: 200px
    left:300px
    width:724px
    height: 500px
    >
    }
    >
    #commentform {
    position: absolute
    top: 200px
    left:300px
    width:724px
    height: 500px
    >
    }
    >
    >
    >
    Nice and basic but should it not move the forms somewhere in the middle
    of the screen. Currently they are still positioned as if there was no
    styling :S
    >
    I have added other div tags outside of the php i.e. for a navbar
    etc.and they work fine.
    >
    Any help would be much appreciated :D
    Thanks
    >
    >
    This has nothing to do with using Php, you simply need semi-colons after
    each style element.

    i.e., ...

    #storyform {
    position: absolute;
    top: 200px;
    left:300px;
    width:724px;
    height: 500px;
    }

    #commentform {
    position: absolute;
    top: 200px;
    left:300px;
    width:724px;
    height: 500px;
    }



    --
    *************** **************
    Chuck Anderson • Boulder, CO

    Everyone's journey should be different,
    so that we all are enriched
    in new and endless ways
    *************** **************

    Comment

    • lawrence.hunt@gmail.com

      #3
      Re: Div tags with PHP

      Oh woops, one of my more stupid moments!
      Chuck Anderson wrote:
      lawrence.hunt@g mail.com wrote:
      I cant seem to get CSS to work with my PHP code. An example is this:

      <?php if (isset($_GET['addstory'])): // If the user wants to add a
      story
      ?>

      <div id="storyform" >

      <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
      <label>Type your story here:<br />
      <textarea name="storytext " rows="10" cols="40">
      </textarea></label><br />
      <input type="submit" value="SUBMIT" />
      </form>

      </div>

      <?php elseif (isset($_GET['addcomment'])): // If the user wants to add
      a comment
      ?>

      <div id="commentform ">

      <form action="<?php echo $_SERVER['PHP_SELF'].'?comment='.
      ($_GET['addcomment']); ?>" method="post">
      <label>Type your comment here:<br />
      <textarea name="commentte xt" rows="10" cols="40">
      </textarea></label><br />
      <input type="submit" value="SUBMIT" />
      </form>

      </div>


      The CSS for this is:

      #storyform {
      position: absolute
      top: 200px
      left:300px
      width:724px
      height: 500px

      }

      #commentform {
      position: absolute
      top: 200px
      left:300px
      width:724px
      height: 500px

      }



      Nice and basic but should it not move the forms somewhere in the middle
      of the screen. Currently they are still positioned as if there was no
      styling :S

      I have added other div tags outside of the php i.e. for a navbar
      etc.and they work fine.

      Any help would be much appreciated :D
      Thanks
      This has nothing to do with using Php, you simply need semi-colons after
      each style element.
      >
      i.e., ...
      >
      #storyform {
      position: absolute;
      top: 200px;
      left:300px;
      width:724px;
      height: 500px;
      }
      >
      #commentform {
      position: absolute;
      top: 200px;
      left:300px;
      width:724px;
      height: 500px;
      }
      >
      >
      >
      --
      *************** **************
      Chuck Anderson · Boulder, CO

      Everyone's journey should be different,
      so that we all are enriched
      in new and endless ways
      *************** **************

      Comment

      • amadou.balde@gmail.com

        #4
        Re: Div tags with PHP

        Sometimes you just need to take a break after many hours of work. The
        more hours you spend the more stupid mistakes you make.
        It happens to me all the time.

        -----------
        Executable Design


        lawrence.hunt@g mail.com wrote:
        Oh woops, one of my more stupid moments!
        Chuck Anderson wrote:
        lawrence.hunt@g mail.com wrote:
        I cant seem to get CSS to work with my PHP code. An example is this:
        >
        <?php if (isset($_GET['addstory'])): // If the user wants to add a
        story
        ?>
        >
        <div id="storyform" >
        >
        <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
        <label>Type your story here:<br />
        <textarea name="storytext " rows="10" cols="40">
        </textarea></label><br />
        <input type="submit" value="SUBMIT" />
        </form>
        >
        </div>
        >
        <?php elseif (isset($_GET['addcomment'])): // If the user wants to add
        a comment
        ?>
        >
        <div id="commentform ">
        >
        <form action="<?php echo $_SERVER['PHP_SELF'].'?comment='.
        ($_GET['addcomment']); ?>" method="post">
        <label>Type your comment here:<br />
        <textarea name="commentte xt" rows="10" cols="40">
        </textarea></label><br />
        <input type="submit" value="SUBMIT" />
        </form>
        >
        </div>
        >
        >
        The CSS for this is:
        >
        #storyform {
        position: absolute
        top: 200px
        left:300px
        width:724px
        height: 500px
        >
        }
        >
        #commentform {
        position: absolute
        top: 200px
        left:300px
        width:724px
        height: 500px
        >
        }
        >
        >
        >
        Nice and basic but should it not move the forms somewhere in the middle
        of the screen. Currently they are still positioned as if there was no
        styling :S
        >
        I have added other div tags outside of the php i.e. for a navbar
        etc.and they work fine.
        >
        Any help would be much appreciated :D
        Thanks
        >
        >
        This has nothing to do with using Php, you simply need semi-colons after
        each style element.

        i.e., ...

        #storyform {
        position: absolute;
        top: 200px;
        left:300px;
        width:724px;
        height: 500px;
        }

        #commentform {
        position: absolute;
        top: 200px;
        left:300px;
        width:724px;
        height: 500px;
        }



        --
        *************** **************
        Chuck Anderson · Boulder, CO

        Everyone's journey should be different,
        so that we all are enriched
        in new and endless ways
        *************** **************

        Comment

        Working...