473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to check for all the fields in user registrations perl script

236 100+
Hi All,

I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters?
Two codes below :
a) html
b) perl script (print and inserting into database)

Cheers...
Andrew

a) html
=====
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//SoftQuad//DTD HTML 3.2 + extensions for HoTMetaL PRO 3.0(U) 19961211//EN"
  2.  "hmpro3.dtd">
  3. <HTML>
  4. <HEAD>
  5. <TITLE></TITLE></HEAD>
  6. <BODY>
  7. <FORM ACTION="/cgi-bin/acctman2.pl" METHOD="POST">
  8. <CENTER>
  9. <TABLE BORDER="0" WIDTH="400">
  10. <TR>
  11. <TD ALIGN="CENTER">
  12. <TABLE BORDER="0" CELLPADDING="5" BGCOLOR="#FF8000">
  13. <TR>
  14. <TD><INPUT TYPE="CHECKBOX" NAME="agree" VALUE="agree"></TD>
  15. <TD><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>I agree to the Terms 
  16. and Conditions above.</B></FONT></TD></TR></TABLE><BR></TD></TR>
  17. <TR>
  18. <TD>
  19. <HR SIZE="2" NOSHADE="NOSHADE"></TD></TR>
  20. <TR>
  21. <TD ALIGN="CENTER">
  22. <TABLE BORDER="0" WIDTH="350" NOWRAP="NOWRAP">
  23. <TR>
  24. <TD><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>Customer Information</B></FONT><BR><FONT
  25. SIZE="-2" FACE="verdana, arial, helvetica" COLOR="#FF0000"><B>Fields marked 
  26. with an asterisk<BR>are required input fields.</B></FONT><BR><BR></TD></TR>
  27. <TR>
  28. <TD><INPUT TYPE="TEXT" NAME="fname">
  29. <FONT SIZE="-1" FACE="verdana, arial, helvetica">First Name *</FONT></TD></TR>
  30. <TR>
  31. <TD><INPUT TYPE="TEXT" NAME="lname">
  32. <FONT SIZE="-1" FACE="verdana, arial, helvetica">Last Name *</FONT></TD></TR>
  33. <TR>
  34. <TD><INPUT TYPE="TEXT" NAME="email">
  35. <FONT SIZE="-1" FACE="verdana, arial, helvetica">E-Mail Address *</FONT></TD></TR></TABLE>
  36. <TABLE BORDER="0" WIDTH="350" NOWRAP="NOWRAP">
  37. <TR>
  38. <TD><BR><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>Choose a User 
  39. Name</B></FONT><BR><INPUT TYPE="TEXT" NAME="username"> 
  40. <FONT SIZE="-1" FACE="verdana, arial, helvetica">User Name</FONT>  
  41. <FONT SIZE="-1" FACE="arial, helvetica"><BR><BR><B>Choose a Password</B></FONT><BR>
  42.  
  43. <INPUT TYPE="password" NAME="pwd">     
  44. <FONT SIZE="-1" FACE="verdana, arial, helvetica">Password</FONT><BR><INPUT
  45. TYPE="password" NAME="pwd2"> <FONT SIZE="-1" FACE="verdana, arial, helvetica">Verify
  46.   Password</FONT></TD></TR></TABLE><BR><BR><INPUT
  47. TYPE="SUBMIT" NAME="process" VALUE="Submit My Order"><INPUT
  48. TYPE="RESET" NAME=""></TD></TR>
  49. <TR>
  50. <TD>
  51. <HR SIZE="2" NOSHADE="NOSHADE"></TD></TR></TABLE></CENTER></FORM></BODY></HTML>
  52.  

