center text in PHP form?
- theshangsta
- Newbie


- Joined: Aug 28, 2009
- Posts: 6
- Status: Offline
This will probably be regarded as a very n00bish question....
I have a service order form on my website that I am using a PHP mail script to submit...The primitive problem I am having is:
In the <form> section, I cannot get a single line of plain english text to center throughout the whole form, it justifies to the left almost as if it's got a column dividing the field name and the user input......
here's the code:
and then a series of questions follow which use radio buttons, and a couple more text fields, then a submit button.
I want the text that says "Some repairs require an initial diagnostic visit. What would you like us to do?" to be written as one line under everything it follows. I have tried center, align, div style....I just feel like the Geico caveman today, drawing blanks left and right. please help ~thanks
ps- I'm not terribly experienced in php but know a thing or two....in the spirit of saving time and getting things out of the way....this will be my next question:
How do I include the radio button selections in the submission? Do I simply write them into my php script and name them?
thanks
I have a service order form on my website that I am using a PHP mail script to submit...The primitive problem I am having is:
In the <form> section, I cannot get a single line of plain english text to center throughout the whole form, it justifies to the left almost as if it's got a column dividing the field name and the user input......
here's the code:
HTML Code: [ Select ]
<CENTER><B><U>Service Call Authorization</B></U></CENTER><br>
<td align=left>Name:</td>
<td width="15"> </td>
<td><input size=35 maxlength=35 type=text name=name
style="font-family: Courier New; font-size: 10pt"></td></tr>
<tr>
<td align=left>Service Location:(street address)</td>
<td width="40"> </td>
<td><input size=35 maxlength=35 type=text name=location
style="font-family: Courier New; font-size: 10pt"></td></tr>
<tr>
<td align=left>City & State:</td>
<td> </td>
<td><input size=30 maxlength=30 type=text name=city
style="font-family: Courier New; font-size: 10pt"></td></tr>
<tr><div><td>Some repairs require an initial diagnostic visit. What would you like us to do?</div></td></tr>
<td align=left>Name:</td>
<td width="15"> </td>
<td><input size=35 maxlength=35 type=text name=name
style="font-family: Courier New; font-size: 10pt"></td></tr>
<tr>
<td align=left>Service Location:(street address)</td>
<td width="40"> </td>
<td><input size=35 maxlength=35 type=text name=location
style="font-family: Courier New; font-size: 10pt"></td></tr>
<tr>
<td align=left>City & State:</td>
<td> </td>
<td><input size=30 maxlength=30 type=text name=city
style="font-family: Courier New; font-size: 10pt"></td></tr>
<tr><div><td>Some repairs require an initial diagnostic visit. What would you like us to do?</div></td></tr>
- <CENTER><B><U>Service Call Authorization</B></U></CENTER><br>
- <td align=left>Name:</td>
- <td width="15"> </td>
- <td><input size=35 maxlength=35 type=text name=name
- style="font-family: Courier New; font-size: 10pt"></td></tr>
- <tr>
- <td align=left>Service Location:(street address)</td>
- <td width="40"> </td>
- <td><input size=35 maxlength=35 type=text name=location
- style="font-family: Courier New; font-size: 10pt"></td></tr>
- <tr>
- <td align=left>City & State:</td>
- <td> </td>
- <td><input size=30 maxlength=30 type=text name=city
- style="font-family: Courier New; font-size: 10pt"></td></tr>
- <tr><div><td>Some repairs require an initial diagnostic visit. What would you like us to do?</div></td></tr>
and then a series of questions follow which use radio buttons, and a couple more text fields, then a submit button.
I want the text that says "Some repairs require an initial diagnostic visit. What would you like us to do?" to be written as one line under everything it follows. I have tried center, align, div style....I just feel like the Geico caveman today, drawing blanks left and right. please help ~thanks
ps- I'm not terribly experienced in php but know a thing or two....in the spirit of saving time and getting things out of the way....this will be my next question:
How do I include the radio button selections in the submission? Do I simply write them into my php script and name them?
thanks
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
August 28th, 2009, 12:40 pm
- PolishHurricane
- Mastermind


