Gossamer Forum
Home : Products : Others : MySQLMan :

URL shortcuts?

Quote Reply
URL shortcuts?
Hey everybody..

I was wondering, are there any shortcuts to enter the DB to special places? What I mean is, take the login for example.. Instead of entering mysql.cgi and login normally, you can enter at the URL bar this address :

path.to/cgi-bin/mysql.cgi?db_host=YOURHOST&db_user=YOURUSER&db_pass=YOURPASS&do=tables&data_source=DBI:mysql:YOURDB&init_login=1

Now, are there any shortcuts to put in the URL to get directly inside a table? let's say I want to have a string ready, so if I want to edit a row in table 'tab' inside database 'dat', I will simply have to copy it into the url bar...

Have a great one,
Kalimero.

Quote Reply
Re: URL shortcuts? In reply to
Hello,

Here is an example:

http://www.server.com/cgi-bin/mysql.cgi?
do=modify&
data_source=DBI:mysql:test&
table=users&
action=edit_record&
browse_action=browse
record_modify=username+% 3 D+% 2 7admin% 2 7

(Ps. There is no space in "% 3 D" and "% 2 7")


This URL will let you modify the record with username = 'admin' in database "test" in table "users".

All in the query string should stay the same except that you should change "data_source", "table", and "record_modify". Changing "data_source" and "table" is very straight forward. However, that value assigned to "record_modify" is similar to what you would put in the WHERE clause. In the example,

username+% 3 D+% 2 7admin% 2 7

(Ps. Again, there is no space in "% 3 D" and "% 2 7")

is actually saying:

username = 'admin'

where

"+" is a space;
"% 3 D" is "="; and
"% 2 7" is "'"

As a final note, the column used in "record_modify" has to be the primary key of the table. I.e the column "username" has to be the primary key of table "users" in the example.

--
Gossamer Threads, Inc.
Quote Reply
Re: URL shortcuts? In reply to
Ok, but how do I specify a user and pass?

When I added db_user, db_pass and db_host, it told me the username and password have been stored, and it's bringing me back to the last page > as if I just did a login...

So how do I specify a username and password?

Quote Reply
Re: URL shortcuts? In reply to
You do not need to specify the usernam and the password in the URL as the script will retrieve them from the cookies.

--
Gossamer Threads, Inc.