I’ve been working professionally for nearly 20 years and have been hearing that PHP is dying the entire time. I don’t use it a ton myself anymore but by no means is it dying
You need to create a “nonce.” A random guid. Apply that to a hidden value (to store it in a charge attempt.) Before charging and storing in an attempt, check if that nonce exists first.
Would you mind doing something like a quick and dirty var_dump on the $_POST variable after submitting the form? Just trying to see exactly what the data might look like so I can give the best recommendation.
What sort of reservations? I've built several systems that handle all different kinds, travel, hospitality, nightlife, other... interesting venues....
Could you give a little bit more detail about your inputs? Is it a regular old HTML form? Is it being POSTed from a javascript framework? How is the data hitting the PHP script?
Several months? More like several years and probably kill a business if you were to cut them off cold turkey.
This guy is off his rocker thinking it's just simple and easy to get off of a major version with breaking changes on legacy software that's been alive for 20+ years.
Honestly, your comment shows that you probably have a lack of real world experience, at least in PHP. You can't just rip out a legacy system that's been in place for 20+ years and has loaded up on a bunch of technical debt.
From an app perspective you’re thinking about this all wrong. You’re talking about making a HTTP request to a web server.
The lifecycle of a HTTP request is in the form of a request and a response. The client (iOS app) is making a request to the server. The server handles that request and then returns a response to the client.
In your case, your request is a JSON object being sent from the client (iOS) to the server (PHP script). Parse that request body on the server with PHP and build your response as an object or an array and then echo it out with json_encode.
For instance:
(This is on mobile so forgive me for simple mistakes and a shortened example)
<?php
//read raw POST data from stdIn if not set from a typical form POST
if(!isset($_POST)){
$data = file_get_contents(“php://input”);
$_POST = json_decode($data);
}
// handle POST data here
$response = [
“firstName”=>”John”,
“lastName” => “Doe”
];
//tell the client (iOS app) what type of response you’re sending back to them
header(“Content-type: application/json”);
//json encode the response array and echo (output it to the response) it out
echo json_encode($response);
/*
should output:
{
“firstName”:”John”,
“lastName”:”Doe”
}
*/
?>
This is obviously a very overly simplified version without any real logic but it should help you navigate a basic POST request from a mobile app.
I have a hard time believing this list is anywhere near legitimate. Sounds fishy from the start.
Also, good luck with rate limits, not just from Twilio but from the connecting carriers. Twilio can’t help with that. Then you have to managed deliverability events to hopefully try to redeliver it for you because Twilio won’t do that for you automatically either.
You’d likely have to disperse it over 100s of numbers to complete the task with any kind reasonable timeline.
Fair enough if you're still learning. Just remember to evaluate your time as you grow as a professional. I got caught in a trap where I started underquoting because I felt "imposter syndrome." I suddenly landed a few big projects and realized that the real world supports more than $25/hr when you do good work and you can increase your own profitability by creating your own library of tools (past code / projects / scaffolds) to work off of. Just keep iterating! Good luck in your endeavors.
Wow, I feel like I was using remi over 15 years ago at the beginning of my professional career managing LAMP
I’ve been working professionally for nearly 20 years and have been hearing that PHP is dying the entire time. I don’t use it a ton myself anymore but by no means is it dying
You need to create a “nonce.” A random guid. Apply that to a hidden value (to store it in a charge attempt.) Before charging and storing in an attempt, check if that nonce exists first.
Php doesn’t really require infrastructure though... you can run a php script from the cli...
but.... why.....
Would you mind doing something like a quick and dirty var_dump on the $_POST variable after submitting the form? Just trying to see exactly what the data might look like so I can give the best recommendation.
<?php echo var_dump($_POST);?>Could you also give us an example of what the incoming data might all look like?
What sort of reservations? I've built several systems that handle all different kinds, travel, hospitality, nightlife, other... interesting venues....
Could you give a little bit more detail about your inputs? Is it a regular old HTML form? Is it being POSTed from a javascript framework? How is the data hitting the PHP script?
Several months? More like several years and probably kill a business if you were to cut them off cold turkey.
This guy is off his rocker thinking it's just simple and easy to get off of a major version with breaking changes on legacy software that's been alive for 20+ years.
Get real / over yourself dude....
Honestly, your comment shows that you probably have a lack of real world experience, at least in PHP. You can't just rip out a legacy system that's been in place for 20+ years and has loaded up on a bunch of technical debt.
I’d agree with all of this.
I’m just curious on your recommendation to not use inheritance, care to explain?
We use OAuth for our internal apps with no cost.
From an app perspective you’re thinking about this all wrong. You’re talking about making a HTTP request to a web server.
The lifecycle of a HTTP request is in the form of a request and a response. The client (iOS app) is making a request to the server. The server handles that request and then returns a response to the client.
In your case, your request is a JSON object being sent from the client (iOS) to the server (PHP script). Parse that request body on the server with PHP and build your response as an object or an array and then echo it out with json_encode.
For instance:
(This is on mobile so forgive me for simple mistakes and a shortened example)
<?php //read raw POST data from stdIn if not set from a typical form POST if(!isset($_POST)){ $data = file_get_contents(“php://input”); $_POST = json_decode($data); } // handle POST data here $response = [ “firstName”=>”John”, “lastName” => “Doe” ]; //tell the client (iOS app) what type of response you’re sending back to them header(“Content-type: application/json”); //json encode the response array and echo (output it to the response) it out echo json_encode($response); /* should output: { “firstName”:”John”, “lastName”:”Doe” } */ ?>This is obviously a very overly simplified version without any real logic but it should help you navigate a basic POST request from a mobile app.
I’d agree with this based on the comments I’m seeing here. There’s some very obvious misunderstanding going on.
Really cold is great....
Syntactic?
Treat it like you’re eating an elephant. One bit at a time. Any problem can be broken down into smaller logical problems for you to solve.
Is this with short code or long code? No way you were sending that many with long code without distributing it over many numbers.
Where’d they get the numbers from and do they have permission?
I have a hard time believing this list is anywhere near legitimate. Sounds fishy from the start.
Also, good luck with rate limits, not just from Twilio but from the connecting carriers. Twilio can’t help with that. Then you have to managed deliverability events to hopefully try to redeliver it for you because Twilio won’t do that for you automatically either.
You’d likely have to disperse it over 100s of numbers to complete the task with any kind reasonable timeline.
PDO if you want to keep it simple.
Fair enough if you're still learning. Just remember to evaluate your time as you grow as a professional. I got caught in a trap where I started underquoting because I felt "imposter syndrome." I suddenly landed a few big projects and realized that the real world supports more than $25/hr when you do good work and you can increase your own profitability by creating your own library of tools (past code / projects / scaffolds) to work off of. Just keep iterating! Good luck in your endeavors.
What?
That’s incredibly low pricing. Value your time more!
Slim