gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

Control LED via web interface

Fri Aug 21, 2015 9:33 am

Hello!
I've been searching for an answer for this for a long time now, but I can't get it.
I have nginx installed with php and wiringpi.
The wiringpi commands work.
I tried making a pinon.php and pinoff.php with system() function.
That works.
Now if I have a email.py function that sends data to my email and I want to run it, how do I do it threw web interface? :D
Thx

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Control LED via web interface

Fri Aug 21, 2015 3:01 pm

Why not do all the email stuff in php?

Code: Select all

        $subject = "Challenge board ".$title;
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers .= 'From: example@changeme.co.uk'."\r\n";
        $message = "<html><body>Dear ".$greet.",<p>\r\n";
        $message . ="Please click this link:<br>\r\n<a href=".$new_URL."uuid=".$uuid."&user_id=".$user_id.">".$linktext."</a>\r\n<br>to ".$reason."<p>\r\n";
        $message .= "Or paste this link<p>\r\n".$new_URL."uuid=".$uuid."&user_id=".$user_id."\r\n";
        $message .= "<p>into your browser to ".$reason."<p>\r\n";
        $message .= "Thank you, Your challenge team<p>\r\n";
        $message .= "\r\n<p><p>".$msgid."-".$user_id."-".date("ymdHis")."\r\n";
        $from="-f example@changeme.co.uk";
        mail($to, $subject, $message, $headers, $from);
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

Re: Control LED via web interface

Fri Aug 21, 2015 3:04 pm

I actually fixed with with help of this youtube video --> https://www.youtube.com/watch?v=WpM1aq4B8-A

Return to “General discussion”