Great news regarding mod_harbour CGI !!!

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

Re: Great news regarding mod_harbour CGI !!!

Postby Antonio Linares » Wed Nov 23, 2022 6:23 pm

Si sigues con dificultades, enviame un email y nos concectamos por anydesk y vemos juntos que sucede :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Great news regarding mod_harbour CGI !!!

Postby Otto » Wed Nov 23, 2022 6:49 pm

Adhemar, can you test with this?

main.prg

Code: Select all  Expand view  RUN
Function main
local cAyS:="AyS",cArM:="ArM",cFyH:="FyH",cAyC:="AyC",cRyD:="RyD",cTyH:="TyH",cBel:="Bel",cMed:="Med",cCla:="Cla",cOes:="Oes",cCri:="Cri",cTod:="Tod"

TEMPLATE PARAMS cAyS,cArM,cFyH,cAyC,cRyD,cTyH,cBel,cMed,cCla,cOes,cCri,cTod

<!DOCTYPE html>
<html lang="es">

<head>
  <meta charset="utf-8">
    <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />
    <meta name="viewport" content="width=device-width, initial-scale=0.8">
   
    <meta name="description" content="">
    <meta name="author" content="Adhemar Cuéllar R.">
    <meta name="copyright" content="AcrSoft System ©2022">
    <link rel="icon" href="images/MovieCenter.ico" type="image/x-icon">
    <link rel="shortcut icon" href="images/MovieCenter.ico" type="image/x-icon">
    <title>MovieCenter</title>

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
   
</head>

<body>
    <div class="container">
      <center><b><h7>MOVIE CENTER La mejor opci&oacute;n para elegir que mirar</h7></b></center>
      <div align="center"><img src="cgi-bin/images/poster.jpg" width="200" height="250"></div>
         <center><b><h6>PEL&Iacute;CULAS</h6></b></center>
        <center>
           
        <a href="muestradatos.prg?tipo=<?prg return cAyS ?>">
            <img src="images/ays.jpg" width="90" height="60"></a>
        <a href="muestradatos.prg?tipo=<?prg return cArM ?>">
            <img src="images/arm.jpg" width="90" height="60"></a>
        <a href="muestradatos.prg?tipo=<?prg return cFyH ?>">
            <img src="images/fyh.jpg" width="90" height="60"></a>
        <a href="muestradatos.prg?tipo=<?prg return cAyC ?>">
            <img src="images/ayc.jpg" width="90" height="60"></a>
        <br>
   
        <a href="muestradatos.prg?tipo=<?prg return cAyS ?>">
            <button type="button" class="btn btn-sm btn-success">Acción <br> Suspenso</button></a>
                &nbsp;&nbsp;&nbsp;
        <a href="muestradatos.prg?tipo=<?prg return cArM ?>">
            <button type="button" class="btn btn-sm btn-success">Artes<br>Marciales</button></a>
        &nbsp;&nbsp;&nbsp;
        <a href="muestradatos.prg?tipo=<?prg return cFyH ?>">
            <button type="button" class="btn btn-sm btn-success">Ficci&oacute;n <br> H&eacute;roes</button></a>
            &nbsp;&nbsp;&nbsp
        <a href="muestradatos.prg?tipo=<?prg return cAyC ?>">
            <button type="button" class="btn btn-sm btn-success">Aventuras <br> Comedias</button></a>
        <br><br>   
       
        <a href="muestradatos.prg?tipo=<?prg return cRyD ?>">
            <img src="images/ryd.jpg" width="90" height="60"></a>
        <a href="muestradatos.prg?tipo=<?prg return cTyH ?>">
            <img src="images/tyh.jpg" width="90" height="60"></a>
        <a href="muestradatos.prg?tipo=<?prg return cBel ?>">
            <img src="images/bel.jpg" width="90" height="60"></a>
        <a href="muestradatos.prg?tipo=<?prg return cMed ?>">
            <img src="images/med.jpg" width="90" height="60"></a>
        <br>   
           
        <a href="muestradatos.prg?tipo=<?prg return cRyD ?>">
            <button type="button" class="btn btn-sm btn-success">Romance <br> Drama</button></a>
            &nbsp;&nbsp;&nbsp;&nbsp;
        <a href="muestradatos.prg?tipo=<?prg return cTyH ?>">
            <button type="button" class="btn btn-sm btn-success">Terror <br> Horror</button></a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="muestradatos.prg?tipo=<?prg return cBel ?>">
            <button type="button" class="btn btn-sm btn-success">B&eacute;licas <br> Guerra </button></a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="muestradatos.prg?tipo=<?prg return cMed ?>">
            <button type="button" class="btn btn-sm btn-success">Medieval <br> Ed.Media</button></a>
       
        <br><br>
        <a href="muestradatos.prg?tipo=<?prg return cCla ?>">
            <img src="images/cla.jpg" width="90" height="60"></a>
        <a href="muestradatos.prg?tipo=<?prg return cOes ?>">
        <img src="images/oes.jpg" width="90" height="60"></a>
        <a href="muestradatos.prg?tipo=<?prg return cCri ?>">
            <img src="images/cri.jpg" width="90" height="60"></a>
        <a href="muestradatos.prg?tipo=<?prg return cTod ?>">
            <img src="images/todas.jpg" width="90" height="60"></a>
        <br>

            <a href="muestradatos.prg?tipo=<?prg return cCla ?>">
            <button type="button" class="btn btn-sm btn-success">Cl&aacute;sicas</button></a>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <a href="muestradatos.prg?tipo=<?prg return cOes ?>">
            <button type="button" class="btn btn-sm btn-success">Oeste</button></a>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <a href="muestradatos.prg?tipo=<?prg return cCri ?>">
            <button type="button" class="btn btn-sm btn-success">Cristianas</button></a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="muestradatos.prg?tipo=<?prg return cTod ?>">
            <button type="button" class="btn btn-sm btn-success">Todas</button></a></center>
        <br>
         <center><b><h6>TV-SERIES - TELENOVELAS</h6></b></center>      
        <br><br><br>
        <a href="https://adhemarcr.github.io/acrsoft/"> <img
                src="images/lAcrSoft.jpg" align="left"> <br>&nbsp; Soluciones Inform&aacute;ticas
            <br>&nbsp;Analista de Sistemas-FRELANCE</a>
        </div>
    </div>
