CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
script problems

 



ultimategamer2k
User

Jan 20, 2001, 9:41 AM

Post #1 of 5 (661 views)
script problems Can't Post

okay, im having a little problem with my script... i have made a html login page
-------------------html code--------------------
<div align="center">
<center>
<form method="POST" action=test.cgi>

<table border="0" cellpadding="0" cellspacing="0" width="50%" bgcolor="#333333">
<tr>
<td width="100%">
<p align="center"><font size="1" face="Verdana">..::<b>Database Updates</b>::..
</font>
<div align="center">
<table border="2" cellpadding="0" cellspacing="0" width="95%" bordercolor="#000000">
<tr>
<td width="50%" bgcolor="#060735">
<font size="1" face="Verdana"><b>Number Of Codes:</b></font>
</td>
<td width="50%" bgcolor="#060735"><b><input type="text" name="NumberOfCodes" size="20"></b></td>
</tr>
<tr>
<td width="50%" bgcolor="#060735">
<font face="Verdana" size="1"><b>Game Name:</b></font>
</td>
<td width="50%" bgcolor="#060735"><b><input type="text" name="name" size="20"></b></td>
</tr>
<tr>
<td width="50%" bgcolor="#060735">
<b><font size="1" face="Verdana">Username:</font></b>
</td>
<td width="50%" bgcolor="#060735"><b><input type="text" name="user" size="20"></b></td>
</tr>
<tr>
<td width="50%" bgcolor="#060735"><b><font size="1" face="Verdana">Password:</font></b></td>
<td width="50%" bgcolor="#060735"><b><input type="password" name="pass" size="20"></b></td>
</tr>
<tr>
<td width="100%" colspan="2" bgcolor="#060735"><input type="submit" value="Submit"></td>
</tr></table></div></td></tr></table></center></form></div>
-----------------------/HTML code------------------------
and its supposed to login to this page.. and display the input codes
----------------------- cgi code ---------------------------
#!C:\Perl\bin\perl.exe
print "Content-type: text/html\n\n";

for ($count = 1; $count <= $number; $count++){
print param("description$count");
print param ("code$count");
}

$number= param('NumberOfCodes') || 10;
$gameName = param ('name');
$user = param('user');
$pass = param('pass');
$code = param ('codes$count');
$test = param ('description1');

print qq(<body bgcolor="#000000" text="#FFFFFF" link="#C0C0C0" vlink="#C0C0C0" alink="#FFFFFF">);


if (($user eq "test") && ($pass eq "test2")){
&works; }
else {
$wrong; }
sub wrong{
print "Wrong stupid! Get out!";
print "<a href ='http://ultimategamer.cjb.net'>..::Home::..</a>";
}

sub works{
print <<beginningHTML;
<div align="center">
<center>
<form method="POST" action="test.cgi">
<table border="0" cellpadding="0" cellspacing="0" width="80%" bgcolor="#333333">
<tr>
<td width="100%">
<p align="center"><b><font size="1" face="Verdana">..::Adding Codes::..</font></b>
<div align="center">
<table border="2" cellpadding="0" cellspacing="0" width="95%" bgcolor="#060735" bordercolor="#000000">
<tr>
<td width="8%" bgcolor="#060735"> </td>
<tr>
<td width="8%" bgcolor="#A8A8A8">Number</td>
<td width="42%" bgcolor="#A8A8A8">Code Description</td>
<td width="50%" bgcolor="#A8A8A8">Code</td></tr>
<tr>
beginningHTML
;

for ($count = 1; $count <= $number; $count++){
print qq(<td width="8%">$count</td>);
print qq(<td width="42%"><font face="Verdana" size="1"><b><input type="text" name="description$count" size="20"></b></font></td>);
print qq(<td width="50%"><font face="Verdana" size="1"><b><input type="text" name="code$count" size="20"></b></font></td></tr>);
}

print <<endHTML;
<tr>
<td width="50%" colspan="2"><font face="Verdana" size="1"><b><input type="submit" value="Submit"></b></font></td>
<td width="50%"> </td></tr></table></div></td></tr></table></center></form></div>
endHTML
print "A".$test."B";

print $description[$count];
open (FILE, ">$gameName.txt");
print FILE $description[1];
print FILE $code[$count];

close FILE
}

visit my web site at http://ultimategamer.cjb.net


sleuth
Enthusiast

Jan 20, 2001, 2:42 PM

Post #2 of 5 (655 views)
Re: script problems [In reply to] Can't Post

 
What exactly is going wrong?

Also, I noticed your on NT, so please post in the win32 forum next time so people know right off the bat your on a different platform than the typical unix/linux around here.

Tony



ultimategamer2k
User

Jan 20, 2001, 7:27 PM

Post #3 of 5 (652 views)
Re: script problems [In reply to] Can't Post

its showing me a blank screen, thats whats going wrong

visit my web site at http://ultimategamer.cjb.net


sleuth
Enthusiast

Jan 20, 2001, 8:40 PM

Post #4 of 5 (648 views)
Re: script problems [In reply to] Can't Post

 I didn't see it before but add

use CGI qw/:standard/;

To the top of your script below the first line.

Sleuth



ultimategamer2k
User

Jan 21, 2001, 10:52 AM

Post #5 of 5 (642 views)
Re: script problems [In reply to] Can't Post

O MY GOD! i cant believe i forgot that!
thanks man!

visit my web site at http://ultimategamer.cjb.net

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives