Help - my head is hurting!

They have: 88 posts

Joined: Mar 1999

Sorry the script should have read
as below - not the one above.

Thanks

Steve

#!/usr/bin/perl
#
#
#
#Modify Form
#
#

use CGI qw(:standard);

print start_html( -title=>'Online Merchants Ltd. - modify details',
-author=>'steve');

print qq(

<BODY background="http://www.branditnow.co.uk/images/brandbg.gif" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#A80000" VLINK="#000080">

<TABLE valign=top BORDER=2 CELLSPACING=1 CELLPADDING=1 WIDTH="760">

<TD valign="top" align="left">
 <p>
<FONT face="verdana,arial,Geneva" size="-1"><h4>Please Complete The Appropriate Sections:</h4><p>
<h5><font color="navy">    FORWARDING DETAILS</font></h5>
</FONT>
</TD>
<TR>

<TD valign="top">
<FONT face="verdana,arial" size="2">Please Enter Your Domain:
</FONT>
</TD>
<TD valign="top">
<FONT face="verdana,arial" size="2">
        
<INPUT type="text" name="domain" size="30">
</FONT>
</TD>
</TR>
<TR>
<TD valign="top">
<p>
<FONT face="verdana,arial" size="2">Please Enter You Mothers Maiden Name:
</FONT>
</TD>
<TD valign="top">
<FONT face="verdana,arial" size="2">
     
<INPUT type="text" name="maiden_name" size="30">  
</FONT><p>
</TD>
</TR>

</TABLE>
<FONT FACE="ARIAL">

<BR><BR><BR><CENTER><INPUT type="submit" value="Continue...">

</BODY>

);

print end_html;

$u=param('domain');
$p=param('maiden_name');
$s=param('modify');

if($s = 'modify')
{ open(IN,"register.txt")or die "Cannot open file: $!";
@data = <IN>;
close(IN);
foreach $line (@data)
{
if( $line =~ m/^$u,$p,(.)/ )
{
print "Found: $line";
#The correct username and password has been inputed
#Insert code here to do whatever you want with the line
exit;
#Stop the script from going through the rest of the array
}
}

}

They have: 88 posts

Joined: Mar 1999

Can anybody help or suggest where I might
be going wrong with the following script.
I've been trying to fix it for that long
my head is hurting!

What i'm trying to do is to allow the user
to put in some details - which are then
checked against a file and the results
displayed - allowing them to enter new
details. All i've been getting despite
my best? efforts is 'Internal Server Error'

Any ideas? Or is it completely wrong?

Code:

$u=param('domain');
$p=param('maiden_name');
$s=param('modify');

if($s = 'modify')
{ open(IN,"register.txt")or die "Cannot open file: $!";
@data = <IN>;
close(IN);
foreach $line (@data)
{
if( $line =~ m/^$u,$p,(.)/ )
{
print "Found: $line";
#The correct username and password has been inputed
#Insert code here to do whatever you want with the line
exit;
#Stop the script from going through the rest of the array
}
}

}

Many thanks in advance for any assistance.

Regards

Steve

They have: 1,587 posts

Joined: Mar 1999

what type error r u getting?

------------------
CLICK 4 some tested resources for making money $, hosting, and web promotions.
My Site got hacked, but i'm coming back?

Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?

They have: 193 posts

Joined: Feb 2000

The following code is wrong:

code:

if($s = 'modify')
[/code]

You can not use = unless it is a number, even then, it would have to be ==.  In a alpha-numeric case, you need to use eq.

code:
if($s eq "modify")
[/code]

Hope that works...

Richard

------------------
      [email protected]       

I need a new signature.  :-( 

[email protected]

Everyone here has a website. It's just that not all are worth posting (Mine! Smiling).

They have: 88 posts

Joined: Mar 1999

thanks for the reply - the messages
are:

No such file or directory: exec of modify1.pl
failed

Premature end of script headers

I can't see what the problem is?

Regards

Steve

They have: 88 posts

Joined: Mar 1999

Richard,

thanks for that - but unfortunately that
hasn't sorted it out sorry to be a
pain - any other ideas?

Cheers

Steve.
I'll owe you lot a bottle of something!
Not a bad sig

Justin S's picture

They have: 2,076 posts

Joined: Jun 1999

Premature end of script headers means you forgot to print the following before you printed the HTML:

code:

print "Content-type: text/html\n\n";[/code]

------------------
Critiquing over 1000 sites on the Internet today...

[This message has been edited by Justin Stayton (edited 12 June 2000).] 

They have: 568 posts

Joined: Nov 1999

I thought that start_html did that in the CGI module.

Or maybe not

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.