Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The easiest way is to use the META refresh tag, you wont need to regig your header either.</p> <p>Use this code:</p> <pre><code>#!C:\perl\bin\perl.exe use strict; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use DBI; my $q = new CGI; my $redirect = 0; print "Content-Type: text/html\n\n"; if ($q-&gt;param("Login")) { my $Password = param('Password'); if (!$Password) { print "Please Enter the Password"; } else { my $dbh = DBI-&gt;connect( "dbi:SQLite:DEVICE.db", "", "", { RaiseError =&gt; 1, AutoCommit =&gt; 1 } ); my $sth = $dbh-&gt;prepare("select * from Settings where Password = ?"); $sth-&gt;execute($Password); if (my $pass = $sth-&gt;fetchrow_hashref) { $redirect = 1; } else { print "Invalid Password"; } $dbh-&gt;disconnect; } } print &lt;&lt;END1; &lt;HTML&gt; &lt;HEAD&gt; END1 if ($redirect){ print '&lt;meta http-equiv="refresh" content="1;url=http://localhost/cgi-bin/Main.cgi/"&gt;'; } print &lt;&lt;END2; &lt;TITLE&gt; &lt;/TITLE&gt; &lt;/HEAD&gt; &lt;body&gt; &lt;form NAME="login" METHOD="POST"&gt; &lt;input type="hidden" name="submit" value="Submit"&gt; &lt;TABLE align="center" bgcolor=#B0C4DE&gt; &lt;TR&gt; &lt;TD&gt; Enter The Password And Click Login&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;/TR&gt; &lt;TR&gt;&lt;/TR&gt; &lt;TR&gt;&lt;/TR&gt; &lt;TR&gt;&lt;/TR&gt; &lt;TR&gt;&lt;/TR&gt; &lt;TR&gt; &lt;TD&gt;&lt;b&gt;PASSWORD&lt;/b&gt; :&lt;input type="password" name="Password" size="20" maxlength="15" /&gt;&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;/TR&gt; &lt;TR&gt;&lt;/TR&gt; &lt;TR&gt;&lt;/TR&gt; &lt;TR&gt;&lt;/TR&gt; &lt;TR&gt;&lt;/TR&gt; &lt;TR&gt; &lt;TR&gt; &lt;TD align="center" colspan="2"&gt; &lt;input type="submit" name="Login" value="Login"&gt; &lt;input type="reset" name="submit" value="Cancel"&gt; &lt;/TD&gt; &lt;/TR&gt; &lt;/TABLE&gt; &lt;/FORM&gt; &lt;/BODY&gt; &lt;/HTML&gt; END2 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload