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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:56:36+00:00 2026-05-23T07:56:36+00:00

My current host doesn’t allow remote mysql acces so I need to work around

  • 0

My current host doesn’t allow remote mysql acces so I need to work around it by having script1 on server1 communicate with script2 on server2. I am trying to send post data to script2, which then takes that data and puts it into mysql. To keep my question simple I stripped the code down to this:

script1

for ( $counter = $counternumbernao; $counter <= $amountofcomments; $counter += 1) 
{
echo'
<form action="http://server2.x.com/form-receive.php" method="post">
<INPUT TYPE=HIDDEN NAME="comment_content" value=$comment_content>
<INPUT TYPE=HIDDEN NAME="comment_date" value=$comment_date">
<input type="submit" />
</form>
';
}

How can I alter this code, so that every time the loop occurs it automatically sends the $_POST data to script2, which then puts it into mysql? I didn’t think it was necessary to include script2 as it’s not important to this issue.

  • 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-05-23T07:56:37+00:00Added an answer on May 23, 2026 at 7:56 am

    To have this automatically occur without the end user being aware of this behaviour, the best way would be to use CURL (http://php.net/manual/en/book.curl.php).

    Here’s an example of how it would look:

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://server2.x.com/form-receive.php");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, true);
    
    $data = array(
        'foo' => 'bar',
        // Put data from $_POST here
    );
    
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    $output = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a client who's current host does not allow me to use
I need to git push to remote, and that push need to be current
I want to display the current host and database names in a view. Where
Is there a simple way in .NET to quickly get the current protocol, host,
Why does HttpContext.Current.Request.Url.Host return a different URL than the URL used in the Web
Using the current request I can get the URL hostname with: HttpContext.Current.Request.Url.Host But -
I'm having a problem with copying or scripting my database at a web host
I'm trying to figure out why this doesn't work. Let's say you three models,
My current web host allows for up to 25 processes running at once. From
Here is my current code: RewriteCond %{HTTP_HOST} !^example\.com [NC] #RewriteCond %{REQUEST_URI}!^something RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com

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.