b) perl script
=========
Expand|Select|Wrap|Line Numbers
  1. #!c:\perl\bin\perl.exe 
  2. #!/usr/bin/perl 
  3. ############################################ 
  4. ##                                        ## 
  5. ##     Account Manager LITE User Signup   ## 
  6. ##          by SiteInteractive.com        ## 
  7. ##    http://siteinteractive.com/contact  ## 
  8. ##                                        ## 
  9. ##             version:  1.09             ## 
  10. ##       last modified:  07/24/2002       ## 
  11. ##        copyright (c) 1998 - 2002       ## 
  12. ##                                        ## 
  13. ##    latest version is available from    ## 
  14. ##        http://SiteInteractive.com      ## 
  15. ##                                        ## 
  16. ############################################ 
  17. # Copyright 1998 Elite Host.  All Rights Reserved. 
  18. # TERMS OF USE  
  19. # 1. Account Manager is for licensed customers 
  20. # only. Customer may use Account Manager as many 
  21. # times as customer wishes, as long as customer owns or runs the web 
  22. # site that Account Manager is installed on.  Account 
  23. # Manager may not under any circumstances be sold 
  24. # or redistributed without the written consent of CGI Script Center and 
  25. # its owner Diran Alemshah. 
  26. # 2. CGI Script Center, at its own discresion, will decide if any terms  
  27. # of the this agreement have been violated by customer. Upon written e- 
  28. # mailed notification to Customer of Terms of Use violations, CGI 
  29. # Script Center may revoke customer's license to use Account Manager. 
  30. # In that event, Customer agrees to any and all of the following: 
  31. # a) Customers found in violation of this agreement, found reselling or 
  32. # redistributing Account Manager, or making  
  33. # Customers Members Area ID and password public to anyone in any  
  34. # manner will forfeit their Members area password and all rights to  
  35. # future versions of Account Manager. 
  36. #  
  37. # b). Customer will no longer be licensed to run any version of  
  38. # Account Manager.  
  39. # Indemnification 
  40. # 1. Customer agrees that it shall defend, indemnify, save and hold 
  41. # CGI Script Center, Elite Web Design and marketing, and any 
  42. # persons affiliated with either company, harmless from any and all 
  43. # demands, liabilities, losses, costs and claims, including reasonable 
  44. # attorney's fees asserted against CGI Script Center, its agents, its 
  45. # customers, officers and employees, that may arise or result from any 
  46. # service provided or performed or agreed to be performed or any product 
  47. # sold by customer, its agents, employees or assigns. Customer agrees to 
  48. # defend, indemnify and hold harmless CGI Script Center, its agents, 
  49. # its cusomters, officers, and employes,against 
  50. # liabilities arising out of; a) any injury to person or property caused 
  51. # by an products sold or  otherwise distributed in connection with CGI 
  52. # Script Center products; (b) any material supplied by customer 
  53. # infringing or allegedly infringing on the proprietary rights of a 
  54. # third party; c) copyright infringement and (d) any defective products 
  55. # sold to customer from CGI Script Center products. 
  56. # This program may not be distributed in whole or part, freely, for pay,  
  57. # or any other form of compensation. 
  58. ##################################################  ############### 
  59. # This version designed for Win32 systems (NT).  If you require 
  60. # a Unix version, please contact cgi@elitehost.com 
  61. ##################################################  ############### 
  62.  
  63.  
  64. ##################################################  ############ 
  65. # EDIT USER CONFIGURATIONS BELOW 
  66. ##################################################  ############ 
  67.  
  68. # apache is in d DRIVE!!! not C
  69.  
  70. #require "d:/program files/apache software foundation/apache2.2/cgi-bin/config.pl"; 
  71.  
  72. # This completes this portion of your Account Manager setup 
  73. ##################################################  ############ 
  74. # DO NOT EDIT BELOW THIS LINE 
  75. ##################################################  ############ 
  76.  
  77. use CGI; 
  78. use CGI::Carp qw(fatalsToBrowser); 
  79. use DBD::mysql;
  80. use DBI;
  81.  
  82. my $query = CGI->new; 
  83.  
  84. unless ($CGI::VERSION >= 2.47) {  
  85.    error('Your version of CGI.pm is too old. You must have verison 2.47 or higher to use this script.') 
  86.  
  87.  
  88. #SECTION B
  89. #=========================================
  90. #Database initialization and initial query
  91. my ($dbh, $data_source);  
  92. my $mysql_server_name   = 'localhost';  
  93. my $mysql_database_name = 'test';  
  94. my $mysql_user_name     = 'root';  
  95. my $mysql_password      = 'mysql1';  
  96.  
  97. my $data_source = 'DBI:mysql:' . $mysql_database_name . ':' . $mysql_server_name;  
  98. my $dbh = DBI->connect( $data_source, $mysql_user_name, $mysql_password, {RaiseError=>1}) ||  die "$DBI::errstr";   
  99.  
  100.  
  101.  
  102.  
  103. #important line to pass email address from html to perl
  104. my $agree_field = $query->param("agree") || 'Annonymous'; 
  105. my $first_name = $query->param("fname") || 'Annonymous'; 
  106. my $last_name = $query->param("lname") || 'Annonymous'; 
  107. my $email_address = $query->param("email") || 'Annonymous'; 
  108. my $user_name = $query->param("username") || 'Annonymous'; 
  109. my $password = $query->param("pwd") || 'Annonymous'; 
  110.  
  111.  
  112. # End of Database initial Query
  113. #==========================================
  114.  
  115. print $query->header(), 
  116.       $query->start_html(-title=>'Input Successful'), 
  117.       $query->p('Thanks for registrating your particulars with us!'), 
  118.       $query->p("You Agree? : $agree_field:"),
  119.       $query->p("Your First Name : $first_name"),
  120.       $query->p("Your last Name : $last_name"), 
  121.       $query->p("Your email address: $email_address"), 
  122.       $query->p("Your username : $user_name"), 
  123.       $query->p("Your Password : $password"), 
  124.       $query->end_html; 
  125.  
  126. sub error { 
  127.    print $query->header(), 
  128.          $query->start_html(-title=>'Error'), 
  129.          shift, 
  130.          $query->end_html; 
  131.    exit(0); 
  132.  
  133.  
  134. my $sql = $dbh->prepare(qq{SELECT * FROM user_reg}); 
  135.    $sql->execute(); 
  136.  
  137. while (my @data = $sql->fetchrow_array()) { 
  138.  
  139.       # Print the date from the first two columns in the table 
  140.       #print $data[0], "\t", $data[1], "<br>"; 
  141.        print $data[0], "\t", $data[1], "\t", $data[2], "\t", $data[3], "\t", $data[4], "\t", $data[5], "<br>";  
  142.  
  143. 1;
  144.  
  145.  
  146.  $sql = $dbh->prepare(qq{insert into user_reg(agree_field, first_name, last_name, email_address, user_name, password) values ( "$agree_field", "$first_name", "$last_name", "$email_address", "$user_name", "$password") } );  
  147.    $sql->execute() or die "$dbh->errstr\n";;  
  148.  
  149. $sql = $dbh->prepare(qq{SELECT * FROM user_reg});  
  150.  $sql->execute(); 
  151.  
  152.  
  153. while (my @data = $sql->fetchrow_array()){  
  154.  
  155.       # Print the date from the first four columns in the table  
  156.       print $data[0], "\t", $data[1], "\t", $data[2], "\t", $data[3], "\t", $data[4], "\t", $data[5], "<br>";  
  157.  
  158. }
  159. 1;
  160.  
  161.  
Oct 20 '08
82 9946
happyse27
236 100+
Hi Jeff / All,

Thanks for all. Below is the error from strawberry perl cpan installation

Btw, DBI and DBD::MYSQL what is difference?


Thanks,
Andrew


ERROR
======
cpan shell -- CPAN exploration and modules installation (v1.9301)
ReadLine support enabled


cpan> install dbd::mysql
Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
Fetching with LWP:
http://cpan.strawberryperl.com/modules/02packages.details.txt.gz
Fetching with LWP:
http://cpan.strawberryperl.com/modules/03modlist.data.gz
Database was generated on Mon, 27 Oct 2008 17:37:16 GMT
Updating database file ...

Gathering information from index files ...
Obtaining current state of database ...
Populating database tables ...
Done!
Warning: Cannot install dbd::mysql, don't know what it is.
Try the command

i /dbd::mysql/

to find objects with matching identifiers.


cpan> install dbd
Warning: Cannot install dbd, don't know what it is.
Try the command

i /dbd/

to find objects with matching identifiers.


cpan> install dbd::mysql;
Warning: Cannot install dbd::mysql;, don't know what it is.
Try the command

i /dbd::mysql;/

to find objects with matching identifiers.
Oct 28 '08 #51
KevinADC
4,059 Expert 2GB
Try:

Expand|Select|Wrap|Line Numbers
  1. install DBD::mysql
perl is case sensitive. DBD not dbd
Oct 28 '08 #52
happyse27
236 100+
even the below didnt help. Thanks.

ERROR 2
--------------
cpan> install DBD::mysql
Running install for module 'DBD::mysql'
Running make for C/CA/CAPTTOFU/DBD-mysql-4.010.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\C\CA\CAPTTOF U\DBD-mysql-4.010
.tar.gz ok
Scanning cache C:\strawberry\cpan\build for sizes
.................................................. ..........................DONE


CPAN.pm: Going to build C/CA/CAPTTOFU/DBD-mysql-4.010.tar.gz

Use of uninitialized value $ENV{"USER"} in concatenation (.) or string at Makefi
le.PL line 488.
Use of uninitialized value in concatenation (.) or string at Makefile.PL line 48
8.


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user '' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to ''@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.pl --testuser=username

Failed to determine directory of mysql.h. Use

perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type

perl Makefile.PL --help
Warning: No success on command[C:\strawberry\perl\bin\perl.exe Makefile.PL]
CAPTTOFU/DBD-mysql-4.010.tar.gz
C:\strawberry\perl\bin\perl.exe Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Failed during this command:
CAPTTOFU/DBD-mysql-4.010.tar.gz : writemakefile NO 'C:\strawberry\
perl\bin\perl.exe Makefile.PL' returned status 512
Oct 28 '08 #53
happyse27
236 100+
Hi Kevin,

Thanks. Think it was installed even before I installed, but cant really make test... Not sure what is wrong...?


Thanks,
Andrew

PROBLEM :
=========
cpan> install DBD::mysql
Running install for module 'DBD::mysql'
Running make for C/CA/CAPTTOFU/DBD-mysql-4.010.tar.gz
Has already been unwrapped into directory C:\strawberry\cpan\build\DBD-mysql-4
.010-IKl04x
'C:\strawberry\perl\bin\perl.exe Makefile.PL' returned status 512, won't make
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Oct 28 '08 #54
happyse27
236 100+
Hi Kevin,

The code is below. Not sure if declared correctly?


Thanks in advance again,
Andrew

Expand|Select|Wrap|Line Numbers
  1.  
  2. #!c:\strawberry\perl\bin\perl.exe 
  3. #!c:\perl\bin\perl.exe 
  4. #!perl
  5. #!/usr/bin/perl -T 
  6. use strict; 
  7. use warnings; 
  8. use CGI; 
  9. use CGI::Carp qw(fatalsToBrowser); 
  10. use File::Basename; 
  11. use DBD::mysql;
  12. use DBI; 
  13.  
  14.  
  15. $CGI::POST_MAX = 1024 * 5000; #adjust as needed (1024 * 5000 = 5MB) 
  16. $CGI::DISABLE_UPLOADS = 0; #1 disables uploads, 0 enables uploads 
  17.  
  18. my $query = CGI->new; 
  19.  
  20. unless ($CGI::VERSION >= 2.47) {  
  21.    error('Your version of CGI.pm is too old. You must have verison 2.47 or higher to use this script.') 
  22.  
  23.  
  24. #SECTION B
  25. #=========================================
  26. #Database initialization and initial query
  27. my ($dbh, $data_source);  
  28. my $mysql_server_name   = 'localhost';  
  29. my $mysql_database_name = 'test';  
  30. my $mysql_user_name     = 'root';  
  31. my $mysql_password      = 'mysql1';  
  32.  
  33. my $data_source = 'DBI:mysql:' . $mysql_database_name . ':' . $mysql_server_name;  
  34. my $dbh = DBI->connect( $data_source, $mysql_user_name, $mysql_password, {RaiseError=>1}) ||  die "$DBI::errstr";   
  35.  
  36.  
  37. my $sql = $dbh->prepare(qq{SELECT * FROM samples}); 
  38.    $sql->execute(); 
  39.  
  40. while (my @data = $sql->fetchrow_array()) { 
  41.  
  42.       # Print the date from the first two columns in the table 
  43.       print $data[0], "\t", $data[1], "<br>"; 
  44.  
  45. 1;
  46.  
  47. # End of Database initial Query
  48. #==========================================
  49.  
  50.  
  51.  
  52.  
  53. my $upload_dir = 'D:/Program Files/Apache Software Foundation/Apache2.2/htdocs/upload'; 
  54.  
  55. # a list of valid characters that can be in filenames 
  56. my $filename_characters = 'a-zA-Z0-9_.-'; 
  57.  
  58. my $file = $query->param("photo") or error('No file selected for upload.') ; 
  59. my $email_address = $query->param("email") || 'Annonymous'; 
  60.  
  61. # get the filename and the file extension 
  62. # this could be used to filter out unwanted filetypes 
  63. # see the File::Basename documentation for details 
  64. my ($filename,undef,$ext) = fileparse($file,qr{\..*}); 
  65.  
  66. # append extension to filename 
  67. $filename .= $ext; 
  68.  
  69. # convert spaces to underscores "_" 
  70. $filename =~ tr/ /_/; 
  71.  
  72. # remove illegal characters 
  73. $filename =~ s/[^$filename_characters]//g; 
  74.  
  75. # satisfy taint checking 
  76. if ($filename =~ /^([$filename_characters]+)$/) { 
  77.    $filename = $1; 
  78. else{ 
  79.    error("The filename is not valid. Filenames can only contain these characters: $filename_characters") 
  80.  
  81. # this is very crude but validating an email address is not an easy task 
  82. # and is beyond the scope of this article. To validate an email 
  83. # address properly use the Emaill::Valid module. I do not include 
  84. # it here because it is not a core module. 
  85. unless ($email_address =~ /^[\w@.-]+$/ && length $email_address < 250) { 
  86.    error("The email address appears invalid or contains too many characters. Limit is 250 characters.") 
  87. }     
  88.  
  89. my $upload_filehandle = $query->upload("photo"); 
  90.  
  91. open (UPLOADFILE, ">$upload_dir/$filename") or error($!); 
  92. binmode UPLOADFILE; 
  93. while ( <$upload_filehandle> ) { 
  94.    print UPLOADFILE; 
  95. close UPLOADFILE; 
  96.  
  97.  
  98. print $query->header(), 
  99.       $query->start_html(-title=>'Upload Successful'), 
  100.       $query->p('Thanks for uploading your photo!'), 
  101.       $query->p("Your email address: $email_address"), 
  102.       $query->p("Your photo $filename:"), 
  103.       $query->img({src=>"../upload/$filename",alt=>''}), 
  104.       $query->end_html; 
  105.  
  106.  
  107. sub error { 
  108.    print $query->header(), 
  109.          $query->start_html(-title=>'Error'), 
  110.          shift, 
  111.          $query->end_html; 
  112.    exit(0); 
  113.  
  114.  
  115.    $sql = $dbh->prepare(qq{insert into samples(username, password, email_address, filename) values ( "userhello636", "passhello636", "$email_address", "$filename") } );  
  116.    $sql->execute() or die "$dbh->errstr\n";;  
  117.  
  118. $sql = $dbh->prepare(qq{SELECT * FROM samples});  
  119.  $sql->execute(); 
  120.  
  121.  
  122. while (my @data = $sql->fetchrow_array()){  
  123.  
  124.       # Print the date from the first four columns in the table  
  125.       print $data[0], "\t", $data[1], "\t", $data[2], "\t", $data[3], "<br>";  
  126.  
  127. }
  128. 1;
  129.  
  130.  
Oct 28 '08 #55
Icecrack
174 Expert 100+
Hi Kevin,

The code is below. Not sure if declared correctly?


Thanks in advance again,
Andrew

Expand|Select|Wrap|Line Numbers
  1.  
  2. #!c:\strawberry\perl\bin\perl.exe 
  3. #!c:\perl\bin\perl.exe 
  4. #!perl
  5. #!/usr/bin/perl -T 
  6. use strict; 
  7. use warnings; 
  8. use CGI; 
  9. use CGI::Carp qw(fatalsToBrowser); 
  10. use File::Basename; 
  11. use DBD::mysql;
  12. use DBI; 
  13.  
  14.  
  15. $CGI::POST_MAX = 1024 * 5000; #adjust as needed (1024 * 5000 = 5MB) 
  16. $CGI::DISABLE_UPLOADS = 0; #1 disables uploads, 0 enables uploads 
  17.  
  18. my $query = CGI->new; 
  19.  
  20. unless ($CGI::VERSION >= 2.47) {  
  21.    error('Your version of CGI.pm is too old. You must have verison 2.47 or higher to use this script.') 
  22.  
  23.  
  24. #SECTION B
  25. #=========================================
  26. #Database initialization and initial query
  27. my ($dbh, $data_source);  
  28. my $mysql_server_name   = 'localhost';  
  29. my $mysql_database_name = 'test';  
  30. my $mysql_user_name     = 'root';  
  31. my $mysql_password      = 'mysql1';  
  32.  
  33. my $data_source = 'DBI:mysql:' . $mysql_database_name . ':' . $mysql_server_name;  
  34. my $dbh = DBI->connect( $data_source, $mysql_user_name, $mysql_password, {RaiseError=>1}) ||  die "$DBI::errstr";   
  35.  
  36.  
  37. my $sql = $dbh->prepare(qq{SELECT * FROM samples}); 
  38.    $sql->execute(); 
  39.  
  40. while (my @data = $sql->fetchrow_array()) { 
  41.  
  42.       # Print the date from the first two columns in the table 
  43.       print $data[0], "\t", $data[1], "<br>"; 
  44.  
  45. 1;
  46.  
  47. # End of Database initial Query
  48. #==========================================
  49.  
  50.  
  51.  
  52.  
  53. my $upload_dir = 'D:/Program Files/Apache Software Foundation/Apache2.2/htdocs/upload'; 
  54.  
  55. # a list of valid characters that can be in filenames 
  56. my $filename_characters = 'a-zA-Z0-9_.-'; 
  57.  
  58. my $file = $query->param("photo") or error('No file selected for upload.') ; 
  59. my $email_address = $query->param("email") || 'Annonymous'; 
  60.  
  61. # get the filename and the file extension 
  62. # this could be used to filter out unwanted filetypes 
  63. # see the File::Basename documentation for details 
  64. my ($filename,undef,$ext) = fileparse($file,qr{\..*}); 
  65.  
  66. # append extension to filename 
  67. $filename .= $ext; 
  68.  
  69. # convert spaces to underscores "_" 
  70. $filename =~ tr/ /_/; 
  71.  
  72. # remove illegal characters 
  73. $filename =~ s/[^$filename_characters]//g; 
  74.  
  75. # satisfy taint checking 
  76. if ($filename =~ /^([$filename_characters]+)$/) { 
  77.    $filename = $1; 
  78. else{ 
  79.    error("The filename is not valid. Filenames can only contain these characters: $filename_characters") 
  80.  
  81. # this is very crude but validating an email address is not an easy task 
  82. # and is beyond the scope of this article. To validate an email 
  83. # address properly use the Emaill::Valid module. I do not include 
  84. # it here because it is not a core module. 
  85. unless ($email_address =~ /^[\w@.-]+$/ && length $email_address < 250) { 
  86.    error("The email address appears invalid or contains too many characters. Limit is 250 characters.") 
  87. }     
  88.  
  89. my $upload_filehandle = $query->upload("photo"); 
  90.  
  91. open (UPLOADFILE, ">$upload_dir/$filename") or error($!); 
  92. binmode UPLOADFILE; 
  93. while ( <$upload_filehandle> ) { 
  94.    print UPLOADFILE; 
  95. close UPLOADFILE; 
  96.  
  97.  
  98. print $query->header(), 
  99.       $query->start_html(-title=>'Upload Successful'), 
  100.       $query->p('Thanks for uploading your photo!'), 
  101.       $query->p("Your email address: $email_address"), 
  102.       $query->p("Your photo $filename:"), 
  103.       $query->img({src=>"../upload/$filename",alt=>''}), 
  104.       $query->end_html; 
  105.  
  106.  
  107. sub error { 
  108.    print $query->header(), 
  109.          $query->start_html(-title=>'Error'), 
  110.          shift, 
  111.          $query->end_html; 
  112.    exit(0); 
  113.  
  114.  
  115.    $sql = $dbh->prepare(qq{insert into samples(username, password, email_address, filename) values ( "userhello636", "passhello636", "$email_address", "$filename") } );  
  116.    $sql->execute() or die "$dbh->errstr\n";;  
  117.  
  118. $sql = $dbh->prepare(qq{SELECT * FROM samples});  
  119.  $sql->execute(); 
  120.  
  121.  
  122. while (my @data = $sql->fetchrow_array()){  
  123.  
  124.       # Print the date from the first four columns in the table  
  125.       print $data[0], "\t", $data[1], "\t", $data[2], "\t", $data[3], "<br>";  
  126.  
  127. }
  128. 1;
  129.  
  130.  

Do You get any error messages?
what do you mean your not sure?
Oct 28 '08 #56
numberwhun
3,509 Expert Mod 2GB
The following, the first 4 lines of your code, are not correct:

Expand|Select|Wrap|Line Numbers
  1. # #!c:\strawberry\perl\bin\perl.exe 
  2. # #!c:\perl\bin\perl.exe 
  3. # #!perl
  4. # #!/usr/bin/perl -T 
  5.  
The shebang line is ONLY the first line of your script. It starts with a "#!" as the first two characters and from the third character on is the path to your Perl interpreter. The way you have it, with two # signs will not work. You only need one of these, the other three are comments.

The shebang line can only be on the first line, otherwise you need to kick off the script with the perl program name preceeding it.

Regards,

Jeff
Oct 28 '08 #57
KevinADC
4,059 Expert 2GB
I don't see two # signs. Did you copy and past his code into a text file or text editor? The first # sign was maybe the line number artifact.
Oct 28 '08 #58
happyse27
236 100+
Hi Guys,

I did modification to be reduced to 1 line of interpretor. Still didnt work. Kindly adviise. The Error in html, the code and cpan installation errors are shown below. Thanks again!


Thanks and Best Rgds,
Andrew

Error shown in html page
==================

Software error:
Can't locate DBD/mysql.pm in @INC (@INC contains: C:/strawberry/perl/lib C:/strawberry/perl/site/lib .) at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/u3.pl line 7.
BEGIN failed--compilation aborted at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/u3.pl line 7.

For help, please send mail to the webmaster (admin@gateway.2wire.net), giving this error message and the time and date of the error.


Expand|Select|Wrap|Line Numbers
  1. #!c:\strawberry\perl\bin\perl.exe 
  2. use strict; 
  3. use warnings; 
  4. use CGI; 
  5. use CGI::Carp qw(fatalsToBrowser); 
  6. use File::Basename; 
  7. use DBD::mysql;
  8. use DBI; 
  9.  
  10.  
  11. $CGI::POST_MAX = 1024 * 5000; #adjust as needed (1024 * 5000 = 5MB) 
  12. $CGI::DISABLE_UPLOADS = 0; #1 disables uploads, 0 enables uploads 
  13.  
  14. my $query = CGI->new; 
  15.  
  16. unless ($CGI::VERSION >= 2.47) {  
  17.    error('Your version of CGI.pm is too old. You must have verison 2.47 or higher to use this script.') 
  18.  
  19.  
  20. #SECTION B
  21. #=========================================
  22. #Database initialization and initial query
  23. my ($dbh, $data_source);  
  24. my $mysql_server_name   = 'localhost';  
  25. my $mysql_database_name = 'test';  
  26. my $mysql_user_name     = 'root';  
  27. my $mysql_password      = 'mysql1';  
  28.  
  29. my $data_source = 'DBI:mysql:' . $mysql_database_name . ':' . $mysql_server_name;  
  30. my $dbh = DBI->connect( $data_source, $mysql_user_name, $mysql_password, {RaiseError=>1}) ||  die "$DBI::errstr";   
  31.  
  32.  
  33. my $sql = $dbh->prepare(qq{SELECT * FROM samples}); 
  34.    $sql->execute(); 
  35.  
  36. while (my @data = $sql->fetchrow_array()) { 
  37.  
  38.       # Print the date from the first two columns in the table 
  39.       print $data[0], "\t", $data[1], "<br>"; 
  40.  
  41. 1;
  42.  
  43. # End of Database initial Query
  44. #==========================================
  45.  
  46.  
  47.  
  48.  
  49. my $upload_dir = 'D:/Program Files/Apache Software Foundation/Apache2.2/htdocs/upload'; 
  50.  
  51. # a list of valid characters that can be in filenames 
  52. my $filename_characters = 'a-zA-Z0-9_.-'; 
  53.  
  54. my $file = $query->param("photo") or error('No file selected for upload.') ; 
  55. my $email_address = $query->param("email") || 'Annonymous'; 
  56.  
  57. # get the filename and the file extension 
  58. # this could be used to filter out unwanted filetypes 
  59. # see the File::Basename documentation for details 
  60. my ($filename,undef,$ext) = fileparse($file,qr{\..*}); 
  61.  
  62. # append extension to filename 
  63. $filename .= $ext; 
  64.  
  65. # convert spaces to underscores "_" 
  66. $filename =~ tr/ /_/; 
  67.  
  68. # remove illegal characters 
  69. $filename =~ s/[^$filename_characters]//g; 
  70.  
  71. # satisfy taint checking 
  72. if ($filename =~ /^([$filename_characters]+)$/) { 
  73.    $filename = $1; 
  74. else{ 
  75.    error("The filename is not valid. Filenames can only contain these characters: $filename_characters") 
  76.  
  77. # this is very crude but validating an email address is not an easy task 
  78. # and is beyond the scope of this article. To validate an email 
  79. # address properly use the Emaill::Valid module. I do not include 
  80. # it here because it is not a core module. 
  81. unless ($email_address =~ /^[\w@.-]+$/ && length $email_address < 250) { 
  82.    error("The email address appears invalid or contains too many characters. Limit is 250 characters.") 
  83. }     
  84.  
  85. my $upload_filehandle = $query->upload("photo"); 
  86.  
  87. open (UPLOADFILE, ">$upload_dir/$filename") or error($!); 
  88. binmode UPLOADFILE; 
  89. while ( <$upload_filehandle> ) { 
  90.    print UPLOADFILE; 
  91. close UPLOADFILE; 
  92.  
  93.  
  94. print $query->header(), 
  95.       $query->start_html(-title=>'Upload Successful'), 
  96.       $query->p('Thanks for uploading your photo!'), 
  97.       $query->p("Your email address: $email_address"), 
  98.       $query->p("Your photo $filename:"), 
  99.       $query->img({src=>"../upload/$filename",alt=>''}), 
  100.       $query->end_html; 
  101.  
  102.  
  103. sub error { 
  104.    print $query->header(), 
  105.          $query->start_html(-title=>'Error'), 
  106.          shift, 
  107.          $query->end_html; 
  108.    exit(0); 
  109.  
  110.  
  111.    $sql = $dbh->prepare(qq{insert into samples(username, password, email_address, filename) values ( "userhello636", "passhello636", "$email_address", "$filename") } );  
  112.    $sql->execute() or die "$dbh->errstr\n";;  
  113.  
  114. $sql = $dbh->prepare(qq{SELECT * FROM samples});  
  115.  $sql->execute(); 
  116.  
  117.  
  118. while (my @data = $sql->fetchrow_array()){  
  119.  
  120.       # Print the date from the first four columns in the table  
  121.       print $data[0], "\t", $data[1], "\t", $data[2], "\t", $data[3], "<br>";  
  122.  
  123. }
  124. 1;
  125.  
  126.  

CPAN install of DBD::mysql
=====================

cpan> install DBD::mysql
Database was generated on Wed, 29 Oct 2008 07:52:22 GMT
Running install for module 'DBD::mysql'
Running make for C/CA/CAPTTOFU/DBD-mysql-4.010.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\C\CA\CAPTTOF U\DBD-mysql-4.010
.tar.gz ok
Scanning cache C:\strawberry\cpan\build for sizes
.................................................. ..........................DONE


CPAN.pm: Going to build C/CA/CAPTTOFU/DBD-mysql-4.010.tar.gz

Use of uninitialized value $ENV{"USER"} in concatenation (.) or string at Makefi
le.PL line 488.
Use of uninitialized value in concatenation (.) or string at Makefile.PL line 48
8.


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user '' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to ''@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.pl --testuser=username

Failed to determine directory of mysql.h. Use

perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type

perl Makefile.PL --help
Warning: No success on command[C:\strawberry\perl\bin\perl.exe Makefile.PL]
CAPTTOFU/DBD-mysql-4.010.tar.gz
C:\strawberry\perl\bin\perl.exe Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Failed during this command:
CAPTTOFU/DBD-mysql-4.010.tar.gz : writemakefile NO 'C:\strawberry\
perl\bin\perl.exe Makefile.PL' returned status 512
Oct 29 '08 #59
KevinADC
4,059 Expert 2GB
Edit.... comments removed.
Oct 29 '08 #60
happyse27
236 100+
Hi Kevin,

??? What happened?


Thanks in advance,
Andrew
Oct 29 '08 #61
happyse27
236 100+
Hi Kevin / All,

Any one can help on how to make the DBD::mysql above work in strawberry perl cpan?

Appreciated.


Cheers...
Andrew
Oct 29 '08 #62
KevinADC
4,059 Expert 2GB
Hi Kevin,

??? What happened?


Thanks in advance,
Andrew

Nothing, I posted something then realized it was wrong or irrelevant so I removed my comments. I don't even remember now what it was.

Regards,
Kevin
Oct 29 '08 #63
happyse27
236 100+
Hi Kevin,

Thanks! How to shed some light on the DBD::mysql above? Appreciated again.


Cheers..
Andrew
Oct 29 '08 #64
happyse27
236 100+
Hi All,

I tried strawberry perl to compile DBD::mysql and got the error below. Any idea how to resolve, tried to download earlier version DBD::mysql 4.09 instead of current 4.10. But still cant work....???


Thanks in advance,
Andrew

Expand|Select|Wrap|Line Numbers
  1.  
  2. cpan> install DBD:mysql
  3. Running install for module 'DBD::mysql'
  4. Running make for C/CA/CAPTTOFU/DBD-mysql-4.010.tar.gz
  5.   Has already been unwrapped into directory C:\strawberry\cpan\build\DBD-mysql-4
  6. .010-N1_HUn
  7.   'C:\strawberry\perl\bin\perl.exe Makefile.PL' returned status 512, won't make
  8. Running make test
  9.   Make had some problems, won't test
  10. Running make install
  11.   Make had some problems, won't install
  12.  
  13.  
Oct 29 '08 #65
happyse27
236 100+
I deleted all the necessary perl installation and removed the entire perl programs and reinstalled everything after rebooting but was unable to get DBD::mysql working... Kindly HELP!! Thanks!
Oct 29 '08 #66
KevinADC
4,059 Expert 2GB
Sorry, I don't use strawberry perl and I have no idea what the problem is. Hopefully Jeff can help you out.
Oct 29 '08 #67
numberwhun
3,509 Expert Mod 2GB
I don't know if it matters, but do you have mysql installed? I just uninstalled Strawberry Perl, re-installed it, tried to install DBD::mysql module and it failed in a similar maner. I don't have mysql installed so I can only imagine that is why the 'test' failed.

Regards,

Jeff
Oct 29 '08 #68
eWish
971 Expert 512MB
MySQL does have to be installed before you can add the DBD module for the DBI. Also, it has to either be on the same drive as Strawberry or in the setup you have to point it to where the mysql executable is located.

--Kevin
Oct 29 '08 #69
numberwhun
3,509 Expert Mod 2GB
MySQL does have to be installed before you can add the DBD module for the DBI. Also, it has to either be on the same drive as Strawberry or in the setup you have to point it to where the mysql executable is located.

--Kevin
Its always a good idea to put the path to where the executable is located, in your system path. That way it can easily be found.

BTW, I was pretty positive on that but thanks for backing me up Kevin. I confirmed it after I posted it.

Regards,

Jeff
Oct 30 '08 #70
happyse27
236 100+
Hi Kevin and Jeff,

Thanks again, after testing and trying out many times, I guess I am closer but why still so far far away.??? The mysql server is installed in c:drive(cant select drive), so is strawberry perl. STILL Very confused.


Thanks in advance
Andrew

Tried 4 methods which recommended by install.html, especially instruction from item e) below.

a) The CPAN installation still gives the error below.

b) strawberry makefile installation problem (followed install.html in strawberry perl)

c) side track abit(mysql connection manually from dos, having problem, not sure it is related to this problem, and what is the syntax?)

d) Error in mysql compilation as suggested by Install.html in strawberry perl



a) Error CPAN
===========

cpan> install DBD::mysql
Running install for module 'DBD::mysql'
Running make for C/CA/CAPTTOFU/DBD-mysql-4.010.tar.gz
Has already been unwrapped into directory C:\strawberry\cpan\build\DBD-mysql-4
.010-y0lPqJ
'C:\strawberry\perl\bin\perl.exe Makefile.PL' returned status 512, won't make
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install



b) strawberry perl "perl makefile.PL" problem
================================
C:\strawberry\perl\bin>perl Makefile.Pl
Can't open perl script "Makefile.Pl": No such file or directory

C:\strawberry\perl\bin>perl Makefile.PL
Can't open perl script "Makefile.PL": No such file or directory

C:\strawberry\perl\bin>perl Makefile.PL --testdb=test
Can't open perl script "Makefile.PL": No such file or directory



c) mysql connection error - can login via sqylog using correct username and password
================================================== =====

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql mysql@localhost
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: N
O)

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql mysql1@localhost
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: N
O)

C:\Program Files\MySQL\MySQL Server 5.0\bin>
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql root@mysql1
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: N
O)

d) Error in mysql compilation as suggested by Install.html in strawberry perl
================================================== ====
===========================
C:\DBD-mysql-4.010>dir'
'dir'' is not recognized as an internal or external command,
operable program or batch file.

C:\DBD-mysql-4.010>dir
Volume in drive C has no label.
Volume Serial Number is CCD0-09FB

Directory of C:\DBD-mysql-4.010

10/31/2008 01:10 AM <DIR> .
10/31/2008 01:10 AM <DIR> ..
10/24/2008 06:58 AM 58,378 ChangeLog
12/05/2007 06:09 PM 2,043 constants.h
10/24/2008 06:38 AM 133,706 dbdimp.c
04/28/2008 04:36 PM 10,506 dbdimp.h
10/31/2008 01:10 AM <DIR> eg
10/24/2008 06:58 AM 30,182 INSTALL.html
10/31/2008 01:10 AM <DIR> lib
08/15/2008 06:24 AM 23,805 Makefile.PL
12/23/2006 09:54 AM 748 Makefile.PL.embedded
05/11/2008 08:24 AM 1,185 MANIFEST
01/03/2007 07:14 PM 45 MANIFEST.SKIP
10/24/2008 06:58 AM 392 META.yml
01/03/2007 07:14 PM 1,770 myld
08/15/2008 06:00 AM 19,198 mysql.xs
08/15/2008 06:26 AM 3,512 README
10/31/2008 01:10 AM <DIR> t
12/23/2006 09:54 AM 914 TODO
14 File(s) 286,384 bytes
5 Dir(s) 23,378,735,104 bytes free

C:\DBD-mysql-4.010>Makefile.pl

C:\DBD-mysql-4.010>c:\strawberry\perl\bin\perl.exe Makefile.PL
Use of uninitialized value $ENV{"USER"} in concatenation (.) or string at Makefi
le.PL line 488.
Use of uninitialized value in concatenation (.) or string at Makefile.PL line 48
8.


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user '' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to ''@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.pl --testuser=username

Failed to determine directory of mysql.h. Use

perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type

perl Makefile.PL --help

C:\DBD-mysql-4.010>c:\strawberry\perl\bin\perl.exe Makefile.PL
Use of uninitialized value $ENV{"USER"} in concatenation (.) or string at Makefi
le.PL line 488.
Use of uninitialized value in concatenation (.) or string at Makefile.PL line 48
8.


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user '' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to ''@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.pl --testuser=username

Failed to determine directory of mysql.h. Use

perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type

perl Makefile.PL --help

C:\DBD-mysql-4.010>make
'make' is not recognized as an internal or external command,
operable program or batch file.

C:\DBD-mysql-4.010>make



e) install.html instruction in strawberry perl
==============================

(On Windows you may need to replace ``make'' with ``nmake'' or ``dmake''.) If the tests seem to look fine, you may continue with

make install
If the compilation (make) or tests fail, you might need to configure some settings.

For example you might choose a different database, the C compiler or the linker might need some flags. Configuration. Compiler flags. Linker flags.

For Windows/CygWin there is a special section below. Windows/CygWin.


Configuration
The install script ``Makefile.PL'' can be configured via a lot of switches. All switches can be used on the command line. For example, the test database:

perl Makefile.PL --testdb=<db>
If you do not like configuring these switches on the command line, you may alternatively create a script called mysql_config. This is described later on.

Available switches are:
Oct 30 '08 #71
happyse27
236 100+
Also, I uninstall latest module of mysql in c:, but cannot put it to good use, why??
Oct 30 '08 #72
happyse27
236 100+
Also, I uninstall latest module of mysql in c:, but cannot put it to good use, why??
i meant unzip to C:\DBD-mysql-4.010>, not uninstall.. thanks,,,
Oct 30 '08 #73
happyse27
236 100+
Hi Sirs,

Any idea on #70 and #72 post above? Thanks in advance.


Andrew
Oct 31 '08 #74
happyse27
236 100+
Sorry any suggestionsss on #71 and #73 posts???? not #70 and #72 posts.

Thanks again,
Andrew
Oct 31 '08 #75
happyse27
236 100+
Hi All,

I would really appreciate if anyone can shed some lights on is it possible to install DBD::mysql into windows xp pro's strawberry perl.

Had gone through yahoo and google search engines and it seemed that alot of people are stuck with this?

Shall I use back activestate perl??? or any other alternative??

Please... For goodness sake, anyone can kindly advise?


Thanks in advance,
Andrew
Oct 31 '08 #76
numberwhun
3,509 Expert Mod 2GB
I am not ignoring your post, I just don't have an answer for you. I have Strawberry Perl on my system only for when I do Windows coding, which at my last job was a lot more often since that was what they used. At my present job everything is Linux/Unix and believe me, I prefer it that way.

I tried installing DBD:mysql in Strawberry Perl and also ran into a ton of issues. Being that I don't have a ton of time to try and figure them out, I don't have any answer for you. You could always ask on Perlmonks if anyone over there has any more experience with it.

Regards,

Jeff
Oct 31 '08 #77
happyse27
236 100+
Hi Jeff,

Thanks! I feel the difficulties also, this is a good news for the development.

Can I use linux OS on my windows xp as second layer OS in my development because I am using windows xp.?? or have other type of perl engine?


Thanks again,
Andrew
Oct 31 '08 #78
happyse27
236 100+
the problem i am worried is linux is not easy to configure? and not user friendly?


Thanks,
Andrew
Oct 31 '08 #79
happyse27
236 100+
Hi Guys,

Any light?


Cheers...
Andrew
Nov 2 '08 #80
numberwhun
3,509 Expert Mod 2GB
Sorry, been away and busy for a day or so.

Linux is an excellent operating system. While it is quite the change from Windows, most everyone I know who has switched to it has done so and LOVED it. Granted, there are those that are the exception to the rule, but I would say that 98% of those I turn to Linux stick with it and a bunch of them ditch it all together (although that is not an easy prospect for most, but quite possible).

If you wanted to try Linux, I would suggest that you try one of the following options:

1. Try a live distribution, which runs without overwriting what is installed on your pc. You boot from the disk (which you download and burn first) and you can try it out to see if you like it.
2. You can install Linux to a USB stick. I did this with a 2 gig stick using pendrivelinux.com and its pretty easy with their instructions. If you go with a bigger pen drive, you will have more space to play with for development.
3. Download and install vmware (server version is FREE) and install Linux into it to play with.

If you go with option 1 or 3, I would recommend trying something like Suse Linux or Fedora, which are a bit more user friendly and don't require as much Linux knowledge up front. For #2, there are versions mentioned in their installation instructions and you can just pick one.

Either way, I don't know what the issue is with installing the module under Windows. Its odd and I get similar issues. Also, Active State and Strawberry perl are pretty much the only Window$ Perl ports.

Regards,

Jeff
Nov 2 '08 #81
eWish
971 Expert 512MB
I would suggest that you either make a new thread in the Linux forum for help with the installation of Linux or you could contact a computer company local to you, and have them install it for you. I only mention this because you have had several problems and this is delaying your progress.

--Kevin
Nov 2 '08 #82
happyse27
236 100+
Thanks Sirs!

I will bear that in mind, only thing is I will first write the codes in windows activestate as I am running out of time... If the website launched successfully I will change to linux if need be...


Cheers...
Andrew
Nov 3 '08 #83

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jason Miles | last post by:
Hi, I wrote this little script to check to see if our Lotus Notes servers are running, and from the command line it works fine if I type perl notescheck.pl When I invoke the script from a web...
4
by: Craig | last post by:
I have an Access 2000 database that has a table 'tblCourse' and a table 'tblRegistration'. They are linked via a Primary key 'CourseID' in 'tblCourse' to a foreign key 'CourseID' in the...
7
by: Perks | last post by:
Hi. I am trying to find out if it is possible to open a pdf file from within PHP, and parse its contents in order to extract all form fieldnames that might have been previously setup within the...
19
Frinavale
by: Frinavale | last post by:
Filtering user input is extremely important for web programming. If input is left unfiltered users can input malicious code that can cripple your website. This article will explain how to make...
6
by: Anshul | last post by:
I want to check through perl whether javascript is enabled or disabled in mozilla browser. If it is disabled I want to display a message to user to enable it. What code can I use please help. I...
4
by: plumba | last post by:
Let me explain.... I have a form (most of which you guys have helped me with!!). The initial problem I was having is that it was holding the data in the fields after submit, I resolved this by...
22
by: owlice | last post by:
Greetings! I thought I'd add a little something to a web site, a "tip of the week," and wanted it automated so that if I get hit by a truck (or, more likely, am forgetful), the tip is updated...
5
by: patelxxx | last post by:
I have a FORM with allows user to input their name and then user clicks submit which this goes to my .cgi script. Can someone check this .cgi script as the results are not being displayed as...
1
by: polycom | last post by:
Hi, I am coding a mysql health check script. The logic is to execute the commands (only once)show status,show slave status,show variables and fetch the variable name and value in a hash refer or...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.