CGI database connection: now urlencode() problem

SparkOut SparkOutYNY at gmail.com
Fri Feb 20 11:53:12 CST 2009


Bom dia Andre, obrigado.

I'm sure that urlEncode is actually working, as if I change
The pertinent section is here:

The main routine reads the template page into tPage, which contains
"{{categories}}" marker.
There is a query to retrieve the category list and that list is passed to
the function 

function fnCategoriesDisplay pData
   local tLine, tCategories
   set the itemDelimiter to tab
   repeat for each line tLine in pData
     put "  & quote & urlEncode(tLine) &  " & tLine & " " & cr after
tCategories
     --looks like the html structure is being parsed by the Nabble screen.
Ho hum...
   end repeat
   return tCategories
   -- if instead, I return "Test Data here" then everything works.
   -- it's not that urlEncode hangs, it's when there's urlEncoded data that
is being 
   -- output that is the problem.
end fnCategoriesDisplay

After being returned, the {{categories}} marker is replaced with
tCategories. Then I use:

cgiOutPut format (tPage),"text/html"

to output the page. If the categories are restricted to have nothing that
needs to be urlEncoded,
then these also output OK, but if there are any which do (almost all of them
have spaces in at least)
then the output through cgiOutput hangs.


HOWEVER, as I was typing this message it occurred to me that the "format"
statement might be the problem.
(Legacy of cutting and pasting sample scripts...)
I just tried removing that and used cgiOutput (tPage), "text/html" and it
seems to have worked straight off.

Sorry to be a nuisance, and obrigado muito again for your attention.



Andre Garzia-3 wrote:
> 
> Hi There,
> 
> I don't believe my library interferes with URLEncode. Can you invoke
> the script thru the shell normally? Can you post the piece of code
> that contains the urlencode function, so we can check for something
> non obvious?
> 
> Cheers
> andre
> 
> On Thu, Feb 19, 2009 at 11:58 AM, SparkOut <SparkOutYNY at gmail.com> wrote:
>>
>>
>>
>> SparkOut wrote:
>>>
>>> I have got everything successfully working on both WAMP and Linux
>>> webhost
>>> to make database connections and very pleased to be getting on with
>>> that.
>>> However, I have another problem which is proving to be a blocker: if I
>>> use
>>> URLEncode("anything & everything") then the server just bombs.
>>> I have isolated it down to definitely just the inclusion of a
>>> URLEncode()
>>> function. The URLEncode() function doesn't depend on any libraries to my
>>> knowledge, but even so I've put the revbrowser into the externals,
>>> similarly to the method that got the database connection working, to see
>>> if that makes a difference, but it still fails.
>>> I've tried with an old 2.9 engine from Rev Studio in case it was
>>> something
>>> in the Enterprise 3.5-dp releases, but same issue. Any ideas anyone or
>>> is
>>> this a bug? It works fine in the IDE, and as a standalone, it's only
>>> when
>>> the engine is being used as a cgi backend that it's a problem.
>>> Thanks if you can shed any light on this for me.
>>> Oh well, I've rolled my own function to deal with this for now, but I'd
>>> really like to know if this is a bug or something I'm doing wrong, or
>>> something I've got wrong in the setup with use in conjunction with
>>> Andre's
>>> RocketsCGI?
>>
>> --
>> View this message in context:
>> http://www.nabble.com/CGI-database-connection-%28mySQL%29-tp22081311p22102298.html
>> Sent from the Revolution - User mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
> 
> 
> 
> -- 
> http://www.andregarzia.com All We Do Is Code.
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 

-- 
View this message in context: http://www.nabble.com/CGI-database-connection-%28mySQL%29-tp22081311p22125423.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list