</body>

</html>

ENDTEXT

return


muestradatodatos.prg

Code: Select all  Expand view  RUN

#define PATH_DATA       HB_GetEnv( "PRGPATH" ) + '/data/'

REQUEST HB_CODEPAGE_ES850
REQUEST DBFCDX
REQUEST DBFFPT

Function Main()
  Local cAlias,aRows := {},cRows,cTit:="TODAS"

  local hHash         := AP_GetPairs()
  local cTipo := ""
  ? ValToChar( hHash )
  ? hb_HGetDef(hHash,"tipo", "no" )


  logline( "hHash", ValToChar( hHash ) )
  logline( "hHash-key", hb_HGetDef(hHash,"tipo", "no" ) )
 
  cTipo := hb_HGetDef(hHash,"tipo", "no" )
  If cTipo="AyS"
    cTit:="ACCI�N - SUSPENSO"
  ElseIf cTipo="FyH"
    cTit:="FICCI�N - H�ROES"
  ElseIf cTipo="ArM"
    cTit:="ARTES MARCIALES"
  ElseIf cTipo="AyC"
    cTit:="AVENTURA - COMEDIA"
  ElseIf cTipo="RyD"
    cTit:="ROMANCE - DRAMA"
  ElseIf cTipo="TyH"
    cTit:="TERROR - HORROR"
  ElseIf cTipo="Bel"
   cTit:="B�LICAS - GUERRA"
  ElseIf cTipo="Med"
   cTit:="MEDIEVALES - EDAD MEDIA"
  ElseIf cTipo="Cla"
   cTit:="CL�SICAS - ANTIGUAS"
  ElseIf cTipo="Oes"
   cTit:="OESTE - PISTOLEROS"
  ElseIf cTipo="Cri"
   cTit:="CRISTIANAS - RELIGIOSAS"
  ElseIf cTipo="Tod"
   cTit:="MUESTRA  TODAS"
  Endif
 
  USE (  PATH_DATA+'movies.dbf' ) SHARED NEW VIA 'DBFCDX'
  If cTipo="Tod"
    INDEX ON field->nombre TAG "nombre"  MEMORY    
  Else
    INDEX ON field->nombre TAG "nombre" FOR field->tipo=cTipo MEMORY       
  Endif

  cAlias := Alias()
  Do While !Eof()
    Aadd( aRows,  { 'nombre'    =>  (cAlias)->nombre ,;
                             'duracion' => (cAlias)->duracion   ,;
                             'reparto'  => (cAlias)->reparto ,;                    
                             'nomchar'  => (cAlias)->nomchar    })
     (cAlias)->( dbskip() )
  EndDo
  USE  
  cRows:=hb_jsonencode(aRows)

  TEMPLATE PARAMS cRows,cTit

  <!DOCTYPE html>
  <html lang="es">
  <html>
    <head>
     <meta name="viewport" content="width=device-width, initial-scale=0.7">
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
     <link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.css">
     <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
     <link rel="icon" href="images/admcon.ico" type="image/x-icon">
     <link rel="shortcut icon" href="admcon.ico" type="image/x-icon">
     <title>Movie Center</title>
     
     <div class="container">
       
             <center><b><h5>  <?prg return cTit ?> </h5></b></center>
           
       </div>
     <style>
        .fixed-height {
            height: 200px;
            overflow-y: auto;
        }
         thead {
                background-color: Grey;
                color: white;
            }
     </style>
   </head>
   <body>

     <div class="container ">  
          <div class="fixed-table-container fixed-height" style="height: 350px; padding-bottom: 35.5938px;">
            <table id="table" table-bordered data-toggle="table" data-show-footer="true" data-search="true">
                <thead>
                    <tr>
                        <th data-field="nombre"  data-footer-formatter="totalFormatter" data-sortable="true">NOMBRE</th>
                        <th data-field="duracion" data-footer-formatter="cuantosFormatter">DURA</th>
                        <th data-field="reparto" data-sortable="true" >REPARTO</th>
                        <th data-field="nomchar" </th>
                    </tr>
                </thead>
            </table>
          </div>  
    </div>
    <script>
        var picture = new Intl.NumberFormat('en-US');
       
        function totalFormatter() {
         return 'Totales '
        }
        function cuantosFormatter(data) {
        return picture.format(data.length)
        }
        var $table = $('#table')
        $(function() {
            var data =  <?prg return  cRows ?>
            $table.bootstrapTable({data: data})
            $table.bootstrapTable('hideColumn', 'nomchar')
        })
       
    </script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    <script src="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.js"></script>
    <script src="https://unpkg.com/bootstrap-table@1.18.3/dist/extensions/print/bootstrap-table-print.min.js"></script>

   </body>
    <div class="container">
       <center><a href="javascript&#058; history.go(-1)">Volver</a></center>
         <br>
       <a href="https://adhemarcr.github.io/acrsoft/"> <img
            src="images/lAcrSoft.jpg" align="left"> <br>&nbsp; Soluciones Inform�ticas
            <br>&nbsp;&nbsp;Analista de Sistemas-FRELANCE</a>
           </div>
  </html>
