Jump to content

Table help please :/


Noskiw

Recommended Posts

This is my code

 

<?php

    if(isset($_REQUEST['message'])){
        $to = '[email protected]';
        $subject = "Contact Form";
        $message = "From: " . $_REQUEST['name'];
        $message.= "Email: " . $_REQUEST['email'];
        $message.= "Message: " . $_REQUEST['message'];
        
        $header = "From: Noskiw!";
        
        if(mail($to, $subject, $message, $header)){
            echo "Your Message has been sent!";
        }else{
            echo "There was a problem sending your message";
        }
        
        die();
        
    }

?>

<html>

    <head>

        <title>Jquery Ajax Form</title>
        <link href="./csss.css" type="text/css" rel="stylesheet" />
        <script type="text/javascript" src="./jquery.js"></script>
        <script type="text/javascript">

            $(document).ready(function(){
                $('#contactForm').submit(function(){
        
                    var inputs = [];
                    $(':input', this).each(function(){
                        inputs.push(this.name + '=' + escape(this.value));
                    });
        
                jQuery.ajax({
                    data: inputs.join('&'),
                    url: this.action,
                    timeout: 2000,
                    error: function(){
                        console.log("Failed to submit");
                    },
                    success: function(r){
                        alert(r);
                        document.getElementById("contactForm").reset();
                    }
                });
        
            return false;
        
            });
        });

    </script>

    </head>

    <body>

        <div class="container" style="margin: none;">

            <div id="content_text">

                <h1>jQuery Ajax Forms</h1>

                <form action="contact.php" method="get" id="contactForm">
                
                    <table align="top" cellpadding="3" cellspacing="3" border="0">
                    
                        <tr>
                            <td>Email: </td>
                            <td>
                                <input type="text" name="email" value="" id="email" style="border: 1px solid #000" />
                            </td>
                        </tr>
                        <br />
                        <tr>
                            <td>Name: </td>
                            <td>
                                <input type="text" name="name" value="" id="name"  style="border: 1px solid #000" />
                            </td>
                        </tr>
                        <br />
                        <tr>
                            <td>Message: </td>
                            <td>    
                                <textarea name="message" id="message" style="border: 1px solid #000"></textarea>
                            </td>
                        </tr>
                        <br />
                        <tr>
                            <td align="right" colspan="2">
                                <input type="submit" value="Send Message" style="border: 1px solid #000" />
                            </td>
                        </tr>
                        
                    </table>
                    
                </form>

            </div>

        </div>

    </body>

</html>

 

There is a huge white space right above the table, is there anyway that I could get rid of this?

Link to comment
https://forums.phpfreaks.com/topic/217101-table-help-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.