473,399 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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="commenttext" 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

Aug 19 '06 #1
3 2193
la***********@gmail.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="commenttext" 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
http://www.CycleTourist.com
Everyone's journey should be different,
so that we all are enriched
in new and endless ways
*****************************
Aug 19 '06 #2
Oh woops, one of my more stupid moments!
Chuck Anderson wrote:
la***********@gmail.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="commenttext" 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
http://www.CycleTourist.com
Everyone's journey should be different,
so that we all are enriched
in new and endless ways
*****************************
Aug 20 '06 #3
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
http://www.exedesign.com

la***********@gmail.com wrote:
Oh woops, one of my more stupid moments!
Chuck Anderson wrote:
la***********@gmail.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="commenttext" 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
http://www.CycleTourist.com
Everyone's journey should be different,
so that we all are enriched
in new and endless ways
*****************************
Aug 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: varois83 | last post by:
Hi I am fairly new to PHP/mysql and was reading an online tutorial and learned that my short tags weren't enabled. At this time I have no need for them, my setup apache/mysql/php runs on my PC...
0
by: Philippe Poulard | last post by:
People that have a knowledge of XQuery, XSLT, Ant, JSP/PHP/ASP, Cocoon, XMLBeans, taglibs and many others should recognize any of them in "Active Tags". " Active Tags is a set of specifications...
24
by: Day Bird Loft | last post by:
Web Authoring | Meta-Tags The first thing to understand in regard to Meta Tags is the three most important tags placed in the head of your html documents. They are the title, description, and...
7
by: Jasper Bryant-Greene | last post by:
I have three tables: `photos`, `tags` and `tags_photos`. The `photos` table contains a unique ID and a bunch of other stuff, the `tags` table contains a unique ID and a tag name, and the...
1
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not...
12
by: Oberon | last post by:
I have a large HTML document. It has hundreds of <span>s which have no attributes so these <span>s are redundant. How can I remove these tags automatically? The document also has <span>s with...
12
by: Stefan Weiss | last post by:
Hi. (this is somewhat similar to yesterday's thread about empty links) I noticed that Tidy issues warnings whenever it encounters empty tags, and strips those tags if cleanup was requested....
23
by: Big Bill | last post by:
http://www.promcars.co.uk/pages/bonnie.php I don't believe they should be there, can I take them out without stopping the includes from functioning? I'm the (hapless) optimiser on this one... I...
3
by: Paul Moore | last post by:
I'd like to write some scripts to analyze and manipulate my music files. The files themselves are in MP3 and FLAC format (mostly MP3, but FLAC where I ripped original CDs and wanted a lossless...
1
by: arrival123 | last post by:
Hello, I'm currently trying to decide on a database design for tags in my web 2.0 application. The problem I'm facing is that I have 3 separate tables i.e. cars, planes, and schools. All three...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.