Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Anyone want a small web app written in PHP? - Page 3
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Anyone want a small web app written in PHP?

13»

Comments

  • @NickGH said: If you want to run privileged commands, you'd have to give "root" privileges to apache which poses a lot of security risk.

    or you could take advantage of sudo ;)

    That said, shell_exec and associated functions are rarely ever recommended for anything. People will suggest you build your own extension before they suggest using passthrough/system/shell_exec.

  • @Wintereise said: People will suggest you build your own extension before they suggest using passthrough/system/shell_exec.

    Which sounds hard

  • @raindog308 said: Why not Ajaxterm?

    I can't get it to work :$. All I get are the three buttons in the top left corner and nothing else.

    I'll give it a try, thanks :)

  • bnmklbnmkl Member
    edited April 2013

    I do too @yomero ;_;

    No worries @twain :) The imagettfbbox function was the main solution to your problem.

  • twaintwain Member

    @bnmkl - tested and works great for the text variable to be new everytime from a new 'pwgen -ny 12'. And part of the problem is passing that command into a variable only takes the first password too... anyway I'll keep banging my ahead against this one.

  • bnmklbnmkl Member
    edited April 2013

    @twain ... passing that command into a variable only takes the first password

    Strange, lol. I will have a look at putting pwgen output into a PHP variable later.

    What is your output for :

    <?php
    
    $pwgen = `pwgen -ny 12`;
    echo $pwgen;
    
    ?>
    
  • twaintwain Member

    @bnmkl

    bash-4.1$ cat pwgentest.php 

    <?php $pwgen = `/Users/indigodaddy/bin/pwgen -ny 12`; echo $pwgen; ?>

    bash-4.1$ php pwgentest.php 
    aequ.ee1kei0

  • bnmklbnmkl Member
    edited April 2013

    Definitely strange @twain.

    I would assume it is related to the special characters, but the example below works.

    strings.txt

    Uo/thengohy5 phie=Tahw8ko Cohh1seiz]ua ooY@ee4chei) noo}Mioyei5u au$x5Isaigho
    aht6vahGia{j aeph8yoh#kuY EeNgees#ae4k boh5yie1Ic\e aiSh5bahp]ai kiex%ahL0Oob
    bei|G{ohm8ae Ieth|ee|wee9 koo@R2iZeot" Nai5Phain(ie Oam*ub0thoth quu6Eyimohd-
    geeNgool}ee1 Oow5Pie_sija ab#ahcoo8eeJ ahcoe_r6Vae3 pi%wiedeit4A biegh}u@vu6K
    euwei.gei9Of ahr?ai2UquaZ ha3eiXee"koo eiLohf*u1sao ave&aqui8Hie oc-a@z'oh1Le
    iv$eeX0eo0Wu rel7aGh6gee& baig3ooN%uz, eoj9eGo.haih Aoka4Uizae:r aiG6aiP.iera
    IaY?oo0Aibai pekaeth5Aeh% taav*eiK5Soo zohL5haeng?o teT^u3yash3S xudoh%Dai4ph
    tho`R\ahd7ae ohf#e9Ceeph7 Uce7ou{woe8o eeb9jo!Y#aep la7Voo.chae7 te;y5Choo4ie
    neeZ5out'oo) ze{iw4Aethok fah3Shoh^Re9 Quoo8au%koot xo2chu>Lae0e Shee#g1eibak
    que5Og3aiN&e aw(eetooJ5Ei aeV8ging(eib ohGh9Chah[ch ieYiv5gagh-a kahm2yohR%uo
    Eiraivi!o}W0 eo0Oot{ai5sh saT[ae2ahj5O Aefae,l5ieth jo0iJ,ai5eih deer9Aigol'i
    aet1Ce,za+fi OFi3exoh)ng3 tae7ooGhaim/ nei$V8Ohh!ae eiy~ia4Itoh; Baisish+ai5d
    iib+ooHaoj4t Ayac3aiCh>ee ka/eChoosh2c vanu1Zeex#uy phieB(ai8iev Ou|Gh3zuwo,f
    ool3AxiNo~ch zai3Eew&ie*w Zee7eey4eJ*o kooree9Va>B5 FaiB-ah8yahK oha4uP3Othv1M 
    ae5re8yaXuw% gei5rua1Lu/i eeNg3uyaf"ei Ootee|h8Shai
    sa6ed0nieF+e aed8rah;Kai4 boghahH]a7ei eiba$Roh5uu' Ook6oonae`th Vai9taer#oo?
    aich7ohMoi/d Ohh1ew-aa"xi Eig%ae]jo2ne urooX1iagh|u iiY8reew,i8d eGhee4fahw(a
    ieS%ai1ieh4e pun9Ich0jee; Waer_ai1ieph re)Che`xud0A Aek2wioh\a2u deedae0Ai[be
    ohr!a4Ohtae* keNai8aes%oh ookiM3uiRei~ fei-Boo2tu3i coo=c4Yie?w8 ThaiN7fe$o"t
    ahw[uChae3va Ej5Evaa&Giix seat|eeZ1yae ee5wiengo]Ba Oo2aThu^p!ai ez{i4too8ohD
    

    pwgen.sh

    #!/bin/bash
    
    cat strings.txt
    
    

    pwgen.php

    <?php
    
    $pwgen = `./pwgen.sh`;
    echo $pwgen;
    
    ?>
    
  • bnmklbnmkl Member

    Haha. Actually tried pwgen and had the same problem @twain. Solved though by being more specific and formatting in PHP.

    index.php

    <?php
    
    $PW_LENGTH   = 12;
    $NUM_OF_PW   = 120;
    $LINE_LENGTH = 78;
    
    $text = `pwgen -ny $PW_LENGTH $NUM_OF_PW`;
    $text = str_replace("\n", ' ', $text);
    $text = wordwrap($text, $LINE_LENGTH, "\n");
    
    require('./class.TextImage.php');
    
    try {
        $image = new TextImage();
    //  $image->setFontSize(14);
    //  $image->setBackgroundColour('000');
    //  $image->setTextColour('d4d4d4');
        $image->setText($text);
        $image->render();
    } catch (Exception $e) {
        die($e->getMessage());
    }
    
    // END
    
    
  • twaintwain Member
    edited April 2013

    @bnmkl - Wow that's awesome man!

    http://indigodaddy.koding.com/pwgen-test/

    I'm just learning php, so now I am going to sit down and try to understand as much as possible about everything you did here.. (which was a LOT.. thanks so much!)

    To me this is an interesting project, I'll probably put it up on a real domain with https just for the heck of it.. you will be credited, let me know the credit/link you want me to add when I put it up..

  • bnmklbnmkl Member

    It is all yours @twain :)

    I have always remembered you after discovering that you are a fellow Puppy Linux fan.

Sign In or Register to comment.