Revigniter Basics
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Revigniter Basics
Hi Ralph,
well if they don't set the forum back to the state where it was...
I did what you asked in your last message. And to remind, this was the outcome:
after line 19:
system
after line 64:
C:/Portable/xampp/htdocs/lc2/index.lc/blog
after line 70:
C:/Portable/xampp/htdocs/lc2/system
and
An Error Was Encountered
The URI you submitted has disallowed characters.
well if they don't set the forum back to the state where it was...
I did what you asked in your last message. And to remind, this was the outcome:
after line 19:
system
after line 64:
C:/Portable/xampp/htdocs/lc2/index.lc/blog
after line 70:
C:/Portable/xampp/htdocs/lc2/system
and
An Error Was Encountered
The URI you submitted has disallowed characters.
Re: Revigniter Basics
Indeed, some of our posts have gone. Furthermore I had to
renew my password to be able to log in.
I can imagine that you are slowly but surely going cracy,
but could you please check the value of sUriString right
after:
in handler _rigExplodeSegments of library URI.livecodescript?
renew my password to be able to log in.
All correct.
I can imagine that you are slowly but surely going cracy,
but could you please check the value of sUriString right
after:
Code: Select all
# SEGMENT BASED URLs
if gConfig["enableQueryStrings"] is not TRUE then
replace "\\" with "/" in sUriString
if char 1 of sUriString is "/" then
put char 2 to -1 of sUriString into sUriString
end if
set the itemDelimiter to "/"
-- Ralf Bitter
Re: Revigniter Basics
It must work, but yes a bit, nevertheless, it's not build for nothing.
You believe in it and have years spend. Maybe if it works and we fix this then maybe we can start building
Bugs can happen everywhere. Livecode itself has also some long standing bugs and we have to be patient else we should become better programmers and build software with C++ or whatever more difficult language.
sUristring is index.lc\blog
Re: Revigniter Basics
The thing is that your server environment behaves quite different.sphere wrote: ↑Mon Aug 26, 2019 6:18 pmIt must work, but yes a bit, nevertheless, it's not build for nothing.
You believe in it and have years spend. Maybe if it works and we fix this then maybe we can start building
Bugs can happen everywhere. Livecode itself has also some long standing bugs and we have to be patient else we should become better programmers and build software with C++ or whatever more difficult language.
But with your friendly support we can find the required adjustments.
sUriString should be “blog”
OK, let’s analyse this issue step by step. Following my assumptions.
According to your infos the value of $_SERVER["PATH_TRANSLATED"] is
C:\Portable\xampp\htdocs\lc\index.lc\blog
So, the value of the local variable sURIstring right after:
Code: Select all
if tUri is "PATH_TRANSLATED" then
put $_SERVER["PATH_TRANSLATED"] into sUriString
C:\Portable\xampp\htdocs\lc\index.lc\blog
right? After the next 3 lines the backslashes in sUriString are replaced
with slashes, so the value is
C:/Portable/xampp/htdocs/lc/index.lc/blog
right? Then after line:
Code: Select all
put char offset("index" & gRigA["EXT"], sUriString) to -1 of sUriString into sUriString
index.lc/blog
right? After the next line:
Code: Select all
put "/" & item 2 to -1 of sUriString into sUriString
/blog
should be blog, but it doesn’t matter in this case. Anyway you should replace
this line with:
Code: Select all
put item 2 to -1 of sUriString into sUriString
Code: Select all
put rigUriAdjusted(sUriString) into sUriString
blog
Exact this value is used in handler _rigExplodeSegments of URI.livecodescript
which checks for disallowed characters in URI segments (in this case in “blog”)
using the _rigFilterUri() function. This function yields the “The URI you submitted has
disallowed characters.” error, in case a segment includes disallowed characters.
And this is the error you see because according to your info the value of sUriString
in your tests is “index.lc\blog” which of course includes disallowed characters.
But provided that my considerations are right how can sUriString be “index.lc\blog”?
How can sUriString include a backslash although backslashes are replaced?
Are you really sure that gConfig["uriProtocol"] in config.lc is set to "PATH_TRANSLATED”?
-- Ralf Bitter
Re: Revigniter Basics
Hi Ralph,
yes i understand your thinking.
And yes i'm sure it's set correct.
sUriString is still with backslash Maybe the issue is that it does not work ok with Xampp.
Perhaps that when it is put on VPS that it works correct. i did not try it yet.
I'd like to test things locally first, before putting it on a live server.
Maybe you are willing to install Xampp: https://www.apachefriends.org/download.html
So it becomes easier for you to figure out why it is not working as supposed?
I expect you would have the same results.
But while writing this and looking to what you meant, which i did not get completely:
I understand that the backslash was an issue
I tried this:
and this seems to work now:
yes i understand your thinking.
And yes i'm sure it's set correct.
sUriString is still with backslash Maybe the issue is that it does not work ok with Xampp.
Perhaps that when it is put on VPS that it works correct. i did not try it yet.
I'd like to test things locally first, before putting it on a live server.
Maybe you are willing to install Xampp: https://www.apachefriends.org/download.html
So it becomes easier for you to figure out why it is not working as supposed?
I expect you would have the same results.
But while writing this and looking to what you meant, which i did not get completely:
But it doesn't matter further.should be blog, but it doesn’t matter in this case. Anyway you should replace
this line with:
Code: Select all
put item 2 to -1 of sUriString into sUriString
After line:
Code: Select all
put rigUriAdjusted(sUriString) into sUriString
I understand that the backslash was an issue
I tried this:
Code: Select all
# SEGMENT BASED URLs
if gConfig["enableQueryStrings"] is not TRUE then
replace "\\" with "/" in sUriString
if char 1 of sUriString is "/" then
put char 2 to -1 of sUriString into sUriString
end if
replace "\" with "/" in sUriString -------i added this line in URI.livecodescript
set the itemDelimiter to "/"
###########test##########
put "sUriString = " & sUriString
####################################
Re: Revigniter Basics
Found the mistake. Sorry, didn’t see the forest for the trees.
The source of the issue was a copy/past thingy.
The flaw is in:
of the additional code in function _rigFetchUriString of URI.ivecodescript.
must read
You see, the variable name was wrong.
Here is the code to be added to system/libraries/URI.livecodescript
right after line 225 (end if) again:
The source of the issue was a copy/past thingy.
The flaw is in:
Code: Select all
if the platform is "Win32" is TRUE then
replace "\" with "/" in sTempPath
end if
Code: Select all
replace "\" with "/" in sTempPath
Code: Select all
replace "\" with "/" in sUriString
Here is the code to be added to system/libraries/URI.livecodescript
right after line 225 (end if) again:
Code: Select all
if tUri is "PATH_TRANSLATED" then
put $_SERVER["PATH_TRANSLATED"] into sUriString
if the platform is "Win32" is TRUE then
replace "\" with "/" in sUriString
end if
put char offset("index" & gRigA["EXT"], sUriString) to -1 of sUriString into sUriString
set the itemDel to "/"
put item 2 to -1 of sUriString into sUriString
# IF THE URI CONTAINS ONLY A SLASH WE'LL KILL IT
if sUriString is "/" then
put "" into sUriString
end if
put rigUriAdjusted(sUriString) into sUriString
return sUriString
end if
-- Ralf Bitter
Re: Revigniter Basics
I copied a new URI.livecodescript from the zip and copied the snippet into it.
It works as expected now!
I already today started with the chat script and got the first login page.
So tomorrow i will continue with that and see if it works with this URI file.
Thank you Ralph for staying patient , you're the best
It works as expected now!
I already today started with the chat script and got the first login page.
So tomorrow i will continue with that and see if it works with this URI file.
Thank you Ralph for staying patient , you're the best
Re: Revigniter Basics
Don't think i'm doing nothing...
As i know a bit of html and a bit of css, just enough to alter some things of Joomla templates and such.
But it's not enough...
So i'm following the excellent written course on internetingishard.com, it tells you all from scratch how to use HTML & CSS. And it's free of any charge.
I'm starting lesson 9 today, and taking it easy as i just got surgery on my knee friday a week ago.
As it is a easy and good read with nice to do examples i hope to get the grip soon and start with some simple tests to use the cgi server/revigniter/html&css to read some database data and have it displayed.
As i know a bit of html and a bit of css, just enough to alter some things of Joomla templates and such.
But it's not enough...
So i'm following the excellent written course on internetingishard.com, it tells you all from scratch how to use HTML & CSS. And it's free of any charge.
I'm starting lesson 9 today, and taking it easy as i just got surgery on my knee friday a week ago.
As it is a easy and good read with nice to do examples i hope to get the grip soon and start with some simple tests to use the cgi server/revigniter/html&css to read some database data and have it displayed.
Re: Revigniter Basics
Along those lines, there is also https://www.w3schools.com/ , which has among other things, a 'Try it yourself' section where you can type in and see the code run. I've always found it an excellent way to learn at least the basics of something.
Hope your knee feels better soon!
Re: Revigniter Basics
Yes i know that one too
But i helps when someone explains a bit, so it becomes easier to understand.
Thanks for your kind words Bogs.
But i helps when someone explains a bit, so it becomes easier to understand.
Thanks for your kind words Bogs.
Re: Revigniter Basics
I saw there is an update for Revigniter to 2.1.1, so this issue with Xampp helped.
People can use it now to develop local more easily. Thank you Ralph.
First i will update according this: https://revigniter.com/userGuide/instal ... e_211.html
Next i will copy my database for this project into Xampp and see if i can retrieve some data.
People can use it now to develop local more easily. Thank you Ralph.
First i will update according this: https://revigniter.com/userGuide/instal ... e_211.html
Next i will copy my database for this project into Xampp and see if i can retrieve some data.