SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem POSTing Form Data

    Ok, I've got a problem.

    I'm using a PHP class called "Snoopy" to post data to an external script via POST. My code looks a bit like this:

    Code:
        if (CONDITION) {
                 require("../../snoopy.class");
      	$snoopy = new Snoopy;
      	$submit_url = "http://url.to.post.to";
      
              $submit_vars["email"] = $email;
              $submit_vars["id"] = "etc";
              $submit_vars["version"] = "`2";
      
      	if ($snoopy->submit($submit_url,$submit_vars)) {
      	  echo("");
      	} else {
      	  echo "Error Fetching Document: ".$snoopy->error."\n";
      	}
        }
    That's just a rough example -- in reality, I have 5 different values in the $submit_vars[] array -- the problem is that it seems to be submitting the values to the URL six times! The script processes the info and sends an email when it's done, and I find I get 6 emails every time.

    Any idea what's up with this?

  2. #2
    ********* Addict
    Join Date
    Apr 2000
    Location
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, wot? From briefly reading the script's documentation and having a quick glance over submit()'s source code I would swear that's right! BTW, are you using the latest version (0.94, I think)?

    Anyway, good luck.

    Pedro

  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I downloaded the class quite recently -- version shouldn't be a problem. Anyone have any idea why it sends 6 requests, or how I might fix this?


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
  •