[Nodogsplash] Nodogsplash Error 503, PHP content

PV Subramanian pvsub0 at gmail.com
Wed Mar 21 13:10:34 UTC 2018


Hello: Thank you for the detailed response Rob.

The PHP is hosted on the Raspberry Pi as well. Its (almost) a standalone
system since the the only connection to the Internet is Twilio.

I wonder:

- could I go the Python route instead?
- could I (somehow) run the PHP via CGI

Regards

On Tue, Mar 20, 2018 at 2:22 PM, Rob <rob at blue-wave.net> wrote:

> Where is the php hosted? NodogSplash does not support php, hence the Error
> 503.
> To do this you will need NodogSplash FAS:
> http://nodogsplash.readthedocs.io/en/latest/authentication.html
>
> https://github.com/nodogsplash/nodogsplash/tree/
> master/forward_authentication_service
>
> There is a very simple test server still up at the time of writing making
> it easy to test and get to grips with FAS.
> It is quite simple once you have figured out the principle. Give it a try.
> You will need to modify your code to return at least $tok back to the url
> in $authaction.
> --
> Blue Wave Projects and Services, specialists in networks and wireless data
> services.Low cost Public WiFi Hotspots with Zero subscription costs.
> http://blue-wave.net
>
> On Tue, 2018-03-20 at 12:47 -0400, PV Subramanian wrote:
>
> Hello:
>
> I am using Nodogsplash on a Raspberry Pi 3. The captive portal is a form
> that takes a phone number and a message, and the form action calls a PHP
> file, which sends the message to the phone number using Twilio (which turns
> it into an SMS).
>
> The setup has been tested on a PC, works fine.
>
> When moved to the htdocs folder, I get an Internal Server Error 503.
>
> Thank you for guidance
>
> ---HTML file start---
> <html>
> <body>
>
> <form action="form_to_sms.php" method="post">
> Phone: <input type="text" name="phone"><br>
> Mesage: <input type="text" name="body"><br>
> <input type="submit">
> </form>
>
> </body>
> </html>
> ---HTML file end---
>
> ---PHP file start---
> <html>
> <body>
>
> <p>Sending ...</p>
>
> <?php
>
> // Require the bundled autoload file - the path may need to change
> // based on where you downloaded and unzipped the SDK
> require __DIR__ . '/twilio-php-master/Twilio/autoload.php';
>
> // Use the REST API Client to make requests to the Twilio REST API
> use Twilio\Rest\Client;
>
> // Credentials to connect to Twilio
> $sid = 'AC1234xxx';
> $token = '8a18ccxxx';
>
> // Twilio number the SMS message will be from. You can only send SMS
> messages from a number purchased from Twilio.
> $from = '+12223334444;
>
> // Create a connection to Twilio's API with credentials
> $client = new Client($sid, $token);
>
> // Actually send the number. This is where the magic happens!
> if(!empty($_POST['phone']) && !empty($_POST['body'])){
>
> // Use the client to do fun stuff like send text messages!
> $client->messages->create(
>     // the number you'd like to send the message to
>     $_POST['phone'],
>     array(
>         // A Twilio phone number you purchased at twilio.com/console
>         'from' => $from,
>         // the body of the text message you'd like to send
>         'body' => $_POST['body']
>     )
> );
> }
> echo "Message sent, press Back button"
> ?>
> </body>
> </html>
> ---PHP file end---
>
> _______________________________________________
> Nodogsplash mailing listNodogsplash at ml.ninux.orghttp://ml.ninux.org/mailman/listinfo/nodogsplash
>
>
> _______________________________________________
> Nodogsplash mailing list
> Nodogsplash at ml.ninux.org
> http://ml.ninux.org/mailman/listinfo/nodogsplash
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ml.ninux.org/pipermail/nodogsplash/attachments/20180321/47823694/attachment.htm>


More information about the Nodogsplash mailing list