My php form fields are not working properly ...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pepe_lepew1962
Forum Commoner
Posts: 44
Joined: Thu Nov 20, 2008 10:29 am

My php form fields are not working properly ...

Post by pepe_lepew1962 »

Hello:

I am about as green as it gets with php and I am having huge problems with my form. I have links for clearity. The problem is with my mainform. First, the field titles are centered, which is not a real problem as I can get them left aligned. The main problem is the actual fields. First they are centered and second the size is not displayed properly. For some very strange reason, if I uncomment line 29 and echo a dot, everything falls into place. I have included buttons for the source code. Problem page http://www.pepelepew.netne.net/mainform.php and here is the uncommented page http://www.pepelepew.netne.net/mainformwith.php I would appreciate any assistance regarding this problem.

Confused.
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: My php form fields are not working properly ...

Post by klevis miho »

Try to use CSS for styling your form. Or paste the code here.
pepe_lepew1962
Forum Commoner
Posts: 44
Joined: Thu Nov 20, 2008 10:29 am

Re: My php form fields are not working properly ...

Post by pepe_lepew1962 »

<?php
//
################################################################################################################
## ##
## Name: mainform.php ##
## Called From: homehome.php ##
## Version: 1.00.000 ##
## History: Original ##
## Purpose: This is a test page for processing. The person clicks a color and then it should be ##
## evaluated with the required file. The required file will load another page that ##
## displays the color choosen from this file. ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
## ##
################################################################################################################
//
//
//
// Start the Session !!!
//
session_start();
//
//
//echo ".";
//
// Check if the submit is set.
//
if(isset($_POST[submit]))
{
//
//
//
// Assign the error Color variable to blank.
//
$errtesttest1101 = "";
//
//
//
// This includes code from the following files.
//
require("formtest.php");
//
//
// End of the isset.
}
//
//
?>
<!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" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Color Template Page</title>

<link rel="stylesheet" type="text/css" href="lrimages/stylecss.css" />

</head>

