Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 483585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:12:46+00:00 2026-05-13T01:12:46+00:00

I have a form on my site which sends data to some remote site

  • 0

I have a form on my site which sends data to some remote site – simple html form.
What I want to do is to use data user enters into form for statistical purposes.
So I instead of sending data to the remote page I send it first to my script which resends it the remote site.

The thing is I need it to behave in exact way the usual form would behave taking user to the remote site and displaying resources.

When I use this code it kinda works but not in the way I want it to:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $action);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec($ch);
curl_close($ch);

Problem is that it displays response in the same script. For example if $action is for example:
somesite.com/processform.php and my script name is mysqcript.php it would display the response of “somesite.com/processform.php” inside “mysqcript.php” so all the relative links are not working.
How do I make it to send the user to “somesite.com/processform.php”? Same thing that pressing the button would do?

Leonti

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T01:12:46+00:00Added an answer on May 13, 2026 at 1:12 am

    There are several ways to do that. Here’s one of the easiest: just use a 307 redirect.

     header('Location: http://realsite.com/form_url.php', true, 307');
    

    You can do your logging and stuff either before or after header() but if you do it after calling header() you will need to start your script with

    ignore_user_abort(true);
    

    Note that browsers are supposed to notify the user that their form is being redirected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form at my site which sends it data via Ajax
I have a contact form at my wordpress site, which it's data to mysql
I have an enquiry form on a site, which has been working for a
I'm developing a site using the CakePHP framework. I have a form which shows
Basically I have an MVC 3 form which sends a mail to my inbox
I have a form which I submit and I use .serialize to help me
I have an iPhone application where I'd like to send some form data to
I have a form on my company's site which takes a name, telephone number,
Let's say I have a form from a remote area http://example.com/form.php which contains: <form
I have a function that sends out site emails (using phpmailer), what I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.