First up, I would like to say the support of the people in and that run this forum and at Gossamer is just simply fantastic!
Great job gals and guys !!
Hats off to JPD, Paul, Watt, LoisC, Alex, etc, etc !
(I have been reading the heck out of the forums for an answer.)
--------------------
Now,
I need to beg your help.
:)
I have a DBman database that I am trying to set up. I am well versed in html, but I am a perl-newbie (also programing-in-general-newbie). With that said, I have a database that I have (1) db.cgi file, but I want to have several "looks" or levels of interaction to it. I have figured out how to do most of it simply by using multiple "html.pl"s and multiple "defaults.cfg" files (they do have individual names, btw.) I want to use (1) copy of all the other files if possible. I have my eye on several MODs, but can only install what won't throw a monkey wrench into my basic design (I will worry about that later, as they are luxuries).
I have all the data fields and generated displayed pages like I want to this point, but the problem is getting "streamed-lined navigation" to them.
So basicly, I want to leave the db.cgi alone as much as possible, but want to "streamline my navigation" through out my database and reduce it to as few "clicks" as possible. I figure the best way to do this is to do it on the individual html.pl pages on each of the "sub htmL_XXXX_XXX"s I need to "tweak", if possible.
I think the way to do this (without being a perl guru such as L.C or JPD) is to edit the individual html.pl files and add code to get the "automatic bypasses" that I desire.
HERE is what I need:
What I am stuck on, is on my last "level", I need a way to get a successfully logged in user from the "login" to a their individual record at "modify_form_record". My "db key" is -NOT- my "userid", this is what makes it so hard, as I have seen JPD's examples on using the "ID" to do this way (if userid is id):
JPDs code where she helped someone else that used "userid" FOR "ID" (db key):
(it would be inserted into the top of sub html_home
###### send user to their record after login ######
unless ($per_admin) {
$in{$db_key} = $db_userid;
&view_records;
return;
}
The only problem with this is for me is, my userid is NOT the same as my DB's key.
SO, I need code that takes "userid" and searchs the DB and finds that person's record's ID (db key). I have figured out how to do this sort of, but it requires a person to "CLICK" a link. I am lookomg for a way to have the program do it with out a click needed.
Here is a code that generates a hyper link that has to be "clicked" to and individual logged in user to their individual record:
<$font1><a href="!; print $db_dir_url; print qq!/db.cgi?db=CONFIGTHREE&uid=!; print $db_uid; print qq!&USERIDFIELD=!; print $db_userid; print qq!&modify_form=search"><b>to EDIT Menu</b></a></font>
(this uses a .cfg file named "configthree.cfg" and the userid field is named "useridfield")
This works, I can generate the link for indivduals users, but it must be "clicked" to go there. What I am looking for a way in code to automaticly and to "bypass" or skip" the HOME page.
Here is what my newbie-code would look something like:
(You perl Gurus will like this,lol)
Ok, on the last one of my DBman's html.pl's "sub html_home" at the top of it, I add something like this:
# Only logged in users, that have records
# and will have used the "configthree.cfg
# permissions" will get here. Their "userid" is NOT
# their "ID", the DB tracks the db key of "ID".
# Users will have permission to modify, delete,
# but not search, their record will have already
# been added. The "$show_home_page" shows
# the home page, but only for admin only.
sub html_home {
if ($per_admin) {
&show_home_page;
}
else {
#<--START INSERT of PERL GURU's CODE HERE:----------
# Take the user's "$db_userid" from log in and search the DB for his/her record.
# Find the user's "ID" number, then insert the user's "ID" (db key) into a "$magic_variable",
# then stick it in "$in{'modify'} for the $modify_form_record,
# so it will "&get_record"$in{'modify'}" that person's record.
do "$magic_search_of_db_by_user's_userid_for_their_id_code_and_set_$in{'modify'}_to_it"
#------END of PERL GURU's CODE----->
$in{'modify'} = $magic_variable;
&html_modify_form_record;
return;
}
;
sub show_home_page {
# print a home page for admin to use only.
print "I am happy now etc etc.";
}
;
Ok, what I need is a the actual code for the "<----insert code of perl Guru-----End perl Guru's code>" part.
Someone, please help me?
As you can see, "My" version of the code does not work.
:)
Please, help me please?
PS....
Here is some other code, BUT it jumps the logged user to their view_record, and I want to jump them to their modify_form_record of their record:
$in{'userid'} = $db_userid;
my ($status, @hits) = &query(''view'');
if ($status eq ''ok'') {
&html_view_success(@hits);
}
else {
&html_add_form;
}
Great job gals and guys !!
Hats off to JPD, Paul, Watt, LoisC, Alex, etc, etc !
(I have been reading the heck out of the forums for an answer.)
--------------------
Now,
I need to beg your help.
:)
I have a DBman database that I am trying to set up. I am well versed in html, but I am a perl-newbie (also programing-in-general-newbie). With that said, I have a database that I have (1) db.cgi file, but I want to have several "looks" or levels of interaction to it. I have figured out how to do most of it simply by using multiple "html.pl"s and multiple "defaults.cfg" files (they do have individual names, btw.) I want to use (1) copy of all the other files if possible. I have my eye on several MODs, but can only install what won't throw a monkey wrench into my basic design (I will worry about that later, as they are luxuries).
I have all the data fields and generated displayed pages like I want to this point, but the problem is getting "streamed-lined navigation" to them.
So basicly, I want to leave the db.cgi alone as much as possible, but want to "streamline my navigation" through out my database and reduce it to as few "clicks" as possible. I figure the best way to do this is to do it on the individual html.pl pages on each of the "sub htmL_XXXX_XXX"s I need to "tweak", if possible.
I think the way to do this (without being a perl guru such as L.C or JPD) is to edit the individual html.pl files and add code to get the "automatic bypasses" that I desire.
HERE is what I need:
What I am stuck on, is on my last "level", I need a way to get a successfully logged in user from the "login" to a their individual record at "modify_form_record". My "db key" is -NOT- my "userid", this is what makes it so hard, as I have seen JPD's examples on using the "ID" to do this way (if userid is id):
JPDs code where she helped someone else that used "userid" FOR "ID" (db key):
(it would be inserted into the top of sub html_home
###### send user to their record after login ######
unless ($per_admin) {
$in{$db_key} = $db_userid;
&view_records;
return;
}
The only problem with this is for me is, my userid is NOT the same as my DB's key.
SO, I need code that takes "userid" and searchs the DB and finds that person's record's ID (db key). I have figured out how to do this sort of, but it requires a person to "CLICK" a link. I am lookomg for a way to have the program do it with out a click needed.
Here is a code that generates a hyper link that has to be "clicked" to and individual logged in user to their individual record:
<$font1><a href="!; print $db_dir_url; print qq!/db.cgi?db=CONFIGTHREE&uid=!; print $db_uid; print qq!&USERIDFIELD=!; print $db_userid; print qq!&modify_form=search"><b>to EDIT Menu</b></a></font>
(this uses a .cfg file named "configthree.cfg" and the userid field is named "useridfield")
This works, I can generate the link for indivduals users, but it must be "clicked" to go there. What I am looking for a way in code to automaticly and to "bypass" or skip" the HOME page.
Here is what my newbie-code would look something like:
(You perl Gurus will like this,lol)
Ok, on the last one of my DBman's html.pl's "sub html_home" at the top of it, I add something like this:
# Only logged in users, that have records
# and will have used the "configthree.cfg
# permissions" will get here. Their "userid" is NOT
# their "ID", the DB tracks the db key of "ID".
# Users will have permission to modify, delete,
# but not search, their record will have already
# been added. The "$show_home_page" shows
# the home page, but only for admin only.
sub html_home {
if ($per_admin) {
&show_home_page;
}
else {
#<--START INSERT of PERL GURU's CODE HERE:----------
# Take the user's "$db_userid" from log in and search the DB for his/her record.
# Find the user's "ID" number, then insert the user's "ID" (db key) into a "$magic_variable",
# then stick it in "$in{'modify'} for the $modify_form_record,
# so it will "&get_record"$in{'modify'}" that person's record.
do "$magic_search_of_db_by_user's_userid_for_their_id_code_and_set_$in{'modify'}_to_it"
#------END of PERL GURU's CODE----->
$in{'modify'} = $magic_variable;
&html_modify_form_record;
return;
}
;
sub show_home_page {
# print a home page for admin to use only.
print "I am happy now etc etc.";
}
;
Ok, what I need is a the actual code for the "<----insert code of perl Guru-----End perl Guru's code>" part.
Someone, please help me?
As you can see, "My" version of the code does not work.
:)
Please, help me please?
PS....
Here is some other code, BUT it jumps the logged user to their view_record, and I want to jump them to their modify_form_record of their record:
$in{'userid'} = $db_userid;
my ($status, @hits) = &query(''view'');
if ($status eq ''ok'') {
&html_view_success(@hits);
}
else {
&html_add_form;
}