center text in PHP form?

  • theshangsta
  • Newbie
  • Newbie
  • theshangsta
  • Posts: 6

Post 3+ Months Ago

This will probably be regarded as a very n00bish question.... :lol:

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">&nbsp;</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">&nbsp;</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>&nbsp;</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>
  1. <CENTER><B><U>Service Call Authorization</B></U></CENTER><br>
  2.  
  3. <td align=left>Name:</td>
  4. <td width="15">&nbsp;</td>
  5. <td><input size=35 maxlength=35 type=text name=name
  6. style="font-family: Courier New; font-size: 10pt"></td></tr>
  7.  
  8. <tr>
  9. <td align=left>Service Location:(street address)</td>
  10. <td width="40">&nbsp;</td>
  11. <td><input size=35 maxlength=35 type=text name=location
  12. style="font-family: Courier New; font-size: 10pt"></td></tr>
  13.  
  14. <tr>
  15. <td align=left>City & State:</td>
  16. <td>&nbsp;</td>
  17. <td><input size=30 maxlength=30 type=text name=city
  18. style="font-family: Courier New; font-size: 10pt"></td></tr>
  19.  
  20. <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 :wink:

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
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • PolishHurricane
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1585

Post 3+ Months Ago

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...
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...
  • theshangsta
  • Newbie
  • Newbie
  • theshangsta
  • Posts: 6

Post 3+ Months Ago

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:
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");        
    }
}
 
?>
  1.  <?php
  2.  
  3. $name = trim($_POST['name']);
  4. $location = trim($_POST['location']);
  5. $city = trim($_POST['city']);
  6. $zip = trim($_POST['zip']);
  7. $home = trim($_POST['home']);
  8. $cell = trim($_POST['cell']);
  9. $office = trim($_POST['office']);
  10. $primaryfax = trim($_POST['primaryfax']);
  11. $local = trim($_POST['local']);
  12. $localfax = trim($_POST['localfax']);
  13. $from = trim($_POST['from']);
  14. $problem = trim($_POST['problem']);
  15. $previousproblem = trim($_POST['previousproblem']);
  16. $company = trim($_POST['company']);
  17. $service = trim($_POST['service']);
  18.  
  19. function checkEmail($from)
  20. {
  21.    if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $from))
  22.    {
  23.       return FALSE;
  24.    }
  25.  
  26.    list($Username, $Domain) = split("@",$from);
  27.    
  28.    if(getmxrr($Domain, $MXHost))
  29.    {
  30.       return TRUE;
  31.    }
  32.    else
  33.    {
  34.       if(fsockopen($Domain, 25, $errno, $errstr, 30))
  35.       {
  36.          return TRUE;
  37.       }
  38.       else
  39.       {
  40.          return FALSE;
  41.       }
  42.    }
  43. }
  44.  
  45. if( isset( $_POST['submit'] ) || !empty( $_POST['submit'] ) )
  46. {
  47.     $errors = '';
  48.    
  49.     if(checkEmail($from) == FALSE)
  50.     {
  51.    
  52.         if( empty($from) )
  53.         {
  54.             $errors .= "<br/><strong>Please enter a valid Email address</strong><br/><br/>";
  55.         } else {
  56.             $errors .= "<strong>Your E-mail address entered is not valid, please go back and try again.<br/><br/></strong>";
  57.         }
  58.     }
  59.    
  60.     if ( empty($name) ) { $errors .= "<strong>Please enter your full name.<br/><br/></strong>"; }
  61.    
  62.     if ( empty($location) ) { $errors .= "<strong>Please enter a valid service call location.<br/><br/></strong>"; }
  63.  
  64.     echo $errors;
  65.        
  66.     if ( empty($errors) )
  67.     {
  68.         $sendTo = "myemail@ myemail. com";
  69.         $subject = SCAF;
  70.         $headers = "From: " . $from;
  71.         $message = $name;
  72.         mail($sendTo, $subject, $message, $headers);
  73.         header("location: http://www. mywebsite. com/thanks.html");        
  74.     }
  75. }
  76.  
  77. ?>



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
  • theshangsta
  • Newbie
  • Newbie
  • theshangsta
  • Posts: 6

Post 3+ Months Ago

oh and btw, the data named "service" is 3 different radio buttons all named service, with different values....how can i get the values returned? thank you very much

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: Liamw411 and 58 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.