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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:27:29+00:00 2026-05-29T23:27:29+00:00

I have a few php pages that might want to access the database and

  • 0

I have a few php pages that might want to access the database and insert data into it. Now, I have a PHP script (save_data.php) that does the insert. It gets the input via POST then insert the data into database.

I want the other pages to be able to call/hit the save_data.php and send parameters via POST so that those pages dont have to directly access the database. After hitting the save_data.php, the other pages, must resume loading their own HTML codes.

I’ve read about cURL in PHP and using WebServices but Im not sure which one is appropriate or is there any other way? Thanks.

  • 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-29T23:27:30+00:00Added an answer on May 29, 2026 at 11:27 pm

    Based on your comments on other answers, it sounds like you want to provide access to the your save scripts to other servers and developers. The standard best practice way to do this is to offer a Web Service. Either an API that can be accessed via cURL, REST, or maybe even expose a SOAP server.

    There’s an old school trick to do some of these things, though, if you’re looking for a quick and easy way to expose this script. You can use image embedding in HTML, kind of like how old school site counters work.

    The page includes an image:

    <img src="http://yoursite.com/your_script.php" />
    

    And your_script.php does your database write logic, and responds with the appropriate MIME type, plus the data of a blank GIF.

    This is used more often to share cookies across multiple domains and services using multiple types of technologies, but could work in your case.

    I’m not advising its the BEST way to go. But it could work for you.

    Edit

    Another reason I outlined this solution is because it does not require PHP on the initial page. When your question stated that the pages may be uploaded by users, I got heart palpitations thinking about user uploaded PHP including your PHP. Please don’t let users upload and execute PHP code. Please oh please!

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

Sidebar

Related Questions

I have php generated pages that change every few minutes based on the underlying
I'm manipulating few data with PHP, I have the choice between Json and XML.
I have to choose a server pages technology for a few server components that
I have a few questions about security using PHP, I dont want to use
I have a WP site where I've also got a few php pages outside
I have a few issues with the following php functions (part of a bigger
I am creating a framework in PHP and need to have a few configuration
I have few nested DIVs at page. I want to add event only for
So I'm trying to import some sales data into my MySQL database. The data
Here's my situation: I'm working on a PHP project that uses a few functions

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.