But in my case I can not let the user to enter the POST information for textboxes and submit. It has to POST the data and redirect to a specified URL when user click a button. Tried to do it via cURL but it does not redirect user to the URI.Also If I add hiddenFields hardcoding POST values it is not secured as anyone can see the POST information by Browser View Page Source option.n file.php, Then in your javascript, In the button click event, Get this form and set the values of input fields. Then submit the form, Then In the second site on which the user is redirected, if you want to get the data, do this, And here u go. You will have the data transferred from one site to other safely.