Iam happy to hear that but iam not sure how do you want me to implement this. after the suer gives username, password and data and are checked through databse and they match then and only then i must submit the initial values taken from index.pl to show.pl. But how iam goinf to subit that? hre is the code agian with slightly changed.
#!/usr/bin/perl use strict; use warnings; use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard); use DBD::mysql; use POSIX qw(strftime); print header( -charset=>'iso-8859-7' ); print start_html( -style=>'/data/css/style.css', -title=>'Ψυχωφελ& +#942; Πνευματικά &# +922;είμενα!' ); my $name = param('name'); my $pray = param('pray'); my $remark = param('remark'); my $email = param('email'); my $date = param('date'); my $host = param('host'); my $username = param('username'); my $password = param('password'); my $date = strftime('%y-%m-%d %H:%M:%S', localtime); my $host = gethostbyaddr (pack ("C4", split (/\./, $ENV{'REMOTE_ADDR'} +)), 2) || $ENV{REMOTE_ADDR}; $host = "Νίκος" if (($host =~ /dell/) or ($ho +st =~ /dell.lan/) or ($host eq "localhost")); my ($select, $row, $data); my $dbh = DBI->connect('DBI:mysql:nikos_db', 'root', 'password', {Rais +eError=>1}); #***********************ASK INFORMATION********************** print h1( {class=>'big'}, "Εγγραφή +Χρήστη ή Σύνδ& +#949;ση χρήστη!" ); print br() x 3; print start_form( action=>'login.pl' ); print table( {class=>'user_form'}, Tr( td( 'Δίαλεξε &#908 +;νομα Χρήστη:' + ), td( textfield( 'username' ))), Tr( td( 'Δίαλεξε &#922 +;ωδικό Πρόσβα& +#963;ης:' ), td( textfield( 'password' ))), Tr( td( 'Ποιό είν&#945 +;ι το email σου?' ), td( textfield( + 'email' ))), Tr( td( submit( 'Εγγραφ&#9 +42;' )), td( submit( 'Σύνδεσ +η' ))) ); print hidden(-name=>'name', -value=>$name); print hidden(-name=>'pray', -value=>$pray); print hidden(-name=>'remark', -value=>$remark); print hidden(-name=>'email', -value=>$email); print hidden(-name=>'date', -value=>$date); print hidden(-name=>'host', -value=>$host); print end_form(); print br() x 2; exit 0 unless ( param('Σύνδεση') or + param('Εγγραφή') ); #*********************CHECK IF USER FILLED ALL ENTRIES**************** +***** my %error_msgs = ( username => "Πρέπει να &#9 +63;υμπληρώσεις + username!", password => "Πρέπει να &#9 +63;υμπληρώσεις + password!", email => "Χρειάζετ&#945 +;ι και το email σου!" ); my $error_found; foreach (keys %error_msgs) { unless( param($_) ) { print h1( {class=>'yellow'}, $error_msgs{$_} ), br; $error_found++; } } exit 0 if $error_found; if ( param('Σύνδεση') ) { #***********CHECK IF USERNAME AND PASSWORD ARE CORRECT*********** $select = $dbh->prepare( "SELECT username, password, email FROM users" + ); $select->execute; while( $row = $select->fetchrow_hashref ) { unless ( ($username eq $row->{username}) and ($password eq $row->{ +password}) and ($email eq $row->{email}) ) { print h1( {class=>'cyan'}, "Λάθος &#9 +72;νομα χρήστη &#94 +2; κωδικός πρό&#963 +;βασης ή χρήστ +ης μη εγγεγρα& +#956;μένος στην β&# +940;ση !" ); exit 0; } print redirect("/cgi-bin/show.pl?name=$name&pray=$pray&remark=$rem +ark&email=$email&date=$date&host=$host"); exit 0; } } exit 0 unless( param('Εγγραφή') ); #***********CHECK IF USERNAME ALREADY EXISTS AND ADD USER TO DATABASE* +********** $select = $dbh->prepare( "SELECT username FROM users" ); $select->execute; while( $row = $select->fetchrow_hashref ) { if ($username eq $row->{username}) { print h1( {class=>'cyan'}, "Αυτός &#9 +59; Χρήστης υπά&#96 +1;χει ήδη! Διάλ&#94 +9;ξε άλλο όνομ&#945 +; χρήστη!" ); exit 0; } } $select = $dbh->prepare( "INSERT INTO users (username, password, email +, date, host) VALUES (?, ?, ?, ?, ?)" ); $select->execute( $username, $password, $email, $date, $host); #****************************SHOW THE NUMBER OF USERS***************** +********** $select = $dbh->prepare( "SELECT count(*) FROM users" ); $select->execute; my ($count) = $select->fetchrow_array(); print h1( {class=>'lime'}, "Ευχαρι& +#963;τώ πολύ ", span( {class=>'yellow'}, "$username" )); print h1( {class=>'lime'}, "Συνολι& +#954;ά εγγεγραμέ&#9 +57;οι χρήστες σ&#96 +4;ην βάση: ", span( {class=>'yellow'}, "$count" ));
Please explain to me what you mean!

In reply to Re^6: Redirecting values from 1 script to another by Nik
in thread Redirecting values from 1 script to another by Nik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.