I'm wondering what the best way to prevent users from accidentally closing the current window, or even navigating away from the page.
The page in question is a data entry page, and since people tend to accidentally close windows, I want to add a script to pop up a confirmation box or something...
I'm hoping someone can explain why an array with one element, when 'shifted' in a subroutine continues to contain one element once the subroutine finishes.
Consider the following:
use Data::Dumper;
@arrayone = [10, [1, 2, 3]];
@arraytwo = ();
$number = 10;
print "OUTSIDE...
I'm sure this is simple, but I can't seem to align my thoughts right.
I have a file that I'm reading into an array with a series of values. For the sake of arguement we'll say there's three numbers, then any number of other numbers.
I want to store the first three numbers separately, and then...
if I have this code (using on a mysql database):
while (my $row = $sth->fetchrow_arrayref) {
foreach (@$row) { $_ = "NULL" unless defined }
my (@end) = splice(@$row, -2);
print join (", ",@$row)." - ".join(", ",@end)."\n";
}
it will print the first row as it should, then it gives a...
Ok, here's the set-up.
I have two tables, for simplicty, we'll say
users and staff
the important fields are
users.userid
users.staffid
and
staff.staffid
staff.has_user (enum('0','1'))
All users must have an associated staff id (hence the users.staffid) but not all staff needs an associated...
This isn't as hard as I think it is - but I'm just not thinking right at the moment.
Ok, I'm having trouble describing what I need. so I'll give you an example. Sorry if it's hard to understand.
say I have an array of numbers:
(15,5,25,10,20)
the percentage of each number can be represented...
Ok, I wrote a simple script that allows the users to enter a headline and some news, and with the click of a button, post it on the main page of his site. Well, it works great for the most part. There is a preview option, as well as password authentication.
When my employer uses the preview...
What do the arguments:
-oi
and
-oem
do? I used to have no problem getting sendmail to work on my server online, but now it no longer does. I finally found a script on the net that works, and it's got those two options on the sendmail program. I'd like to know what they are though... and I...
I've got a piece of code that runs through each element in an array doing stuff. It can take a while depending on the size of the array, so I figured I'd be nice and output some percentages to make sure the user knows that something is infact happening... so I stuck this in the loop. ($percent...
Is there any way for perl to pick up an in coming messenger message?
I wrote a script that will send a "net send" message at a time that I enter, so I can leave and still have the computer send the message at that time. But I want (if possible) to be able to auto-reply if the user I'm...
Essentially, I want a script to run for as long as it takes, when the time is a certain time, I want the script to execute a command.
I just did it by going:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
while($min < 59 && $hour == 17){...
I have a text file with a name and IP on each line, sepparated by double bars (||) like this for example:
userone||22.51.32.32
usertwo||192.32.32.*
userthree||32.35.*.*
userfour||24.32.62.323
For example. Anyway, when I read in the file, I use the code:
my ($users,$ips);
while(<USRS>){...
Let's say I have the source code to a webpage contained as a string in a scalar, and all I want to do is print JUST the <body> tag (and everything contained within). I did it like this:
$source =~ s/(<body[^>]+>)/$1/;
print $1;
This works fine - but is there a more appropriate way to do it? It...
I have a php script that uses the PHP md5() function which "Returns an encrypted hash of it's parameter, using the RSA algorythm."
What I'm wondering is, is there any perl modules or anything that will allow me to verify passwords using this encryption system? Just as a test, I tried...
I'm trying to edit a perl forum for a friends' company, but before I can do that, I need to get it working on my local server. I'm on winXP running Apache 1.3.27, and the newest version of perl. my CGI scripts work perfectly on my server, when I write them. However, my friend sent me this...
quick question.
Say I have a hash of hashes, like this for example:
$DB{$membername}{'IP'} = $ipaddress;
$DB{$membername}{'ID'} = $membrID;
$DB{$membername}{'GRP'} = $membrgroup;
My question is simply out of my own curiosity, and doesn't really have any use that I can think of, but let's say...
one part of a script that I wrote has to output information from a database in a nicely formatted table, that looks different depending on the data that is to be displayed. I have no problem doing this, & it works fine. Here's the problem though. I have a main menu, and when the user selects the...
one party of a script that I wrote has to output information from a database in a nicely formatted table, that looks different depending on the data that is to be displayed. I have no problem doing this, & it works fine. Here's the problem though. I have a main menu, and when the user selects...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.