Gossamer Forum
Home : Products : DBMan : Customization :

adding an edit command to a field

Quote Reply
adding an edit command to a field
I posted this before in another thread but got no reply. So here we go again.

What I did was added another field in the datbase with the field name 'RegCode'


Then I added a link in sub html_record routine in the html.pl file: and in fact in two spots one for with gfx files and one at with out (upload mod).Hopefully this is correct.


Code:
GRAPHIC: foreach $extension (@extensions) {
if (-e "$SAVE_DIRECTORY/$rec{$db_key}.$extension") {
print qq|<center><img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension" width=160 height=160 border=0></center>
<p align="center"><a href="http://www.palmfilez.com/$rec{'RegCode'}" target="_blank"><img border="0" src="http://www.palmfilez.com/images/tiny_button_buyit.gif" width="100" height="36"></a></p>
|; $pic=1;
last GRAPHIC;
}
}
unless ($pic) {
print qq|<center><img src="$SAVE_DIRECTORY_URL/no_gfx.jpg" width=160 height=160 border=0></center>

<p align="center"><a href="http://www.palmfilez.com/$rec{'RegCode'}" target="_blank"><img border="0" src="http://www.palmfilez.com/images/tiny_button_buyit.gif" width="100" height="36"></a></p>|;
}

Now need to be able for me to add the record via the add and edit function for admin access only or the option to let everyone or to let only admin edit the {RegCode}.

my files will be posted here:

http://www.palmfilez.com/default.txt
http://www.palmfilez.com/db.txt
http://www.palmfilez.com/html.txt

Mitch



[This message has been edited by Mitch C (edited April 16, 2000).]
Quote Reply
Re: adding an edit command to a field In reply to
I don't know what you mean at all. What is the RegCode field for? What are you trying to add or edit?


------------------
JPD






Quote Reply
Re: adding an edit command to a field In reply to
Heres the thread that it started at

http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/002643.html

RegCode is the new field I placed in my database for passing to a url for each file
in The database

http://www.registerhere.com/reg.cgi?=$rec{'RegCode'}"

At the url where people would register the software they are going to give me a code for each of the software titles in my
database the (RegCode) field is the part of the url that will link to the webpage to register the software

Mitch

[This message has been edited by Mitch C (edited April 16, 2000).]

[This message has been edited by Mitch C (edited April 16, 2000).]
Quote Reply
Re: adding an edit command to a field In reply to
Okay. You have a field that will be part of a URL. That much I got.

What I don't get is this:

Quote:
Now need to be able for me to add the record via the add and edit function for admin access only or the option to let everyone or to let only admin edit the {RegCode}.



------------------
JPD






Quote Reply
Re: adding an edit command to a field In reply to
Modify record or add records commands want to be able for me to add a record and include the (RegCode)field

In other words when I add a record it asks for
1. Program Name
2. Url for download
3. Url for tech support
4. discription
5.ect ect ect
then
6. RegCode

Also to edit the record

Need the code to add this last field

Mitch
Quote Reply
Re: adding an edit command to a field In reply to
Add the following to html_record_form:

Code:
<tr><td>RegCode:</td>
<td><input type="text" name="RegCode" value="$rec{'RegCode'}"></td></tr>

This assumes that you have a two-column table in your form.



------------------
JPD






Quote Reply
Re: adding an edit command to a field In reply to
[deleted] nevermind. Smile

--Lee

[This message has been edited by leisurelee (edited April 16, 2000).]
Quote Reply
Re: adding an edit command to a field In reply to
Is it possable to bring it a step further
and turn off adding and editing of just that field to anyone under admin?

Mitch
Quote Reply
Re: adding an edit command to a field In reply to
Yes.

Code:
|;
if ($per_admin) {
print qq|
<tr><td>RegCode:</td>
<td><input type="text" name="RegCode" value="$rec{'RegCode'}"></td></tr>|;
}
else {
print qq|
<input type="hidden" name="RegCode" value="$rec{'RegCode'}">
|;
}
print qq|

Is this what you need?


------------------
JPD






Quote Reply
Re: adding an edit command to a field In reply to
Your The Best

Mitch