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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:41:13+00:00 2026-06-12T02:41:13+00:00

So I was wondering how / if PHP has some sort of mutual exclusion

  • 0

So I was wondering how / if PHP has some sort of mutual exclusion on file reading and writing.

Here’s how I plan on using it:

The site I’m working with utilizes a payment service that requires leaving the server, making it difficult to deal with form submissions, such that the form does not get submitted into the database until after returning from the payment service. Information CAN be passed through the payment service and regurgitated on the other end. However, there is minimum information that can be passed.

My idea of a solution:

Before a registration is passed to the payment service, process and write the sql statements in a file, with each group of statements referring to a registration separated by some token.

On returning find the entry based on the information you sent through the payment service, execute the statements and remove the registration block from the file.

Rephrasing the question:

-So the question is – in this scenario would I need mutual exclusion on the file, and if so how would I achieve it? Could this be locked from multiple languages? (The payment service requires returning to a cgi / perl script – although I could include a php script that actually processes)

-How would I run through and execute the SQL statements (preferably in perl)?

-Does my solution even seem like a good one?

Thanks,

Travis

  • 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-12T02:41:15+00:00Added an answer on June 12, 2026 at 2:41 am

    Both PHP and Perl support flock().

    However, a better way to do it would be to use the database. Your DB table could have a processed column that indicates whether the payment has been processed. When you send the request to the payment service add a record with processed = 0. When the registration is returned, update the table with processed = 1.

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

Sidebar

Related Questions

I'm developing a site in PHP which has some complex SQL queries and I
I'm wondering how PHP detects that a specific session has timed out. In detail:
I'm working on an online PHP application that has a need for delayed PHP
I'm just playing around with some PHP and was wondering what happens when an
I first learned web programming with php a while back. It has some features
I'm wondering if PHP has this optimization built in. Normally when you call foreach
I'm basically wondering if Python has any OOP shortcomings like PHP does. PHP has
This syntax for some reason isn't working and I'm wondering why. When I alert
I'm using transactions with PHP's PDO and MySQL and I'm wondering how to select,
Just wondering in php, if it was possible to convert a string to a

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.