[Nodogsplash] Nodogsplash Error 503, PHP content

rob rob at blue-wave.net
Thu Mar 22 08:47:13 UTC 2018

You need to open port 8079 in nodogsplash.conf "users to router".I would suggest you follow the demo setup EXACTLY to get started - make sure it works and then read the code and requirements  such that you understand how it is working.The redirect to your php from splash.html must pass the required information to fas.php. In turn fas.php then sends at least $tok back to nodogsplash. Only if it also returns $redir pointing at landing.php will landing be invoked.Once you get to grips with all this it is a very simple matter to write your own authentication code to replace fas.php.It does not need to be php at all but does require http/cgi interface of some kind.

Sent from my Samsung device

-------- Original message --------
From: PV Subramanian <pvsub0 at gmail.com> 
Date: 21/03/2018  15:30  (GMT+00:00) 
To: nodogsplash at ml.ninux.org 
Subject: Re: [Nodogsplash] Nodogsplash Error 503, PHP content 

To get my feet wet with FAS:
- On the same Raspberry Pi, installed Apache2, listening on port 8079

- Copied the splash.html from the Github repo into my /etc/nodogsplash/htdocs
- Copied landing.php from Github repo to Apache's /var/www/html
- Tested landing.php responds by visiting, it showed valid messages ("you are authorized" etc)
- Edited splash.html to replace http://onboard-wifi.net/nodog/fas.php with (everything after the ? in the URL string was retained)
This is what I get on my Android device upon trying to sign-in
Webpage not availableThe webpage at not be loaded because:
Hopefully something simple I am missing, thanks for your time and help

On Wed, Mar 21, 2018 at 9:10 AM, PV Subramanian <pvsub0 at gmail.com> wrote:
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
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
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>
// Require the bundled autoload file - the path may need to change// based on where you downloaded and unzipped the SDKrequire __DIR__ . '/twilio-php-master/Twilio/autoload.php';
// Use the REST API Client to make requests to the Twilio REST APIuse 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 list
Nodogsplash at ml.ninux.org


Nodogsplash mailing list

Nodogsplash at ml.ninux.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ml.ninux.org/pipermail/nodogsplash/attachments/20180322/5fdadf70/attachment-0001.htm>

More information about the Nodogsplash mailing list