- Joined: Feb 17, 2005
- Posts: 1585
- Status: Offline
I just skimmed your topic but it seems to me that you're having display issues which should relate to HTML and CSS and not PHP.
First of all you should not put the "Service Call Authorization" in there without having it be part of the table. Also the <center> tag was depreciated in HTML 4.01 so you don't want to use that anymore. Also your tags overlap like one is within the other. It should be something like this...
as for the "Some repairs..." you should do something like this...
(The colspan="3" is just so it makes the cell in the table row 3 cells wide, so it is as wide as the other 3 table cells put together)
Hope that helps, 2am, spacing out and falling asleep...
First of all you should not put the "Service Call Authorization" in there without having it be part of the table. Also the <center> tag was depreciated in HTML 4.01 so you don't want to use that anymore. Also your tags overlap like one is within the other. It should be something like this...
HTML Code: [ Select ]
<tr><td colspan="3" style="font-weight: bold; text-align: center; text-decoration: underline; ">Service Call Authorization</td></tr>
as for the "Some repairs..." you should do something like this...
HTML Code: [ Select ]
<tr><td colspan="3" style="text-align: center; ">Some repairs require an initial diagnostic visit. What would you like us to do?</td></tr>
(The colspan="3" is just so it makes the cell in the table row 3 cells wide, so it is as wide as the other 3 table cells put together)
Hope that helps, 2am, spacing out and falling asleep...
There's no place like 127.0.0.1, badass part is now it's ::1
- theshangsta
- Newbie


