LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-27-2008, 09:29 PM   #1
shmuck
LQ Newbie
 
Registered: Nov 2005
Posts: 11

Rep: Reputation: 0
HTML Forms and fieldset


Hey guys just looking for a bit of help here.

I'm to combine a few fieldsets and tables together. I'm using PHP as my coding. I really like how the page is looking, except I can't get anything from the form. So is it possible to combine fieldsets with regular form fields? This is the only thing I can come up with. Here's a bit of my code as an example.

Code:
                
<form method="POST" name="input" action="checkout.php">
    <fieldset>
    <legend>General Information</legend>
    <table><tr><td width="150">First Name:</td><td><input type="text" size="20" name="fname" value="<?php echo $fname; ?>" maxlength="15" /></td></tr>
    <tr><td>Last Name:</td><td><input type="text" size="20" name="lname" maxlength="15" /></td></tr>
    <tr><td>Telephone:</td><td><input type="text" size="20" name="phone" maxlength="10" />&nbsp;&nbsp;</td><td>Example: 4161234567</td></tr>
    <tr><td>E-mail Address:</td><td><input type="text" size="20" name="email" maxlength="25" /></td></tr>
    <tr><td><input type="submit" name="submit" value="Continue"></input>
    </table>
    </fieldset>
</form>

<?php

$fname = $_POST['fname'];
echo $fname;

?>
If I echo anything else under "echo $fname" it does work, so the code isn't hanging up anywhere. Did I just make a stupid mistake somewhere and I missed it?

Eventually I want to have it so I can display what they entered into the form with using the "value" tag, but I'll be happy enough with it just getting something from my form at the moment.

Thanks for the help guys.
 
Old 02-27-2008, 10:30 PM   #2
shmuck
LQ Newbie
 
Registered: Nov 2005
Posts: 11

Original Poster
Rep: Reputation: 0
And I'm a loser. I typed it in here the right way, but in my actual code I used $POST_['fname'] instead of $_POST['fname'].

Oops.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Html Forms and PHP LXer Syndicated Linux News 0 01-09-2007 01:33 AM
MySQL results to html forms using PHP xemous Programming 3 08-15-2005 03:27 PM
Forms in HTML J_K9 Programming 5 06-30-2005 02:21 PM
HTML Forms belorion Programming 1 02-01-2005 11:41 PM
Breaking up html forms logicdisaster Programming 4 06-18-2004 12:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration