Unfortunately, the username and password you have entered do not match!

Registration

Unfortunately, this username is already taken!

Unfortunately, this e-mail address is already used!

Please retype the verification code.

All fields are required

RSForm!Pro - Silent post

Silent post
Note: Starting with RSForm! Pro R44, this is a built-in feature of RSForm! Pro and there is no need for additional scripting. Please take a look at this article instead.

With RSForm! Pro you can submit your form's data to another location, while still having emails sent and submissions recorded in the database. Let's begin!

  1. Let's assume that you have a basic form that looks like this:

    <form method="post" action="http://www.myserver.com/myaction.php">
    	<p>First Name: <input type="text" name="first_name" value="" /></p>
    	<p>Last Name: <input type="text" name="last_name" value="" /></p>
    	<p>Email: <input type="text" name="email" value="" /></p>
    	<p><input type="hidden" name="my_hidden_id" value="55" /></p>
    	<p><input type="submit" name="mysubmit" value="submit this form" /></p>
    </form>

  2. What you need to do right now is re-create this form with RSForm! Pro. Just add all the fields in your current form and keep the same naming convention. For example, if you want to add the text field "First Name", look for the name="" attribute and add a Textbox in RSForm! Pro with the same name. In our case, it will be first_name.

    If you need general help with adding new fields with RSForm! Pro, you can view our video tutorial.

  3. The form should look almost the same as your initial form:

  4. Now, get the action="" attribute of your form and add it in the code below. In our case, the action is http://www.myserver.com/myaction.php. You usually won't need to modify anything else in the code.

    // this is your form's action URL
    $url = 'http://www.myserver.com/myaction.php';
    
    $ch = curl_init();
    
    // set user agent
    $useragent = 'YahooSeeker-Testing/v3.9 (compatible; Mozilla 4.0; MSIE 5.5; http://search.yahoo.com/)';
    curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
    
    // don't touch this
    curl_setopt($ch, CURLOPT_POST, 1);
    
    // set the target URL which contains scripts that accepts post request
    curl_setopt($ch, CURLOPT_URL, $url);
    
    // set the variables to be sent
    // the format of the variables is var1=value1&var2=value2&var3=value3
    $data = array();
    foreach ($_POST['form'] as $post => $value)
    {
    	if (is_array($value))
    		foreach ($value as $post2 => $value2)
    			$data[] = $post.'[]='.urlencode($value2);
    	else
    		$data[] = $post.'='.urlencode($value);
    }
    curl_setopt($ch, CURLOPT_POSTFIELDS, implode('&', $data));
    
    // execute curl,fetch the result and close curl connection
    $result = curl_exec($ch);
    curl_close($ch);
    This script needs to be placed in the "Script called after form has been processed" field, which you can find in the Scripts tab (it's the 3rd textbox).

  5. This is an optional step: If you would like to "follow" the action URL, so that the browser redirects there, you can add the following line of code anywhere before $result = curl_exec($ch):

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    And, at the end of the script, just add the following line:
    exit();
    Now your form will follow the location of your URL.
    More information about cURL can be found here.

Note: We recommend that you use this script only if you know what you are doing. This tutorial is good for basic programming, but you will need advanced PHP knowledge in order to achieve advanced results.
Feedback