- Joined: Aug 28, 2009
- Posts: 6
- Status: Offline
yes thank you that did it.....don't know why in the world i couldnt figure that out on my own lol
now onto my next question as stated in my previous post, but i will elaborate a bit:
I have a php script that im using on my contact us page that works perfectly and sends me an email with the user input data....But on my contact page, i only have one field for the user to fill in ("$body")
So it obviously only sends me what is in that field.....
On these new forms i have, there are multiple fields including radio buttons that i need the php to send me......here's my code:
i tried editing the $message field at the bottom, commas, semicolons.....more of a n00b to PHP than i thought lol....any help is greatly apppreciated
now onto my next question as stated in my previous post, but i will elaborate a bit:
I have a php script that im using on my contact us page that works perfectly and sends me an email with the user input data....But on my contact page, i only have one field for the user to fill in ("$body")
So it obviously only sends me what is in that field.....
On these new forms i have, there are multiple fields including radio buttons that i need the php to send me......here's my code:
PHP Code: [ Select ]
<?php
$name = trim($_POST['name']);
$location = trim($_POST['location']);
$city = trim($_POST['city']);
$zip = trim($_POST['zip']);
$home = trim($_POST['home']);
$cell = trim($_POST['cell']);
$office = trim($_POST['office']);
$primaryfax = trim($_POST['primaryfax']);
$local = trim($_POST['local']);
$localfax = trim($_POST['localfax']);
$from = trim($_POST['from']);
$problem = trim($_POST['problem']);
$previousproblem = trim($_POST['previousproblem']);
$company = trim($_POST['company']);
$service = trim($_POST['service']);
function checkEmail($from)
{
if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $from))
{
return FALSE;
}
list($Username, $Domain) = split("@",$from);
if(getmxrr($Domain, $MXHost))
{
return TRUE;
}
else
{
if(fsockopen($Domain, 25, $errno, $errstr, 30))
{
return TRUE;
}
else
{
return FALSE;
}
}
}
if( isset( $_POST['submit'] ) || !empty( $_POST['submit'] ) )
{
$errors = '';
if(checkEmail($from) == FALSE)
{
if( empty($from) )
{
$errors .= "<br/><strong>Please enter a valid Email address</strong><br/><br/>";
} else {
$errors .= "<strong>Your E-mail address entered is not valid, please go back and try again.<br/><br/></strong>";
}
}
if ( empty($name) ) { $errors .= "<strong>Please enter your full name.<br/><br/></strong>"; }
if ( empty($location) ) { $errors .= "<strong>Please enter a valid service call location.<br/><br/></strong>"; }
echo $errors;
if ( empty($errors) )
{
$sendTo = "myemail@ myemail. com";
$subject = SCAF;
$headers = "From: " . $from;
$message = $name;
mail($sendTo, $subject, $message, $headers);
header("location: http://www. mywebsite. com/thanks.html");
}
}
?>
$name = trim($_POST['name']);
$location = trim($_POST['location']);
$city = trim($_POST['city']);
$zip = trim($_POST['zip']);
$home = trim($_POST['home']);
$cell = trim($_POST['cell']);
$office = trim($_POST['office']);
$primaryfax = trim($_POST['primaryfax']);
$local = trim($_POST['local']);
$localfax = trim($_POST['localfax']);
$from = trim($_POST['from']);
$problem = trim($_POST['problem']);
$previousproblem = trim($_POST['previousproblem']);
$company = trim($_POST['company']);
$service = trim($_POST['service']);
function checkEmail($from)
{
if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $from))
{
return FALSE;
}
list($Username, $Domain) = split("@",$from);
if(getmxrr($Domain, $MXHost))
{
return TRUE;
}
else
{
if(fsockopen($Domain, 25, $errno, $errstr, 30))
{
return TRUE;
}
else
{
return FALSE;
}
}
}
if( isset( $_POST['submit'] ) || !empty( $_POST['submit'] ) )
{
$errors = '';
if(checkEmail($from) == FALSE)
{
if( empty($from) )
{
$errors .= "<br/><strong>Please enter a valid Email address</strong><br/><br/>";
} else {
$errors .= "<strong>Your E-mail address entered is not valid, please go back and try again.<br/><br/></strong>";
}
}
if ( empty($name) ) { $errors .= "<strong>Please enter your full name.<br/><br/></strong>"; }
if ( empty($location) ) { $errors .= "<strong>Please enter a valid service call location.<br/><br/></strong>"; }
echo $errors;
if ( empty($errors) )
{
$sendTo = "myemail@ myemail. com";
$subject = SCAF;
$headers = "From: " . $from;
$message = $name;
mail($sendTo, $subject, $message, $headers);
header("location: http://www. mywebsite. com/thanks.html");
}
}
?>
- <?php
- $name = trim($_POST['name']);
- $location = trim($_POST['location']);
- $city = trim($_POST['city']);
- $zip = trim($_POST['zip']);
- $home = trim($_POST['home']);
- $cell = trim($_POST['cell']);
- $office = trim($_POST['office']);
- $primaryfax = trim($_POST['primaryfax']);
- $local = trim($_POST['local']);
- $localfax = trim($_POST['localfax']);
- $from = trim($_POST['from']);
- $problem = trim($_POST['problem']);
- $previousproblem = trim($_POST['previousproblem']);
- $company = trim($_POST['company']);
- $service = trim($_POST['service']);
- function checkEmail($from)
- {
- if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $from))
- {
- return FALSE;
- }
- list($Username, $Domain) = split("@",$from);
- if(getmxrr($Domain, $MXHost))
- {
- return TRUE;
- }
- else
- {
- if(fsockopen($Domain, 25, $errno, $errstr, 30))
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- }
- if( isset( $_POST['submit'] ) || !empty( $_POST['submit'] ) )
- {
- $errors = '';
- if(checkEmail($from) == FALSE)
- {
- if( empty($from) )
- {
- $errors .= "<br/><strong>Please enter a valid Email address</strong><br/><br/>";
- } else {
- $errors .= "<strong>Your E-mail address entered is not valid, please go back and try again.<br/><br/></strong>";
- }
- }
- if ( empty($name) ) { $errors .= "<strong>Please enter your full name.<br/><br/></strong>"; }
- if ( empty($location) ) { $errors .= "<strong>Please enter a valid service call location.<br/><br/></strong>"; }
- echo $errors;
- if ( empty($errors) )
- {
- $sendTo = "myemail@ myemail. com";
- $subject = SCAF;
- $headers = "From: " . $from;
- $message = $name;
- mail($sendTo, $subject, $message, $headers);
- header("location: http://www. mywebsite. com/thanks.html");
- }
- }
- ?>
i tried editing the $message field at the bottom, commas, semicolons.....more of a n00b to PHP than i thought lol....any help is greatly apppreciated
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 4 posts
- Users browsing this forum: No registered users and 141 guests
- You cannot post new topics in this forum
- You cannot reply to topics in this forum
- You cannot edit your posts in this forum
- You cannot delete your posts in this forum
- You cannot post attachments in this forum
