Dan Hoggard wrote:
>
> Can anyone help me.
>
> I'm tring to include a view all members and delete member option in the
> admin area for this script.
> I have it going to a flat file, here.
> open (FILE, ">>$cgiroot/data/address/members.txt");
>
> How do I call it from this area and include the delete option?
> I can't figure out the code to include. Everthing I try causes an error.
> The script is below.
>
Sorry, but I don't have enough time to look through whole your code.
Please try to find less than 100 lines which are involved in your
problem.
However, I couldn't believe you really typed these lines:
> if($action eq ""){&login;exit;}
> if($action eq "main"){&main;exit;}
> if($action eq "email"){&send;exit;}
> if($action eq "Login"){&main;exit;}
> if($action eq "logout"){&logout;exit;}
> if($action eq "search"){&search;exit;}
> if($action eq "topbot"){⌶exit;}
> if($action eq "backup"){&backup;exit;}
> if($action eq "config"){&config;exit;}
> if($action eq "viewmem"){&viewmem;exit;}
> if($action eq "editmem"){&editmem;exit;}
> if($action eq "updates"){&updates;exit;}
> if($action eq "b_delete"){&b_delete;exit;}
> if($action eq "m_delete"){&m_delete;exit;}
> if($action eq "b_restore"){&b_restore;exit;}
> if($action eq "deleteall"){&deleteall;exit;}
> if($action eq "dailysend"){&dailysend;exit;}
> if($action eq "Send Message"){&dosend;exit;}
> if($action eq "new_backup"){&new_backup;exit;}
> if($action eq "revalidate"){&revalidate;exit;}
> if($action eq "Search Members"){&dosearch;exit;}
> if($action eq "dorevalidate"){&dorevalidate;exit;}
> if($action eq "Save News/Updates"){&doupdates;exit;}
> if($action eq " Edit This Member "){&doeditmem;exit;}
> if($action eq "Save This Configuration"){&doconfig;exit;}
> if($action eq "Save All Headers/Footers"){&dotopbot;exit;}
> if($action eq "Yes -> Reset The Daily Send"){&dodailysend;exit;}
There's so much redundancy.
In every line stands if($action eq "...."){&....; exit;}
Only the dots are changing.
There are many ways to avoid it,
one is (from the cookbook):
my %actioncommands = ( '' => \&login,
main => \&main,
email => \&email,
Login => \&main,
...
'Yes -> Reset The Daily Send' => \&dodailysend );
$actioncommands{$action}->();
Greetings,
Andrea
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]