I have created a couple of forms on my web site, both of which are working well with one small exception.
Convetion dictates that one of the input fields is always in upper case, and this is easy to force at the input stage with some CSS, i.e the form displays the upper case in the field, even if the user is using lower case.
However, when the "thank you" page is generated, it displays the lower case (if that is what has been used at the input stage). Likewise, the automatically generated e-mail also contains the lower case, which can be a bit confusing.
Is there a way to force the "thank you" page and e-mail to display the upper case instead of what has been typed in?
Any suggestions will be greatly appreciated.
Regards and TIA
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Yourcallsign');
$Yourcallsign = strtoupper($Yourcallsign);
pt_register('POST','Youremailaddress');
pt_register('POST','Yourquestion');
$Yourquestion=preg_replace("/(\015\012)|(\015)|
(\012)/"," <br />", $Yourquestion);if ($Yourcallsign=="" || $Youremailaddress=="" || $Yourquestion=="" ){ $errors=1; $error.="<li>You did not enter one or more of the required fields. Please go back and try again."; }
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]
=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev
($PHP_SELF),"/"));
$message="Your callsign: ".$Yourcallsign."
Your email address: ".$Youremailaddress."
Your question: ".$Yourquestion."
";
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have created a couple of forms on my web site, both of which are working well with one small exception.
Convetion dictates that one of the input fields is always in upper case, and this is easy to force at the input stage with some CSS, i.e the form displays the upper case in the field, even if the user is using lower case.
However, when the "thank you" page is generated, it displays the lower case (if that is what has been used at the input stage). Likewise, the automatically generated e-mail also contains the lower case, which can be a bit confusing.
Is there a way to force the "thank you" page and e-mail to display the upper case instead of what has been typed in?
Any suggestions will be greatly appreciated.
Regards and TIA
Simple change to the process.php file will do this. See the page url for instructions.
http://us2.php.net/function.strtoupper
Do this right after the pt_register.
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Yourcallsign');
$Yourcallsign = strtoupper($Yourcallsign);
pt_register('POST','Youremailaddress');
pt_register('POST','Yourquestion');
$Yourquestion=preg_replace("/(\015\012)|(\015)|
(\012)/"," <br />", $Yourquestion);if ($Yourcallsign=="" || $Youremailaddress=="" || $Yourquestion=="" ){ $errors=1; $error.="<li>You did not enter one or more of the required fields. Please go back and try again."; }
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]
=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev
($PHP_SELF),"/"));
$message="Your callsign: ".$Yourcallsign."
Your email address: ".$Youremailaddress."
Your question: ".$Yourquestion."
";
That seems to have sorted it out nicely. Many thanks for your help. I'd never have got there without it!
Regards