Sketchup / ruby WebDiablog / php
-
You could set the source of your webdialog to your PHP enabled localhost.
But that would be something you'd only be able to run on your machine. Noone else would be able to use it unless they installed WAMP and set up a local server - something which I doubt anyone would do. -
OK!
But to put localhost in my functon webdialog, how i can do this?
What is the parameters syntax of webdialog? I don't find in the API.
My PC will be the server and the program will run only on my machine.
thx for all!
-
If a URL with the .set_file doesn't work, you might have to use frames to embed your local host.
What are you using the PHP+MySQL for?
-
Are you sure that you need php? You can make transactions with mysql just using ruby. Everything you need to manage a database.
http://www.kitebird.com/articles/ruby-mysql.html or http://www.tmtm.org/en/ruby/mysql/ -
I test set.file with url and path php, else i want when i click on a dynamique object, to run a ruby script witch run a webdialog with a php form.
With this form i configure some parameters object and i put this in a MysSQL base.
My object is a motor for exemple, in sketchup it has an adress.When i click on this, I take the adress motor to do in my php file somes query in mysql. I can configure speed motor for example in my form. Sketchup is just a graphic interface witch can use google earth to do a geolocation (building and item on this).
-
Y i can create just a form in html and to give in script ruby the values of my form and i do my queries in ruby.
But it's possble to return form values with only html and javascript (unless php) in a ruby script?
If yes, i will see on the net how to do this.
-
And in html, this is an equal of include("file.php"); because else it's not flexible, i can use frame but i don't care.
-
@pauline01 said:
Y i can create just a form in html and to give in script ruby the values of my form and i do my queries in ruby.
But it's possble to return form values with only html and javascript (unless php) in a ruby script?
If yes, i will see on the net how to do this.
http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/webdialog.html#get_element_value
-
@pauline01 said:
Y i can create just a form in html and to give in script ruby the values of my form and i do my queries in ruby.
But it's possble to return form values with only html and javascript (unless php) in a ruby script?
If yes, i will see on the net how to do this.
Yes it is! You make all mysql operations with ruby! I tried to make a project using Ruby Mysql, but I abandoned for more simpler approach, because data wasn't much and there was not a point to use databases. BUT, i was able to make my database working under sketchup and I was able also to transfer data between webdialog and mysql database using just callbacks and ruby code. Please read what i sent you here http://forums.sketchucation.com/viewtopic.php?f=180&t=22743#p192068, you have syntax too, and examples. Believe me, you don't need php. That was my fear, because i don't know php, but in the end I've been able to make it work with ruby. In the end what is the point of using lots of programming languages, if one can do all you need?
-
Nice so finally:
the form will be in html and javascript, and the dialog between the html file and the ruby script will allow to do all queries. nice! and thx...
Advertisement