10 entries, 1 page |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
y $dbh = DBI->connect('DBI:mysql:test', 'root','root') or die "Couldn't connect to database" . DBI->errstr; $dbh->{ReadOnly} = 1; my $sth = $dbh->prepare('UPDATE test_table set LAST_NAME=\'UPDATED\' WHERE ID = ?') or die "Couldn't prepare statement: " . $dbh->errstr; print "Enter ID> "; while ($id = <>) { # Read input from the user my @data; chomp $id; # Trimms of "\n" after end of input! $sth->execute($id) # Execute the query or die "Couldn't execute statement: " . $sth->errstr; $sth->finish; last; } print "Programm Ende!\n"; $dbh->disconnect;
$dbh->{ReadOnly} = 1;
Gast+2008-02-05 15:11:33--[...]
Meine Idee wäre nun ein HTML Befehl, den der Browser (z.B. Suche Mantis Nummer 4711) ausführt durch Perl abzusetzen und den Rückgabestring, der ja dann HTML Code ist, nach den nötigen Infos zu durchsuchen...
[...]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
use WWW::Mechanize; use Term::ReadKey; my $mech = WWW::Mechanize->new( autocheck => 1 ); $mech = WWW::Mechanize->new(); my $username; my $passwd; my $tempfile = "testfile.txt"; my $url = "http://zeus_XXX.de/bug/lmy_view_page.php"; print "Enter User Name: \n"; $username = <STDIN>; chomp($username); print "Enter Password: \n"; ReadMode noecho; $passwd = <STDIN>; chomp($passwd); ReadMode restore; $mech->credentials( $username, $passwd ); $mech->get( $url, ':content_file' => $tempfile ); print "Programm Ende!\n";
10 entries, 1 page |