Lazarus + Mysql + Posting on a website. lazarus / 9-Editor ---------------------------------------------------------------------- Fernando Morgenstern · 2006-01-24 19:46 I have to do a program, but it doesn´t work. Now i will try doing with lazarus. Can you tell if lazarus is able to connect to a mysql db? I have to make something like this... i connect to db, get a value, and put it on a edit. When i click on the button, it put the value in a form (which will be open on the webbrowser) and submit it. After i have to get a value that the website will return to me. I have read that people use firefox instead of the component webbrowser. Can somebody tell me how to use it? Serious... is this program possible? ---------------------------------------------------------------------- felipemdc · 2006-01-24 22:53 QuoteI have to do a program, but it doesn´t work. Now i will try doing with lazarus. Can you tell if lazarus is able to connect to a mysql db? It is completely capable of connecting to mysql. Read: http://wiki.lazarus.freepascal.org/index.php/Lazarus_Database_Tutorial ---------------------------------------------------------------------- Anonymous · 2006-01-25 14:57 sekel, do you thing my project is possible? ---------------------------------------------------------------------- felipemdc · 2006-01-25 17:10 QuoteI have to make something like this... i connect to db, get a value, and put it on a edit. This is normal / totally possible. QuoteWhen i click on the button, it put the value in a form (which will be open on the webbrowser) and submit it. After i have to get a value that the website will return to me. I have no idea how to communicate with the browser to do that. So I cannot say how this could be done at all. So I cannot say if this is possible =) You would need very depth control over the browser to load a webpage and add a text to a form, but I have another idea: If the communication protocol to send data to the website is GET, then you can just tell a browser to open a location like: www.mywebsite.com?data1=yes&data2=5&moredate=9888 This will send the necessary information to the webpage. You don't need a browser component to do that. Just use konqueror from command line or firefox or anything else =) ---------------------------------------------------------------------- felipemdc · 2006-01-25 17:10 You can use the shell command to do that. If the communication protocol is POST then things are harders. Maybe you can write a software that sends information in the POST format to the website yourself. No need to parse HTML, just implement HTTP communication and send data via POST. The LNet Lazarus component can help do HTTP communication a lot. If you don't know what POST and GET are, just google: http://www.google.com.br/search?hl=pt- BR&q=POST+GET&btnG=Pesquisar&meta= ---------------------------------------------------------------------- Anonymous · 2006-01-27 09:26 Quote from: "Fernando Morgenstern"... . When i click on the button, it put the value in a form (which will be open on the webbrowser) and submit it. After i have to get a value that the website will return to me.... try this functin res := HTTPGetText('http://' + dominio + '/.../....php?query=' + URLEncode(qry), risultato); from unit httpsend from synapse (do a search to find out to download). ciao sergio ---------------------------------------------------------------------- Anonymous · 2006-01-30 22:54 hey guest, can you explain this function better. How it will get a text from the webbrowser? ---------------------------------------------------------------------- CCRDude · 2006-02-09 08:43 I've done both - direct DB and HTTP interface - successfully with Lazarus. Quite easier than with Delphi even. For the first thing though, I had to use a simple mysql unit, not the component package that came with Lazarus, since that had problems with all the five different versions of libmysql.dll I found Synapse was quite easy for HTTP, though I miss a feedback event when using just those functions... @"guest": What "guest" described was not working with a browser, but make the program behave like a browser. I think there's bunch of confusion still, and you should explain your situation more clearly before asking for more details 1. Do you need to read the data from a DB, or would reading it from a webpage be sufficient? 2. Do you need the have an open webbrowser showing the form, or would submitting the text to a webpage be sufficient? 3. Are you familiar with the webpage? It's URL, whether it uses GET or POST, which field names it uses?