<body background="lrimages/backgrnd.jpg">
<div align="center">
<table border="1" id="table001" bordercolor="#00FF00">
<tr>
<td width="4">&nbsp;</td>
<td width="950">
<img border="0" src="lrimages/backmenu.png" width="950" height="70"></td>
<td width="4">&nbsp;</td>
</tr>
<tr>
<td width="4">&nbsp;</td>
<td width="950" height="35">
<div class="pro_linedrop" style="width: 950; height: 35; align=center">
<ul class="select">
<li><a href="http://www.yahoo.com"><b>Left 01</b></a></li>
<li><a href="http://www.yahoo.com"><b>Left 01</b></a></li>
<li><a href="http://www.yahoo.com"><b>Left 01</b></a></li>
<li><a href="http://www.yahoo.com"><b>Left 01</b></a></li>
<li><a href="http://www.yahoo.com"><b>Left 01</b></a></li>
<li class="lrt"><a href="http://www.yahoo.com"><b>Rite 01</b></a></li>
<li class="lrt"><a href="http://www.yahoo.com"><b>Rite 01</b></a></li>
<li class="lrt"><a href="http://www.yahoo.com"><b>Rite 01</b></a></li>
</ul>
</div>
</td>
<td width="4">&nbsp;</td>
</tr>
<tr>
<td width="4">&nbsp;</td>
<td width="950">
<table border="1" width="100%" bordercolor="#FF0000" id="table002">
<tr>
<td>
<form method="post" action="mainform.php">
<table border="1" width="100%" bordercolor="#FFFF00" id="table003">
<tr>
<td>&nbsp;</td>
<td align="left">
<table border="1" width="100%" bordercolor="#0000FF" id="table004">
<tr>
<td align="left"><font color="#00ff00">
This is a test remark. Note One.</br></br></font>
<align="left"><font color="#00FF00">
This is also a test remark. Note Two.</font></td>
</tr>
</table>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="4">&nbsp;</td>
<td>&nbsp;</td>
<td width="4">&nbsp;</td>
</tr>
<tr>
<td width="4">&nbsp;</td>
<td>
<table border="1" width="100%" bordercolor="#0000FF" id="table100">
<tr>
<td width="124"><b><font size="2" face="Arial" color="#00FF00">&nbsp; First Name:</font></b></td>
<td width="278"><b><font size="2" face="Arial" color="#FF0000">&nbsp;</font></b>
<input name="fldjoin1101" style="Width: 180; height:22" maxLength="15" size="2" value="<?php echo $_POST[fldjoin1101]; ?>" ></td>
<td width="22">&nbsp;</td>
<td><b><font size="2" face="Arial" color="#FF0000">&nbsp;<?php if(isset($errjoin1101)) echo $errjoin1101; ?></font></b></td>
</tr>
<tr>
<td width="124"><b><font size="2" face="Arial" color="#00FF00">&nbsp; Middle Name:</font></b></td>
<td width="278"><b><font size="2" face="Arial" color="#FF0000">&nbsp;</font></b>
<input name="fldjoin1102" style="Width: 180; height:22" maxLength="15" size="2" value="<?php echo $_POST[fldjoin1102]; ?>" ></td>
<td width="22">&nbsp;</td>
<td><b><font size="2" face="Arial" color="#FF0000">&nbsp;<?php if(isset($errjoin1102)) echo $errjoin1102; ?></font></b></td>
</tr>
<tr>
<td width="124"><b><font size="2" face="Arial" color="#00FF00">&nbsp; Last Name:</font></b></td>
<td width="278"><b><font size="2" face="Arial" color="#FF0000">&nbsp;</font></b>
<input name="fldjoin1103" style="Width: 230; height:22" maxLength="25" size="2" value="<?php echo $_POST[fldjoin1103]; ?>" ></td>
<td width="22">&nbsp;</td>
<td><b><font size="2" face="Arial" color="#FF0000">&nbsp;<?php if(isset($errjoin1103)) echo $errjoin1103; ?></font></b></td>
</tr>
</table>
</td>
<td width="4">&nbsp;</td>
</tr>
<tr>
<td width="4">&nbsp;</td>
<td>&nbsp;</td>
<td width="4">&nbsp;</td>
</tr>
<tr>
<td width="4">&nbsp;</td>
<td>&nbsp;<font color="#FF0000"><input type="submit" name="submit" value="Press this Button to Proceed"></td></font></td>
<td width="4">&nbsp;</td>
</tr>
<tr>
<td width="4">&nbsp;</td>
<td>&nbsp;</td>
<td width="4">&nbsp;</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
<td width="4">&nbsp;</td>
</tr>
<tr>
<td width="4">&nbsp;</td>
<td width="950">&nbsp;</td>
<td width="4">&nbsp;</td>
</tr>
<form method="post" action="sender01.php">
<tr>
<td width="4">&nbsp;</td>
<td><p align="center">&nbsp;<font color="#FF0000"><input type="submit" name="01" value="Text file of mainform.php"></td></font></td>
<td width="4">&nbsp;</td>
</tr>
</form>
<form method="post" action="sender02.php">
<tr>
<td width="4">&nbsp;</td>
<td><p align="center">&nbsp;<font color="#FF0000"><input type="submit" name="02" value="Text file of formtest.php"></td></font></td>
<td width="4">&nbsp;</td>
</tr>
</form>
<form method="post" action="sender03.php">
<tr>
<td width="4">&nbsp;</td>
<td><p align="center">&nbsp;<font color="#FF0000"><input type="submit" name="03" value="Text file of stylecss.css"></td></font></td>
<td width="4">&nbsp;</td>
</tr>
</form>
<tr>
<td width="4">&nbsp;</td>
<td width="950">&nbsp;</td>
<td width="4">&nbsp;</td>
</tr>
<form method="post" action="sender11.php">
<tr>
<td width="4">&nbsp;</td>
<td><p align="center">&nbsp;<font color="#FF0000"><input type="submit" name="11" value="Text file of testpass.php"></td></font></td>
<td width="4">&nbsp;</td>
</tr>
</form>
<form method="post" action="sender12.php">
<tr>
<td width="4">&nbsp;</td>
<td><p align="center">&nbsp;<font color="#FF0000"><input type="submit" name="12" value="Text file of testfail.php"></td></font></td>
<td width="4">&nbsp;</td>
</tr>
</form>
<tr>
<td width="4">&nbsp;</td>
<td width="950">&nbsp;</td>
<td width="4">&nbsp;</td>
</tr>
</table>
</div>
</body>
</html>
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: My php form fields are not working properly ...

Post by klevis miho »

Try to style it with CSS man, it's definetly worth it.
pepe_lepew1962
Forum Commoner
Posts: 44
Joined: Thu Nov 20, 2008 10:29 am

Re: My php form fields are not working properly ...

Post by pepe_lepew1962 »

I would but not sure how. Do you have 1 example I could work off?
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: My php form fields are not working properly ...

Post by Jonah Bron »

Post Reply