dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: AJAX to PHP

  1. #1
    Join Date
    May 2009
    Posts
    1

    AJAX to PHP

    I need to send several variable from a form to a php page. It sends me an errors message that I set , if agree was not checked. Here is the link tandembyte.com/register.html
    Code:
    <script language="javascript">
    if (window.XMLHttpRequest) { 
            XMLHttpRequestObject = new XMLHttpRequest(); 
          } else if (window.ActiveXObject) { 
            XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP"); 
          } 
     
          function getData(id)  
          {  
            if(XMLHttpRequestObject) { 
              var obj = document.getElementById(id);  
              XMLHttpRequestObject.open("POST", "../php/registernext.php");  
              XMLHttpRequestObject.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
              
    		   XMLHttpRequestObject.onreadystatechange = function()  
              {  
                if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) {  
                    obj.innerHTML = XMLHttpRequestObject.responseText;  
                }  
              }
    		 
    		  XMLHttpRequestObject.send("fname=" + document.form1.elements["fname"].value, "lname=" + document.form1.elements["lname"].value, "password=" + document.form1.elements["password"].value, "password2=" + document.form1.elements["email"].value, "email=" + document.form1.elements["email"].value, "email2=" + document.form1.elements["email2"].value, "operating=" + document.form1.elements["os"].value, "agree=" + document.form1.elements["agree"].value);
            } 
          } </script>

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Welcome to DevX

    What is the exact wording of the error message?

  3. #3
    Join Date
    May 2009
    Posts
    1

    error message

    please make sure you agree with the terms of use before continuing.

    I think the problem is getting th ephp file to notice that the check box has been checked.
    Last edited by manray; 05-09-2009 at 10:55 AM.

Similar Threads

  1. Php and ajax
    By sabinkumar in forum AJAX
    Replies: 0
    Last Post: 02-16-2009, 05:38 AM
  2. Ajax + Php + Update Field
    By tommyready in forum AJAX
    Replies: 1
    Last Post: 04-20-2007, 08:50 PM
  3. AJAX, cURL, and PHP
    By chivkea in forum AJAX
    Replies: 0
    Last Post: 03-22-2007, 09:15 PM
  4. Replies: 0
    Last Post: 02-17-2007, 04:36 PM
  5. Replies: 0
    Last Post: 08-28-2006, 04:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center