Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Mailform

  1. #1
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default Mailform

    Hey you all,
    Can anyone tell me why this code doesn't work ?

    Code:
    <html>
    <head>
    <script language="JavaScript" type="text/JavaScript">
    function clearDefault(el) {
    if (el.defaultValue==el.value) el.value = ""
    }
    </script>
    
    </head>
    
    <body background="bgpalet.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    
    <table width="80%" height="100%" border="0" cellpadding="0" cellspacing="0" align=right>
    <tr><td align="center" valign="middle">  
    
    <table border="0" width=100% align=right>
    <tr><td width="120" valign="middle">
    
    </td><td valign="middle" align="right">
    
    <FORM NAME="form1" METHOD="post" ACTION="contact.php">
    
    <table width="100%" valign="top" align=center>
    <tr><td>
    <table width=100%>
    <tr><td align=left>
    <INPUT TYPE=TEXT NAME="name" VALUE="your name" onFocus="clearDefault(this)" style="border:1px solid #666666; width:190px">
    </td></tr>
    <tr><td align=left>
    <INPUT TYPE=TEXT NAME="email" VALUE="your e-mail" onFocus="clearDefault(this)" style="border:1px solid #666666; width:190px">
    </td></tr></table>
    </td><td width=20>
    &nbsp</td><td align=left valign=middle>
    <INPUT TYPE="image" src="emailgo.jpg" NAME="submit" VALUE="go" style="border: 0px">
    </td></tr></table>
    
    <table width="100%" valign="top" align=center>
    <tr><td align=right>
    <TEXTAREA NAME="message" style="border:1px solid #666666; width:265px; height:120px">
    </TEXTAREA>
    </td></tr></table>
    
    
    </FORM>
    
    </td></tr></table>
    </td></tr></table>
    
    </body>
    </html>

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You might want to start by suggesting what's wrong with it. The phrase "doesn't work" isn't very enlightening.

    Out of curiosity, just how many nested tables do you want?! Don't use tables to effect layout. Use CSS.

    Mike

  3. #3
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    I have no idea what is wrong with it, that's why I asked ... I guess it has someting to do with this:
    Code:
    <INPUT TYPE="image" src="emailgo.jpg" NAME="submit" VALUE="go" style="border: 0px">
    About the tables: everything looks fine, so I stick to something I know. Unless you can explain me more about how the css would work ?

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by chechu View Post
    I have no idea what is wrong with it ...
    Clearly you do: you said that "this code doesn't work", so you must have some expectations of what it's supposed to do.

    Mike

  5. #5
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    Dear Mike,

    Okay, so as everyone knows, especially a "professor", a mailform is supposed to send the input data to a mailserver, or in this case, be processed by another file called "contact.php".
    As this expected action hasn't been taken,something must be wrong ? But it could have various reasons:
    - the .php file (correct ?)
    - the html code without the <form> tags (correct ?)
    - the <form> itself (correct ?)

    Actually, someone that doesn't know what this code is supposed to do, shouldn't reply. Luckily, in the meantime, someone that did understand this code (a student by the way), checked it and confirmed me by personal mail that the code is entirely correct. So there is another reason, maybe the .php(to be confirmed).

    Is it clear now, Mike ?

  6. #6
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    What kind of error you are getting while executing the above mentioned page, you haven't mentioned nothing about that.

  7. #7
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by chechu View Post
    Dear Mike,

    Okay, so as everyone knows, especially a "professor", a mailform is supposed to send the input data to a mailserver, or in this case, be processed by another file called "contact.php".
    As this expected action hasn't been taken,something must be wrong ? But it could have various reasons:
    - the .php file (correct ?)
    - the html code without the <form> tags (correct ?)
    - the <form> itself (correct ?)

    Actually, someone that doesn't know what this code is supposed to do, shouldn't reply. Luckily, in the meantime, someone that did understand this code (a student by the way), checked it and confirmed me by personal mail that the code is entirely correct. So there is another reason, maybe the .php(to be confirmed).

    Is it clear now, Mike ?
    Flattery will get you nowhere

    What Mike was asking was not what is the code supposed to do, rather, what are your expectations for said code, and what is failing to meet those expectations?

    If the code works once and then never again, or if you get a blank response, or other problem.

    Posting a code snippet and saying "fix it" isn't going to get fixed. Those trying to help you will need to know what you have done to try and solve it yourself, as well as what you are expecting from the code and what it is or isn't doing.

    oh, and BTW the student/teacher/professor thing, just means how much we talk, not how much we know Except in Mike's case (and a handful of others...) Who have probably forgotten more than you and I will ever know.. back off the insults and just answer the questions needed to get the help you want.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  8. #8
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    No insults, opinions !
    Nothing appears; it remains the same page.
    - the .php file is correct
    - the html code without the <form> tags (correct ?)
    - the <form> itself (correct ?)
    So something is wrong in the code ?

  9. #9
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    That or your server is not set up to allow/support PHP... by saying "nothing appears" do you mean you have a blank page?

    If so you might not have php support there.... or you may have to adapt a .htaccess file to include php on an html page...
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  10. #10
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    The same page remains (doesn't change)
    That or your server is not ...
    My server supports .php, so ...
    Can anyone please tell me why this code doesn't work ?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •