By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,705 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,705 IT Pros & Developers. It's quick & easy.

how to prompt user that registration field is wrong or keyed in

100+
P: 236
Hi All,

In perl script(item b below) where we check if html registration form are filled in properly without blank with the necessary fields, how to prompt users that the field are incomplete or blank and then go back to main page(item a below user registration html page) always, something like goggle or msn login page function...


Thanks and Best Rgds,
Andrew

a) script called from user registration 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-if.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.  
  53.  
b) account management perl script(probably need to focus on if statement below)
----------------------------------------------------
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. use Email::Valid;
  82.  
  83.  
  84. my $query = CGI->new; 
  85.  
  86. unless ($CGI::VERSION >= 2.47) {  
  87.    error('Your version of CGI.pm is too old. You must have verison 2.47 or higher to use this script.') 
  88.  
  89.  
  90. #SECTION B
  91. #=========================================
  92. #Database initialization and initial query
  93. my ($dbh, $data_source);  
  94. my $mysql_server_name   = 'localhost';  
  95. my $mysql_database_name = 'test';  
  96. my $mysql_user_name     = 'root';  
  97. my $mysql_password      = 'mysql1';  
  98.  
  99. my $data_source = 'DBI:mysql:' . $mysql_database_name . ':' . $mysql_server_name;  
  100. my $dbh = DBI->connect( $data_source, $mysql_user_name, $mysql_password, {RaiseError=>1}) ||  die "$DBI::errstr";   
  101.  
  102.  
  103.  
  104.  
  105. #important line to pass email address from html to perl
  106. my $agree_field = $query->param("agree") || 'Annonymous'; 
  107. my $first_name = $query->param("fname") || 'Annonymous'; 
  108. my $last_name = $query->param("lname") || 'Annonymous'; 
  109. my $email_address = $query->param("email") || 'Annonymous'; 
  110. my $user_name = $query->param("username") || 'Annonymous'; 
  111. my $password = $query->param("pwd") || 'Annonymous'; 
  112.  
  113.  
  114. #Newly added 14th nov 08
  115. if ($agree_field == Annonymous)
  116. {
  117.    print $query->header(), 
  118.       $query->start_html(-title=>'annonymous'), 
  119.       $query->p('Please kindly agree to the terms and condition below!'), 
  120.       $query->p("You Agree? : $agree_field:"),
  121.       $query->end_html;
  122. }
  123. elsif ($agree_field != Annonymous)
  124. {
  125.      $query->start_html(-title=>'annonymous'), 
  126.       $query->p('Please kindly agree to the terms and condition below!'), 
  127.       $query->p("You Agree? : $agree_field:"),
  128.       $query->end_html;
  129. }
  130.  
  131.  
  132.  
  133.  
  134. # End of Database initial Query
  135. #==========================================
  136.  
  137. print $query->header(), 
  138.       $query->start_html(-title=>'Input Successful'), 
  139.       $query->p('Thanks for registrating your particulars with us!'), 
  140.       $query->p("You Agree? : $agree_field:"),
  141.       $query->p("Your First Name : $first_name"),
  142.       $query->p("Your last Name : $last_name"), 
  143.       $query->p("Your email address: $email_address"), 
  144.       $query->p("Your username : $user_name"), 
  145.       $query->p("Your Password : $password"), 
  146.       $query->end_html; 
  147.  
  148. sub error { 
  149.    print $query->header(), 
  150.          $query->start_html(-title=>'Error'), 
  151.          shift, 
  152.          $query->end_html; 
  153.    exit(0); 
  154.  
  155.  
  156.  
  157. my $sql = $dbh->prepare(qq{SELECT * FROM user_reg}); 
  158.    $sql->execute(); 
  159.  
  160. while (my @data = $sql->fetchrow_array()) { 
  161.  
  162.       # Print the date from the first two columns in the table 
  163.       #print $data[0], "\t", $data[1], "<br>"; 
  164.        print $data[0], "\t", $data[1], "\t", $data[2], "\t", $data[3], "\t", $data[4], "\t", $data[5], "<br>";  
  165.  
  166. 1;
  167.  
  168.  
  169.  $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") } );  
  170.    $sql->execute() or die "$dbh->errstr\n";;  
  171.  
  172. $sql = $dbh->prepare(qq{SELECT * FROM user_reg});  
  173.  $sql->execute(); 
  174.  
  175.  
  176. while (my @data = $sql->fetchrow_array()){  
  177.  
  178.       # Print the date from the first four columns in the table  
  179.       print $data[0], "\t", $data[1], "\t", $data[2], "\t", $data[3], "\t", $data[4], "\t", $data[5], "<br>";  
  180.  
  181. }
  182. 1;
  183.  
  184. #Let's see if the email_address conforms to the RFC822 specification
  185. print (Email::Valid->address($email_address) ? 'yes' : 'no');
  186.  
  187.  
  188.  
  189.  
Nov 14 '08 #1
Share this Question
Share on Google+
9 Replies


Icecrack
Expert 100+
P: 174
The answer you are looking for is in Javascript, you may do it in perl but it takes time and processing power (even if its little)

and i don't see where you are checking if all the fields are entered in your code part b.
Nov 19 '08 #2

100+
P: 236
Hi Sirs,

Thanks for big help. I found this website and made modifications and it works.

Instead of using html, just use .pl scripts to generate html and having conditions to generate same login page... Time for expansion on this module... Cheers...

Cheers...
http://www.extropia.com/tutorials/perl_cgi/form_processor.html

Thanks and Best Rgds,
Andrew
Expand|Select|Wrap|Line Numbers
  1. #!c:/perl/bin/perl.exe
  2.  
  3. #!/usr/local/bin/perl
  4.  
  5.  
  6. print "Content-type: text/html\n\n";
  7. print qq!
  8.   <HTML>
  9.   <HEAD>
  10.   <TITLE>Testing Form Input</TITLE>
  11.   </HEAD>
  12.   <BODY>
  13.   <FORM METHOD = "POST" ACTION = "fp.cgi">
  14.   <CENTER>
  15.   <TABLE BORDER = "1">
  16.   <TR>
  17.   <TH>First Name</TH>
  18.   <TD><INPUT TYPE = "text"
  19.                 NAME = "f_name"></TD>
  20.   </TR>
  21.  
  22.   <TR>
  23.   <TH>Last Name</TH>
  24.   <TD><INPUT TYPE = "text"
  25.                 NAME = "l_name"></TD>
  26.   </TR>
  27.  
  28.   <TR>
  29.   <TH>Email</TH>
  30.   <TD><INPUT TYPE = "text"
  31.                 NAME = "email"></TD>
  32.   </TR>
  33.  
  34.   </TABLE>
  35.   <P>
  36.   <INPUT TYPE = "SUBMIT">
  37.   </CENTER>
  38.   </FORM>
  39.   </BODY>
  40.   </HTML>!;
  41.  
  42.  
Nov 20 '08 #3

100+
P: 236
Hi all,

I was working on this perl codes(see section b below) to create html user registration page...

But the first 3 rows first name to email address is highlighted yellow, so is the mobile_no, the Office phone, office phone 2 and house no. The rest are all white, not sure where in the code below indicates yellow or white?

And the code did not show red(helvetica) font in the row as it is(see section a below)

Section a
===========
Expand|Select|Wrap|Line Numbers
  1.  
  2.   <TR>
  3.   <TH>First Name *</TH>
  4.   <TD><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B><INPUT TYPE = "text"
  5.                 NAME = "f_name"></B></FONT></TD>
  6.   </TR>
  7.  
  8.  
Section b - Total Code
=================
Expand|Select|Wrap|Line Numbers
  1.  
  2.   <HTML>
  3.   <HEAD>
  4.   <TITLE>Testing Form Input</TITLE>
  5.   </HEAD>
  6.   <BODY>
  7.   <FORM METHOD = "POST" ACTION = "fp.cgi">
  8.   <CENTER>
  9.   <TABLE BORDER = "1">
  10.  
  11.   <TR>
  12. <TD><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>Customer Information</B></FONT><BR><FONT
  13. SIZE="-2" FACE="verdana, arial, helvetica" COLOR="#FF0000"><B>Fields marked 
  14. with an asterisk<BR>are required input fields.</B></FONT><BR><BR></TD></TR>
  15.  
  16.  
  17.  
  18.   <TR>
  19.   <TH>First Name *</TH>
  20.   <TD><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B><INPUT TYPE = "text"
  21.                 NAME = "f_name"></B></FONT></TD>
  22.   </TR>
  23.  
  24.   <TR>
  25.   <TH>Last Name *</TH>
  26.   <TD><INPUT TYPE = "text"
  27.                 NAME = "l_name"></TD>
  28.   </TR>
  29.  
  30.   <TR>
  31.   <TH>Email Address *</TH>
  32.   <TD><INPUT TYPE = "text"
  33.                 NAME = "Email_Address"></TD>
  34.   </TR>
  35.  
  36.   <TR>
  37.   <TH>Username</TH>
  38.   <TD><INPUT TYPE = "text"
  39.                 NAME = "Username"></TD>
  40.   </TR>
  41.  
  42.   <TR>
  43.   <TH>Password *</TH>
  44.   <TD><INPUT TYPE = "text"
  45.                 NAME = "Password"></TD>
  46.   </TR>
  47.  
  48.   <TR>
  49.   <TH>Confirm Password *</TH>
  50.   <TD><INPUT TYPE = "text"
  51.                 NAME = "Confirm_Password"></TD>
  52.   </TR>
  53.  
  54.   <TR>
  55.   <TH>Mobile Phone</TH>
  56.   <TD><INPUT TYPE = "text"
  57.                 NAME = "Mobile_Phone"></TD>
  58.   </TR>
  59.  
  60.   <TR>
  61.   <TH>Company Name</TH>
  62.   <TD><INPUT TYPE = "text"
  63.                 NAME = "Company_Name"></TD>
  64.   </TR>
  65.  
  66.   <TR>
  67.   <TH>Office Phone</TH>
  68.   <TD><INPUT TYPE = "text"
  69.                 NAME = "Office_Phone"></TD>
  70.   </TR>
  71.  
  72.   <TR>
  73.   <TH>Office Phone 2</TH>
  74.   <TD><INPUT TYPE = "text"
  75.                 NAME = "Office_Phone_2"></TD>
  76.   </TR>
  77.  
  78.   <TR>
  79.   <TH>House Phone</TH>
  80.   <TD><INPUT TYPE = "text"
  81.                 NAME = "House_Phone"></TD>
  82.   </TR>
  83.  
  84.   <TR>
  85.   <TH>Fax No.</TH>
  86.   <TD><INPUT TYPE = "text"
  87.                 NAME = "Fax_No"></TD>
  88.   </TR>
  89.  
  90.   <TR>
  91.   <TH>Address</TH>
  92.   <TD><INPUT TYPE = "text"
  93.                 NAME = "Address"></TD>
  94.   </TR>
  95.  
  96.   <TR>
  97.   <TH>Office_Address</TH>
  98.   <TD><INPUT TYPE = "text"
  99.                 NAME = "Office_Address"></TD>
  100.   </TR>
  101.  
  102.   <TR>
  103.   <TH>Mailing Address (Please ignore if it is same as home address or office address</TH>
  104.   <TD><INPUT TYPE = "text"
  105.                 NAME = "Mailing_Address"></TD>
  106.   </TR>
  107.  
  108.   <TR>
  109.   <TH>Company Card Verify?</TH>
  110.   <TD><INPUT TYPE = "text"
  111.                 NAME = "CNV"></TD>
  112.   </TR>
  113.  
  114.  
  115.   <TR>
  116.   <TD><INPUT TYPE="CHECKBOX" NAME="agree" VALUE="agree"></TD>
  117.   <TD><FONT SIZE="-1" FACE="verdana, arial, helvetica"><B>I agree to the Terms 
  118.   and Conditions above.</B></FONT></TD></TR></TABLE><BR></TD>
  119.   </TR>
  120.  
  121.  
  122.   </TABLE>
  123.   <P>
  124.   <INPUT TYPE = "SUBMIT">
  125.   </CENTER>
  126.   </FORM>
  127.   </BODY>
  128.   </HTML>
  129.  
Nov 21 '08 #4

Icecrack
Expert 100+
P: 174
I had the same thing happen to me on now most of my projects,

simple answer its google desktop.

and for the red font you must post this in HTML / CSS,
Nov 23 '08 #5

100+
P: 236
Hi all,

I tried to do 1 thing, that is to put a html rectangle shape to redirect to another webpage when i print the html output below.... But it gives me error below...



Error
-------
Software error:
syntax error at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman2-if.pl line 405, near "$query"
syntax error at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman2-if.pl line 405, near "396px"
syntax error at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman2-if.pl line 405, near "169px"
syntax error at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman2-if.pl line 405, near "150px"
syntax error at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman2-if.pl line 405, near "31px"
Not enough arguments for index at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman2-if.pl line 405, near "index:"
syntax error at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman2-if.pl line 405, near "index:"
Execution of D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman2-if.pl aborted due to compilation errors.

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.  
  2. # End of Database initial Query
  3. #==========================================
  4.  
  5.  
  6. print "<HTML>";
  7. print "<BODY>";
  8. print "<FORM>";
  9. print "<CENTER>";
  10. print "<table border='3' CELLPADDING='5' WIDTH='270' BGCOLOR='#FF8000'>";
  11. print "<tr>";
  12.  
  13. print $query->header(), 
  14.       $query->start_html(-title=>'Input Successful'), 
  15.       $query->p('Thanks for registrating your particulars with us!'), 
  16.       $query->p("You Agree? : agree_field:"),
  17.       $query->p("Your First Name : $first_name"),
  18.       $query->p("Your Last Name : $last_name"), 
  19.       $query->p("Your Email Address: $email_address"), 
  20.       $query->p("Your Username : $user_name"), 
  21.       $query->p("Your Mobile Phone : $mobile_phone"),
  22.       $query->p("Your Company Name : $company_name  "), 
  23.       $query->p("Your Office Phone : $office_phone"),
  24.       $query->p("Your Office Phone 2 : $office_phone2"),
  25.       $query->p("Your House Number : $house_number"),
  26.       $query->p("Your Fax Number : $fax_number"),
  27.       $query->p("Your House Address : $house_address"),
  28.       $query->p("Your Office Address : $office_address"),
  29.       $query->p("Your Mailing Address : $mailing_address"),
  30.       $query->p("Your Certify : $certify"),
  31.       $query->p("Your MonthNum : $MonthNum"),
  32.       $query->p("Your MonthA : $MonthA"),
  33.       $query->p("Your Year : $Year"),
  34.       $query->p("Your Month : $Month"),
  35.       $query->p("Your Day : $Day"),
  36. $query->p("<body bgcolor="#FFFFFF" text="#000000">"),
  37. $query->p("<div id="bv_Shape1" style="position:absolute;left:396px;top:169px;width:150px;height:31px;z-index:0" align="center">"),
  38. $query->p("<a href="http://127.0.0.1/cgi-bin/cards2.pl"><img src="bv01016.gif" id="Shape1" align="top" alt="" title="" border="0" width="150" height="31"></a></div>"),
  39.  
  40.  
  41.       $query->end_html; 
  42.  
  43.  
  44.  
  45. print "</tr></table>";
  46. print "</CENTER>";
  47. print "</FORM>";
  48. print "</BODY>";
  49. print "</HTML>";
  50.  
  51.  
  52. sub error { 
  53.    print $query->header(), 
  54.          $query->start_html(-title=>'Error'), 
  55.          shift, 
  56.          $query->end_html; 
  57.    exit(0); 
  58.  
  59.  
Dec 23 '08 #6

KevinADC
Expert 2.5K+
P: 4,059
these lines appear to be the problem:

Expand|Select|Wrap|Line Numbers
  1. $query->p("<body bgcolor="#FFFFFF" text="#000000">"),
  2. $query->p("<div id="bv_Shape1" style="position:absolute;left:396px;top:169px;width:150px;height:31px;z-index:0" align="center">"),
  3. $query->p("<a href="http://127.0.0.1/cgi-bin/cards2.pl"><img src="bv01016.gif" id="Shape1" align="top" alt="" title="" border="0" width="150" height="31"></a></div>"),
  4.  
  5.  
You have double-quotes inside of double-quoted strings. Example:

Expand|Select|Wrap|Line Numbers
  1. $query->p("<body bgcolor="#FFFFFF" text="#000000">"),
  2.  
Could be written as:

Expand|Select|Wrap|Line Numbers
  1. $query->p(qq{<body bgcolor="#FFFFFF" text="#000000">}),
  2.  
Same with the other lines
Dec 23 '08 #7

100+
P: 236
Hi All,

I think the above example is wrong... I tried below new example with
Expand|Select|Wrap|Line Numbers
  1. $query->start_html(-title=>'Input Successful', -head=>Link({-rel=>'next',
  2.                           -href=>'http://127.0.0.1/cgi-bin/cards2.pl'})
  3.  
),
... But it does not give me any button to click. And on the webpage it only showed this message
"noStatus: 302 Found Location: http://127.0.0.1/cgi-bin/cards2.pl "

Code is below... Kindly assist... thanks...

I am just trying to insert this code or equivalent as an html shape into the main perl script... Thanks in advance.
Expand|Select|Wrap|Line Numbers
  1.   <body bgcolor="#FFFFFF" text="#000000">
  2. <div id="bv_Shape1" style="position:absolute;left:396px;top:169px;width:150px;height:31px;z-index:0" align="center">
  3. <a href="http://127.0.0.1/cgi-bin/cards2.pl"><img src="bv01016.gif" id="Shape1" align="top" alt="" title="" border="0" width="150" height="31"></a></div>
  4.  
Andrew


Expand|Select|Wrap|Line Numbers
  1.  
  2. print $query->header(), 
  3.       $query->start_html(-title=>'Input Successful', -head=>Link({-rel=>'next',
  4.                           -href=>'http://127.0.0.1/cgi-bin/cards2.pl'})
  5.                          ),
  6.  
  7.  
  8.       $query->p('Thanks for registrating your particulars with us!'), 
  9.  
  10.       $query->p("You Agree? : agree_field:"),
  11.       $query->p("Your First Name : $first_name"),
  12.       $query->p("Your Last Name : $last_name"), 
  13.       $query->p("Your Email Address: $email_address"), 
  14.       $query->p("Your Username : $user_name"), 
  15.       $query->p("Your Mobile Phone : $mobile_phone"),
  16.       $query->p("Your Company Name : $company_name  "), 
  17.       $query->p("Your Office Phone : $office_phone"),
  18.       $query->p("Your Office Phone 2 : $office_phone2"),
  19.       $query->p("Your House Number : $house_number"),
  20.       $query->p("Your Fax Number : $fax_number"),
  21.       $query->p("Your House Address : $house_address"),
  22.       $query->p("Your Office Address : $office_address"),
  23.       $query->p("Your Mailing Address : $mailing_address"),
  24.       $query->p("Your Certify : $certify"),
  25.       $query->p("Your MonthNum : $MonthNum"),
  26.       $query->p("Your MonthA : $MonthA"),
  27.       $query->p("Your Year : $Year"),
  28.       $query->p("Your Month : $Month"),
  29.       $query->p("Your Day : $Day"),
  30.  
  31.       $query->end_html; 
  32.  
  33.  
  34.  
Dec 23 '08 #8

100+
P: 236
Hihi Kevin,

Thanks! your code worked!! Sorry I missed out your reply, saw it in the nick of time

I modified to below and it worked... But I am trying to find out the one in comments worked or not?

#$query->start_html(-title=>'Input Successful', -head=>Link({-rel=>'next',

-href=>'http://127.0.0.1/cgi-bin/cards2.pl'})),


Thanks and Best Rgds,
Andrew

Expand|Select|Wrap|Line Numbers
  1. print $query->header(), 
  2.       #$query->start_html(-title=>'Input Successful', -head=>Link({-rel=>'next', 
  3.  
  4. -href=>'http://127.0.0.1/cgi-bin/cards2.pl'})),
  5.  
  6.       $query->start_html(-title=>'Input Successful'),
  7.       $query->p('Thanks for registrating your particulars with us!'), 
  8.  
  9.       $query->p("You Agree? : agree_field:"),
  10.       $query->p("Your First Name : $first_name"),
  11.       $query->p("Your Last Name : $last_name"), 
  12.       $query->p("Your Email Address: $email_address"), 
  13.       $query->p("Your Username : $user_name"), 
  14.       $query->p("Your Mobile Phone : $mobile_phone"),
  15.       $query->p("Your Company Name : $company_name  "), 
  16.       $query->p("Your Office Phone : $office_phone"),
  17.       $query->p("Your Office Phone 2 : $office_phone2"),
  18.       $query->p("Your House Number : $house_number"),
  19.       $query->p("Your Fax Number : $fax_number"),
  20.       $query->p("Your House Address : $house_address"),
  21.       $query->p("Your Office Address : $office_address"),
  22.       $query->p("Your Mailing Address : $mailing_address"),
  23.       $query->p("Your Certify : $certify"),
  24.       $query->p("Your MonthNum : $MonthNum"),
  25.       $query->p("Your MonthA : $MonthA"),
  26.       $query->p("Your Year : $Year"),
  27.       $query->p("Your Month : $Month"),
  28.       $query->p("Your Day : $Day"),
  29.       $query->p(qq{<body bgcolor="#FFFFFF" text="#000000">}), 
  30. $query->p(qq{<div id="bv_Shape1" 
  31.  
  32. style="position:absolute;left:396px;top:169px;width:150px;height:31px;z-index:0" 
  33.  
  34. align="center">}), 
  35. $query->p(qq{<a href="http://127.0.0.1/cgi-bin/cards2.pl"><img src="bv01016.gif" 
  36.  
  37. id="Shape1" align="top" alt="" title="" border="0" width="150" height="31"></a></div>}), 
  38.  
  39.  
  40.       $query->end_html; 
  41.  
Dec 23 '08 #9

KevinADC
Expert 2.5K+
P: 4,059
Sorry, I don't even know what the Link attribute is used for. I suspect its something left over from older versions of HTML but I'm not sure. What do you think it should do?

Edit....

OK, I just remembered what Link is for. I don't think you can use it to link to another perl script though. So once again, what is your intention and what do you think it should do?
Dec 23 '08 #10

Post your reply

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