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 7787045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:32:34+00:00 2026-06-01T20:32:34+00:00

i have a form, which upon submission needs to refresh the page with a

  • 0

i have a form, which upon submission needs to refresh the page with a new url.

the new url however needs to come from the output of a curl function.

at the moment, I can get the curl function to operate correctly, but instead of refreshing the page with that url, it is just printing the url on the page.

have you any idea how i could use that url to refresh the page with?

thanks in advance

EDIT:

$ch = curl_init();  

curl_setopt($ch, CURLOPT_URL, "http://uk.ImpulsePay.com/payforit?RouteID=5432&URL=Y"); 
curl_setopt($ch, CURLOPT_HEADER, 0);   


header( "Location: curl_exec($ch)");
curl_close($ch);

If you visit the link above – it will display a page which has a link in the body. I am assentially trying to get the link in the body of the page, and then refresh the page to that page.

Does that make sense?

  • 1 1 Answer
  • 0 Views
  • 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-06-01T20:32:38+00:00Added an answer on June 1, 2026 at 8:32 pm

    You’ll want to use the PHP header() method, see this page: http://php.net/manual/en/function.header.php

    Here’s their example:

    header("Location: http://www.example.com/"); /* Redirect browser */
    

    Take note of the line that reads:

    Remember that header() must be called before any actual output is sent

    If you need to change the header after some content has already been “printed” you’ll need to use output buffering, see this page to get started: http://php.net/manual/en/function.ob-start.php

    UPDATE:
    Your curl_exec( $ch ) is not executing because you can’t execute functionality inside of double quotes, you can only insert variables.

    Here’s what you want to do:

    $httpResponse = curl_exec( $ch );
    header( "Location: $httpResponse");
    

    Assuming that the response is just a URL, this will redirect your user’s browser to the value returned by your curl request.

    UPDATE:
    I missed that you do not have a return transfer setting.
    You will need to add this line after your CURLOPT_HEADER line:

    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
    

    This will tell curl_exec to return the response instead of a boolean success indication.

    See the “Return values” section at: http://php.net/manual/en/function.curl-exec.php

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

Sidebar

Related Questions

I have created a PHP form, which, upon submission, goes to another PHP page.
I've got a log in page, which upon submission of the login form, displays
I have this form which is displayed none on page load. And upon clicking
I have a form which I want to submit upon button click which is
I have an application which upon start request around 10-12KB of data from server
I have an ASP.NET page with a simple form and a submit button. Upon
I have a PHP form which includes a file being uploaded upon submit. As
I have a page upon which a user can choose up to many different
I have a form which upon its loading events retrieves data and populates some
Basically I have a main form which upon loading, opens a child form for

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.