ENDTEXT
Return
*
INIT PROCEDURE PrgInit
  HB_SetCodePage("ESWIN");HB_CDPSELECT("ESWIN")
  rddSetDefault( "DBFCDX" )
  SET CENTURY OFF
  SET EPOCH TO YEAR(DATE())-50
  SET DELETED ON
  SET EXCLUSIVE OFF
  SET DATE TO FREN
  SET( _SET_SOFTSEEK, .T. )
  EXTERN DESCEND
Return




function logline( cText, cWert )
  local cLog
  cLog := memoread( hb_GetEnv( "PRGPATH" ) + "/prg.log" )
 
  if VALTYPE(cText) = "U"
     cText := ""
  endif  
  if VALTYPE(cWert) = "U"
     cWert := ""
  endif  
  cLog   +=  ALLTRIM( str(procline(1)) ) + "    "  + PadR( cText, 60 ) + ":  " + cWert + CRLF
 
  MEMOWRIT( hb_GetEnv( "PRGPATH" ) + "/prg.log" , cLog, .f. )
 
return nil
//----------------------------------------------------------------------------//

 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Great news regarding mod_harbour CGI !!!

Postby acuellar » Wed Nov 23, 2022 7:03 pm

Gracias Antonio y Otto

Con
Code: Select all  Expand view  RUN

"AyS" $ AP_Args()  //Funciona Perfecto.
 


Ahora falta lo de las imágenes.

