Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>my simple try. first page where form submit </p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form action="" method="post"&gt; &lt;input type="text" name="email"/&gt; &lt;input type="text" name="name"/&gt; &lt;input type="submit" value="registration" name="register" /&gt; &lt;/form&gt; &lt;?php //connection with database. $conn=mysql_connect("localhost","root",""); mysql_select_db("test"); //check if form submitted if(isset($_POST['register'])) { $result=mysql_query("INSERT INTO testdata(name,email) values('".$_POST['name']."','".$_POST['email']."')") or die(mysql_error()); if(mysql_affected_rows($conn)&gt;0) { echo "Done"; $url = 'http://localhost/TESTCODE/get-post.php'; $fields = array( 'name'=&gt;urlencode($_POST['name']), 'email'=&gt;urlencode($_POST['email']) ); /* on my install of PHP 5.3, http_build_query() seems to use &amp;amp; as the default separator. */ $fields_string=http_build_query($fields); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); //execute post $result = curl_exec($ch); //close connection curl_close($ch); } } ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and 2nd page get-post.php where again i submitted form via curl </p> <pre><code> &lt;?php $conn=mysql_connect("localhost","root",""); mysql_select_db("test"); $result=mysql_query("INSERT INTO testdata(name,email) values('".$_POST['name']."','".$_POST['email']."')") or die(mysql_error()); ?&gt; </code></pre> <p>i just did it for a simple checking.you should modify as you need. here i inserted data two times in two different page</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload