SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 37 of 37
  1. #26
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    Dump the whole of $_POST into the message (or echo it to the screen) to confirm that what you expect to be in $_POST, really is there in $_POST

    var_dump($_POST)
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  2. #27
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply Paul.

    Unfortunately I haven't got access to the server right now. But I do hope to try it out later today.

    Thanks again.

  3. #28
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just to confirm, I would do this in my sendemail.php script?

  4. #29
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by invision2 View Post
    Just to confirm, I would do this in my sendemail.php script?
    Yes.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #30
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, but I think because of the AJAX, it doesn't show the data.
    It just gives me the 'Success! Email sent' message.

    Sorry to be a pain

  6. #31
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by invision2 View Post
    OK, but I think because of the AJAX, it doesn't show the data.
    It just gives me the 'Success! Email sent' message.

    Sorry to be a pain
    You were saying that you were having trouble with this part of the code:

    Code php:
    $mailTo = $_POST['emailTo'];
    ...
    $message .= "Name: ".$_POST['uname'];
    $message .= "Telephone: ".$_POST['telnum'];
    $message .= $_POST['cname'];

    you were saying that they get emailed correctly, but the $_POST values for $message were missing.
    That implies that $_POST is available, but it only contains partial data.

    Why? Is data missing? Is it misplaced? Is it misspelled? Why?
    Find out what is actually in $_POST, and what is not, and you can then track the issue back further, to its root cause.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #32
    Non-Member
    Join Date
    Feb 2010
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use this code for entire application, even if your page contains multiple forms and they have different IDs. Just put this code inside a common js file and include it in every page.

    $(function() {

    $("form").bind("keypress", function(e) {
    if (e.keyCode == 13) return false;
    });

    });
    Eliza
    Last edited by DaveMaxwell; Mar 24, 2010 at 09:08.

  8. #33
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, that's it all sorted.

    I tried this:
    Code:
    var messageVal
    messageVal = unameVal + cnameVal + telnumVal;
    and it worked perfectly!

    I've got one final final question if it's ok. This is truly final

    If I then wanted to insert these values into a database, how would I do this.
    Would this be in both my sendemail.php and submitform.js?


    Many thanks again

  9. #34
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got the db connection/insertion working perfectly.

    Thanks again for all your help Paul, brilliant!

  10. #35
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Paul,

    I realise this is an old issue, but it's come back to haunt me

    Are you able to help out if I post my problem?


    Thank you

  11. #36
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    Shoot.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  12. #37
    SitePoint Wizard
    Join Date
    Mar 2008
    Location
    United Kingdom
    Posts
    1,285
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ooooft. No need. All sorted

    Will post how I did it shortly.


    Thanks for the reply anyways, I really appreciate the offer and the help you gave previously.


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
  •