ST*W for "flowchart". 😃
Begin with the purpose of the script. What should it do? Try and make the description as exact and informational as possible.
Next, think through the steps you'll need to accomplish this purpose. Not in terms of PHP or any computer language --- the actual process of doing something...
Say you want to write a script to send a text message to your cell phone. What are the steps?
Determine who's sending the message (and probably if you want them to be permitted to do so...).
Determine the content of the message. Are there any characters that won't be permitted? What's the maximum length? What about the possibility of unexpected or hostile input?
Determine the basic technology used to send the message (i.e., will [man]mail/man take care of this for you, or do you need something else...?
Determine the possible outcomes of the script.
I'd advise making a flow chart in the time-honored tradition of programming 🙂 Here's one ...
Then, for each block in your chart, you need to find a block of code, a function in PHP, or a function you create, that does that specific procedure.
String them together, and test.
Report problems here --- specific problems, after spending some time at Google and using this forum's search engine for a few minutes. Post a well-worded question, with good spelling and punctuation, that tells what you've done, what you expected to happen, and what happened instead, and then post the code, using the
vbCode tags...