Send HTML input to PHP Twilio Script -


I'm trying to do, it does not seem that the PHP script is receiving input data from the HTML form.

  & lt; Form action = "sendsms.php" method = "post" & gt; & Lt; Div id = "space" & gt; Cell: & lt; Div & gt; & Lt; Input type = "number" name = "phone" id = "number" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div id = "space" & gt; & Lt; Div & gt; Message & lt; / Div & gt; & Lt; Div & gt; & Lt; Input type = "text" name = "message" id = "message" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div id = "button" & gt; Input type = "submit" name = "send" value = "send" id = "button" & gt; & Lt; / Div & gt; & Lt; / Form & gt;  

This is my PHP file sendsms.php

   Message-> Create (Arrays ('per' = & gt; $ _POST ['phone'];; 'to' = & gt; "+16194523868", 'body' = & gt; $ _ Send message],));  

If you view your form:

  & Lt; Form action = "sendsms.php" method = "post" & gt;  

You are essentially posted in form inputs, so you should see the $ _ POST parameter PHP In the form:

  $ client-> Account-> Message-> Create (Arrays ('to' = & gt; $ _POST ['phone'], 'to' = & gt; "+16194523868", 'body' => $ _POST ['message']));  

Edit

Bus just saw that you have some semicolon (; ) inside the array manifesto Will still break your code


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -