Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Sep 2012
    Posts
    64
    Member #
    32790
    Liked
    3 times
    Hi,
    I have tried to apply font to the table but it doesnt work when uploaded to server. Can anyone help?

    Code is:-
    <?php
    include_once('config.php');

    if($_POST['submitID'] == 1){

    if($_POST['name'] == NULL){ $message = 'Please enter your name.';}
    if($message == NULL && is_valid_email($_POST['email']) == false ){ $message = 'Please enter a valid email.';}
    if($_POST['messageText'] == NULL && $message == NULL){ $message = 'Please enter a comment.';}

    if($message == NULL){

    $doSearch = array('$+name+$','$+email+$','$+message_text+$','$ +reason+$');
    $doReplace = array($_POST['name'],$_POST['email'],$_POST['messageText'],$_POST['reason']);

    $headers = "Return-Path: ".$siteTitle." <".$emailFrom.">\r\n";
    $headers .= "From: ".$siteTitle." <".$emailFrom.">\r\n";
    $headers .= "Content-Type: text/html; charset=".$emailCharset.";\n\n\r\n";

    if($sendThankYou == FALSE){
    $userMessage = str_replace($doSearch,$doReplace,$emailSubject);
    mail ($_POST['email'],$emailTitle,$userMessage,$headers);
    }

    $adminMessage = str_replace($doSearch,$doReplace,$emailSubjectAdmi n);

    if(count($adminEmails) > 0){
    foreach($adminEmails as $thisEmail){
    mail($thisEmail,$emailAdminTitle,$adminMessage,$he aders);
    }
    }

    $message = 'Thanks for your message. I will be in touch shortly.';
    $_POST = NULL;
    }
    }
    if($message != NULL){
    ?>

    <!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">

    <head>
    <style type="text/css">

    table, th, td, tr {
    color:#000;
    font-family:'Myriad Pro',Arial, Helvetica, sans-serif;
    font-size:13px;
    font-weight:300;
    letter-spacing:0.6px;
    background-color:#FFF;}
    </style></head></html>

    <table width="360px" border="0" cellpadding="5"cellspacing="0"></table>
    <?php } ?>
    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" name="contact" id="contact" style="display:inline;">
    <table width="360px" border="0" align="left" cellpadding="5" cellspacing="0" background-color="#fff">
    <tr>
    <td>Name:</td>
    <td><input name="name" type="text" id="name" width="200px" value="<?php echo $_POST['name'];?>"></td>
    </tr>
    <tr>
    <td>Email:</td>
    <td><input name="email" type="text" id="email" width:"200px"value="<?php echo $_POST['email'];?>"></td>
    </tr>
    <tr>
    <td>Message:</td>
    <td><textarea name="messageText" cols="25" rows="8" width="200px" id="messageText"><?php echo $_POST['messageText'];?></textarea></td>
    </tr>
    <tr>
    <td colspan="2"><div align="center">
    <input type="submit" name="Submit" value="Send">
    <input name="submitID" type="hidden" id="submitID" value="1">
    </div></td>
    </tr>
    </table>
    </form>

  2.  

  3. #2
    Senior Member Ganners's Avatar
    Join Date
    Feb 2011
    Location
    United Kingdom
    Posts
    415
    Member #
    27007
    Liked
    92 times
    You have a few issues, the one causing your issues is this:

    PHP Code:
    if($message != NULL){
    ?>

    <!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">

    <head>
        <style type="text/css">

        table, th, td, tr {
            color:#000;
            font-family:'Myriad Pro',Arial, Helvetica, sans-serif;
            font-size:13px;
            font-weight:300;
            letter-spacing:0.6px;
            background-color:#FFF;}
        </style></head></html>

        <table width="360px" border="0" cellpadding="5"cellspacing="0"></table>
        <?php ?>
    You're only applying your style is $message isn't NULL. If it is null then you'll have no style which I assume is where you're problem is coming from.

    More important issues is that you have no <body> tags, and you're closing your </html> straight after </head> which needs fixing.
    twinky likes this.
    Mark Gannaway Software Developer

    Recent Experiments
    - Backpropogation Neural Network language solving (http://ann.ganners.co.uk/)
    - Animated image to ASCII (http://google.ganners.co.uk/)
    - 3D Paper Characters (http://cybergame.ganners.co.uk/)
    - Anagram solving (http://roflol.co.uk/)

  4. #3
    Member
    Join Date
    Sep 2012
    Posts
    64
    Member #
    32790
    Liked
    3 times
    Thank you thats great and works now. Only problem is the thank you message no longer seems to work. The form send ok but the form just refreshes rather than display the thank you message

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    I see this line:
    $message = 'Thanks for your message. I will be in touch shortly.';

    But I don't see it used anywhere ... how will it appear anywhere, or where should it appear?


  6. #5
    Member
    Join Date
    Sep 2012
    Posts
    64
    Member #
    32790
    Liked
    3 times
    thank you


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:35 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com