Antonio aquí el AnyDesk 621 486 441

Gracias por la ayuda
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1644
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Great news regarding mod_harbour CGI !!!

Postby Antonio Linares » Thu Nov 24, 2022 7:17 am

La carpeta con las imágenes tienes que ponerla en la carpeta htdocs/images y listo, funcionando bien :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Great news regarding mod_harbour CGI !!!

Postby acuellar » Thu Nov 24, 2022 2:18 pm

No funciona :(
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1644
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Great news regarding mod_harbour CGI !!!

Postby Otto » Thu Nov 24, 2022 4:07 pm

Dear Antonio,
I am also getting errors with pictures.
With kind regards,
Otto


Code: Select all  Expand view  RUN


500
Internal Server Error
VersionHTTP/1.1
Übertragen1,03 kB (1,17 kB Größe)
Referrer Policystrict-origin-when-cross-origin
Anfrage-PrioritätHigh

   
Accept-Ranges
    bytes
Connection
    close
Content-Encoding
    gzip
Content-Language
    de
Content-Length
    694
Content-Type
    text/html; charset=utf-8
Date
    Thu, 24 Nov 2022 16:00:23 GMT
Server
    Apache/2.4.43 (Win64) OpenSSL/1.1.1b PHP/7.4.5
Vary
    accept-language,accept-charset,Accept-Encoding
   
Accept
    image/avif,image/webp,*/*
Accept-Encoding
    gzip, deflate, br
Accept-Language
    de,en-US;q=0.7,en;q=0.3
Connection
    keep-alive
Host
    xxxxx.com
Referer
    https://xxxxx.com/cgi-bin/moviecenter/main.prg
Sec-Fetch-Dest
    image
Sec-Fetch-Mode
    no-cors
Sec-Fetch-Site
    same-origin
User-Agent
    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0




********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Great news regarding mod_harbour CGI !!!

Postby Antonio Linares » Thu Nov 24, 2022 6:16 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Great news regarding mod_harbour CGI !!!

Postby Otto » Thu Nov 24, 2022 7:28 pm

Dear Antonio,
my source code look the same as you posted.
You can access my copy.

But here it is not working:

<img src="images/ays.jpg" width="90" height="60">

This is the path Total Ccommander shows:
c:\xampp\cgi-bin\MovieCenter\images\ays.jpg

https://winhotel.org/cgi-bin/MovieCenter/Main.prg

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Great news regarding mod_harbour CGI !!!

Postby Antonio Linares » Thu Nov 24, 2022 7:37 pm

Dear Otto,

You can not read files from the cgi-bin folder

Please keep the images in a folder inside htdocs

that simple :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Great news regarding mod_harbour CGI !!!

Postby Otto » Thu Nov 24, 2022 7:37 pm

Dear Antonio,
Here is one of my programs which also shows the problem.
Password: 123 slide from 1 to 3

CGI

https://winhotel.org/cgi-bin/demo/admin.prg

Same code APACHE

https://winhotel.org/demo/admin.prg

Best regards,
Otto
Last edited by Otto on Thu Nov 24, 2022 7:39 pm, edited 1 time in total.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Great news regarding mod_harbour CGI !!!

Postby Antonio Linares » Thu Nov 24, 2022 7:38 pm

Apache does not allow to read from cgi-bin folder

Use htdocs folder to keep the images
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Great news regarding mod_harbour CGI !!!

Postby Otto » Thu Nov 24, 2022 7:54 pm

Dear Antonio,
I think I got something wrong with CGI.
I turned off the APACHE server and now the cgi-bin web page doesn't work anymore.

Probably cgi is not installed correctly after all.

Does cgi need an APACHE server?

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Great news regarding mod_harbour CGI !!!

Postby acuellar » Thu Nov 24, 2022 8:23 pm

Estimado Antonio

Aquí están las imágenes y no las muestra :(
Code: Select all  Expand view  RUN

C:\Apache24\htdocs\images
 
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1644
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Great news regarding mod_harbour CGI !!!

Postby Otto » Thu Nov 24, 2022 8:28 pm

Dear Adhemar, Do you have a running APACHE on the same system?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Great news regarding mod_harbour CGI !!!

Postby acuellar » Thu Nov 24, 2022 8:41 pm

yes
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1644
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

PreviousNext

Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 8 guests