Perl Help Please

They have: 88 posts

Joined: Mar 1999

Hi ppl again,

Many thanks to all the people who have
already helped me sort out the few Perl
prob's I was having. I have asked the
question below in the Jobs & Barter
Forum but thought that as some of you
had helped me already it might be better
seen in here.

I'm now looking for someone to check over
a perl script for me and add a couple of
extra bits like required fields etc.

The script is already written & working
the additions and checking probably shouldn't take more than an hour or two for someone who knows what they are doing - unlike me

I cannot offer much in the way of payment
but could work out a banner deal - say a
couple of months advertising for free? Or
maybe a small charge - Don't know if this is just being hopeful!

I am under pressure to get this site finished so if anyone is interested and
wants to stop me pulling my hair out - Please contact me direct or post here.

Many Thanks in anticipation

Steve

They have: 850 posts

Joined: Jul 1999

If you post the code here (or on your site) and tell us what you would like to be added, maybe one (or more) of us could help.

------------------
click here to help save lives
http://www.wiredstart.com : The Technology Start Page

They have: 88 posts

Joined: Mar 1999

Ok - Cheers for that - I've copied
the files on my site to .txt files
so that you can have a look at them.

They were written for us but didn't
do exactly what we wanted. I have added
extra bits and a few new pages - but am having trouble adding the last few things
- I can't seem to get it to do what I want.

(1) In the script below I want to make
it so that the fields are required and
it won't let you go to the next stage
without filling them in.
Basically order1.pl calls order2.pl calls order3.pl etc. and the variables are past to the nextfile. The script works correctly I just need to ensure that all fields are filled in:

Here it is: http://www.branditnow.co.uk/temp/order2.txt

(2) In the second script the user is
asked three questions - Domain,Email address
& mothers maiden name. I want the script
to check the details against a file called
registered.txt and if they match allow them
to proceed else stop them going any further.
The file registered.txt will have several
lines in it one per customer.
Here it is:
http://www.branditnow.co.uk/temp/modify1.txt

If anyone could show me where to put the
new bits in & what to put in I would be
eternally grateful. I have tried to do
it several ways but either it doesn't
work or I get the dreaded "internal server
error" and now I'm under pressure to get
it completed.

Many thanks in advance for any assistance
given.

Regards

Steve

They have: 850 posts

Joined: Jul 1999

So order1.pl contains the first form? If so, can you post the source for that, because inside order1.pl is where the first additional code would be placed to make sure all the fields are present.

------------------
click here to help save lives
http://www.wiredstart.com : The Technology Start Page

They have: 88 posts

Joined: Mar 1999

thanks Rob,

Well order1 contains the bit where the
customer enters the domain name that
they want which is then passed to order2
to check for availabilty:

Here it is:
http://www.branditnow.co.uk/temp/order1.txt

Thanks again.

Steve

They have: 850 posts

Joined: Jul 1999

Hello,

I will need the source code for order3.pl because that is where all the form values from order2.pl are sent correct?

------------------
click here to help save lives
http://www.wiredstart.com : The Technology Start Page

They have: 88 posts

Joined: Mar 1999

Rob,

yep that's right i've copied the two files
order3 & order4.

order3 has some fields in it but they don't
need to be required if that helps.

You can mail me direct if it's more
helpful to you.

Thanks again

Steve

They have: 850 posts

Joined: Jul 1999

Alright, in order2.pl at the top place

code:

if(!param('domain'))
{
	$url = "http://www.wiredstart.com/cgi-bin/order1.pl";
	print "Location: $url\nURI: $url\n\n";
	exit();
}
[/code]

In order3.pl at the top
code:
if(!param('name') | | !param('address1') | | !param('postcode') | | !param('country') | | !param('telephone') | | !param('email') | | !param('maiden_name'))
{
	$url = "http://www.wiredstart.com/cgi-bin/order2.pl";
	$url .= "?domain=".param('domain')."®istry=".param('registry');
	print "Location: $url\nURI: $url\n\n";
	exit();
}
[/code]

And in modify2.pl, although I haven't tested it, something like this should work:
code:
$count=0;
$file = 'registered.txt';
open(IN,$file);
@domains = <IN>;
close(IN);

$match = param('domain').param('registry').",".param('email').",".param('maiden_name');
foreach(@domains)
{
	$count=1 if($_ =~ m/$match/i);
}
if($count==0)
{
	error
	exit();
}
[/code]

You can see the order stuff working fne at http://www.wiredstart.com/cgi-bin/order1.pl 

I will delete it after you reply.
*Edit
UBB seems to place spaces between the | |.  You should delete those spaces.

------------------
click here to help save lives
http://www.wiredstart.com  : The Technology Start Page

[This message has been edited by robp (edited 21 June 2000).] 

They have: 88 posts

Joined: Mar 1999

Rob,

You are a star!!

The order form bits work great!

I will have another play tommorow with
the modify file but at the moment it doesn't
seem to like the code at the end that says:

{
error
exit();
}

It throws up an internal server error - when
I removed the "error" part and ran the script
it brought up a blank page

It may be something i'm doing so i'll have another play tommorow.

MANY THANKS for your assistance - if you've
got a button advert for a site that you want
promoting send it over and I will put it
on the site for a couple of months - it will
be on quite a few pages!

Thanks Again

Steve

They have: 850 posts

Joined: Jul 1999

the "error" was just supose tot ell you that that was where the error would go . It may be a good idea to print some HTML telling the person to go back and fill in the form correctly again or something.
Or just put code to forward the user back to the modify.pl

If you do want to display a button to my site in return for my modest help, you can find my button/html code at http://www.wiredstart.com/aboutus.php3 Thanks!

------------------
click here to help save lives
http://www.wiredstart.com : The Technology Start Page

They have: 88 posts

Joined: Mar 1999

Rob,

Thanks - thought that was what the error bit was for. Does the information that is in
the registered.txt file have to be in a certain format or will it pick it up regardless? At the moment it just brings
up a blank screen regardless of what fills
the variables - maybe i've put it in the wrong place or something - any ideas?
I can send you a copy of the dummy registered.txt file if that helps.

On the order form the first page (0rder1)
works as it should but if you don't enter
any details in the second page (order2)
when it checks the domain again it comes up
as registered the second time around. I've
put the script that you gave me but maybe
i've not put it in the right place - Do
you still have a copy of order3 that was
on your site last night? Could you email
it to me if you have so that I can compare
the two.

Sorry to be a pain.

Thanks for your help.

Cheers

Steve

They have: 88 posts

Joined: Mar 1999

Rob,

It's ok - i've worked out the modification
problem - answered my own question -
put the details in the file in the
same order as I want to take them out.

Just the little problem with the order
form now and that's it.

Thanks

Steve

They have: 850 posts

Joined: Jul 1999

I emailed [email protected] . That your email?

------------------
click here to help save lives
http://www.wiredstart.com : The Technology Start Page

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.