redirecting index.prg

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

redirecting index.prg

Postby Ruth » Fri Jul 30, 2021 8:01 am

Dear friends,

I have to make a redirection on an existing index.prg.
When I insert the following code I get an error ...
Code: Select all  Expand view
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="refresh" content="2; URL=https://www.winhotel.space/lp/bergland_sillian/landingpage1.prg">
</head>
<body>

<h1>My Website</h1>
<p>Some text...</p>

</body>
</html>
 


The link is https://www.winhotel.space/mm_69RO24_bergland/index.prg

And the error is
Code: Select all  Expand view
Error: Syntax error "syntax error at '<'"
operation: line:1
called from: HB_COMPILEFROMBUF, line: 0
called from: ..\source\exec.prg, EXECUTE, line: 68

Source:


Maybe someone can help me please...very kind regards and thanks in advance
Ruth
User avatar
Ruth
 
Posts: 169
Joined: Fri Dec 07, 2007 1:26 pm

Re: redirecting index.prg

Postby cnavarro » Fri Jul 30, 2021 9:32 am

Dear Ruth
Your index.prg It must have Harbour instructions.
This is a possibility to implement it.
Code: Select all  Expand view


Function Main()
local cHtml

TEXT INTO cHtml
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="refresh" content="2; URL=https://www.winhotel.space/lp/bergland_sillian/landingpage1.prg">
</head>
<body>

<h1>My Website</h1>
<p>Some text...</p>

</body>
</html>
 ENDTEXT

  ? cHtml
Return nil
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: redirecting index.prg

Postby Antonio Linares » Fri Jul 30, 2021 3:03 pm

Dear Ruth,

Code: Select all  Expand view
function Redirect( cUrl )

   AP_RPuts( "<script>window.location.href ='" + cUrl + "'</script>" )

return nil
regards, saludos

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

Re: redirecting index.prg

Postby Ruth » Sat Jul 31, 2021 6:22 pm

Thank you two so much...this made my day :-) now the redirect is working fine...thanks a lot again and have a nice weekend...
User avatar
Ruth
 
Posts: 169
Joined: Fri Dec 07, 2007 1:26 pm

Re: redirecting index.prg

Postby ssbbs » Thu Aug 19, 2021 8:33 am

You can refer to: http://www4.zzz.com.tw/phpBB3/viewtopic.php?f=2&t=356

and you can use:
Code: Select all  Expand view

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="refresh" content="2; URL=https://www.winhotel.space/lp/bergland_sillian/landingpage1.prg">
</head>
<body>

<h1>My Website</h1>
<p><?prg reindex() ?></p>

</body>
</html>
 
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: redirecting index.prg

Postby Otto » Thu Aug 19, 2021 9:15 am

Hello,
Thank you. Very interesting. Can you describe the concept in more detail?
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: redirecting index.prg

Postby ssbbs » Thu Aug 19, 2021 9:30 am

You can use WYSIWYG web design software to design your website and embedded into prg code like PHP in general.
but save file name is .prg not .php
open browser and open the .prg
This is the closest web design mode!
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Re: redirecting index.prg

Postby Antonio Linares » Thu Aug 19, 2021 10:39 am

https://css-tricks.com/snippets/html/meta-refresh/

Very nice to find that there is a lot of interest for mod_harbour from our Chinese brothers :-)
regards, saludos

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

Re: redirecting index.prg

Postby Antonio Linares » Thu Aug 19, 2021 10:41 am

ssbbs wrote:You can use WYSIWYG web design software to design your website and embedded into prg code like PHP in general.
but save file name is .prg not .php
open browser and open the .prg
This is the closest web design mode!


We do appreciate if you could post here some screenshots. It seems very interesting :-)
regards, saludos

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

Re: redirecting index.prg

Postby ssbbs » Sat Aug 21, 2021 4:55 am

*2021.08.21: fix
1. Fix: If there is no'<?prg' and '?>' in the entire webpage, it will cause a failure error message.

2. New addition: <?php ... ?> and <?prg ... ?> can be executed simultaneously in HTML.
Description: The execution order: first execute PHP code before execution PRG code.
This function cannot be executed correctly when the extension is .hrb, because .hrb is pre-compiled and cannot be called again to recompile PHP!
It must be set to call to get php under the path (SET PATH=...).
Or to set environment variables: 'PHP_PATH'

Execution result & part of the code:
Image

download it:
line ID: ssbbstw
WeChat ID: ssbbstw
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan


Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 2 guests