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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:23:07+00:00 2026-06-01T15:23:07+00:00

I used cURL to authenticate first then login via POST to a cms. Then

  • 0

I used cURL to authenticate first then login via POST to a cms.

Then another POST again to ask the cms to generate a new code number (eg voucher code) and grab the csv from url that contain about 70 lines per page.

I can explode each line and get the last line for the new code number that is generated before.

My question is if many requests are created by many customers, is it possible to accidentally reading the same voucher code? Although cURL get the csv file pretty fast, should I make sure that a request must be completed first before another? like a sql transaction.

Though I read somewhere php do not run in parallel, since I am a beginner in all these and someone asked me if my script can cause that for multiple requests. THanks in advance.

  • 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-01T15:23:09+00:00Added an answer on June 1, 2026 at 3:23 pm

    The only way you will get the same voucher code is if the remote server generates the same code twice. You are correct in saying php do not run in parallel but concurrency has nothing to do with your specific case, there is no way the two HTTP response get mixed up with each other because they are sent back to you in different TCP streams. The underlying TCP/IP stack of the OS will prevent collisions.

    Regardless of this, you should be able to check for collisions after you have received the data. For example, if you are inserting it into an SQL database, you can create a unique index on the field that holds the code, and the database will prevent you from inserting duplicated rows.

    As a side note, you say you can explode each line which is true, but you may wish to have a look at fgetcsv() and str_getcsv(), which will parse the line for you and take into account escape sequences and all sorts of edge-cases that you code will not account for. If you want to perform multiple cURL requests at once, you may also want to have a look at curl_multi_exec(), which will allow you to execute several requests at once and speed up the execution of your script.

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

Sidebar

Related Questions

I've seen curl() used as a way to POST - are there other ways
I have a curl script that is used to remote control a login a
this is an edited code in which mr. Paulo Rodrigues, php curl is used
I have used the cURL solution to solve XSS but there is an issue
can curl be used on google app engine ?
Used code I found on SO to use the COM based Acrobat Reader to
Is it possible to login to my gmail account and send mail using curl
I made a script to post comments on a page. I have used PHP
In PHP curl there are two functions used to ignore all SSL errors (invalid
I'm trying to figure out why a cURL process (written in PHP) that used

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.