I'm making a website and on one of the pages, the form doesn't seem to submit on Firefox. When you hit Submit, the browser acts like it's loading a new page, but then quits. The info is submitted to the site so it can update the changes, but the actual page that it's supposed to link to doesn't load.
The page that the form submits to is the same as the page they're on (interests.cgi), but with different parameters set. Ultimately, when they hit Submit, it should take them back to the same page they're on, but with the text "Changes saved successfully." at the top of the page.
On Internet Explorer, hitting the Submit button brings up the next page successfully with this text on it, but on Firefox, the next page doesn't appear.
This page is part of a website engine that parses plain text files to find Perl code to run. Here's the source of the page:
Like I said, on Internet Explorer the pages submit and everything correctly, but on Firefox, it will send the form data to the server but not load the new page.
I tried adding a "?x=(random number)" to the <form> tag thinking that Firefox might've just been caching something, but that didn't help either.
Any help will be appreciated.
The page that the form submits to is the same as the page they're on (interests.cgi), but with different parameters set. Ultimately, when they hit Submit, it should take them back to the same page they're on, but with the text "Changes saved successfully." at the top of the page.
On Internet Explorer, hitting the Submit button brings up the next page successfully with this text on it, but on Firefox, the next page doesn't appear.
This page is part of a website engine that parses plain text files to find Perl code to run. Here's the source of the page:
Code:
<title>Edit Profile</title>
<div align="center">
==successful==
<a href="#" onClick="return showTab('basic')">Basic Info</a> |
<a href="#" onClick="return showTab('background')">Background & Lifestyle</a> |
<a href="#" onClick="return showTab('location')">Location</a> |
<a href="#" onClick="return showTab('contact')">Contact Info</a> |
<a href="#" onClick="return showTab('privacy')">Privacy Settings</a> |
<a href="#" onClick="return showTab('user')">User Info</a>
</div><p>
<form name="interests" action="%link=>interests?x=%rand%" method="post">
<input type="hidden" name="action" value="save">
<div id="tabspace">
<div id="basic">
<b class="header">Basic Info</b><p>
<b>About Me:</b><br>
<textarea cols="60" rows="10" name="aboutme" class="entry">==about==</textarea><br>
<i>(note: HTML is allowed in this field)</i><p>
<b>Display Name:</b><br>
<input type="text" size="40" name="displayname" value="==displayname==" class="entry"><p>
<b>First Name:</b><br>
<input type="text" size="40" name="firstname" value="==firstname==" class="entry"><p>
<b>Last Name:</b><br>
<input type="text" size="40" name="lastname" value="==lastname==" class="entry"><p>
<b>Birthdate:</b><br>
==birthday== (<i>why can't I edit this?</i>)<p>
<b>Gender:</b><br>
<input type="radio" name="sex" value="male" id="male"==sexmale==>
<label for="male">male</label>
<input type="radio" name="sex" value="female" id="female"==sexfemale==>
<label for="female">female</label><p>
<b>Occupation:</b><br>
<input type="text" size="40" name="occupation" value="==occupation==" class="entry"><p>
<b>Race:</b><br>
<select name="race">
<option value="==race==">==race==</option>
<option value="Asian">Asian</option>
<option value="Black / African descent">Black / African descent</option>
<option value="East Indian">East Indian</option>
<option value="Latino / Hispanic">Latino / Hispanic</option>
<option value="Middle Eastern">Middle Eastern</option>
<option value="Native American">Native American</option>
<option value="Pacific Islander">Pacific Islander</option>
<option value="White / Caucasian">White / Caucasion</option>
<option value="Other">Other</option>
<option value="">No Answer</option>
</select><p>
<b>Body Type:</b><br>
<select name="body">
<option value="==body==">==body==</option>
<option value="Slim / Slender">Slim / Slender</option>
<option value="Athletic">Athletic</option>
<option value="Average">Average</option>
<option value="Some extra baggage">Some extra baggage</option>
<option value="More to love!">More to love!</option>
<option value="Body builder">Body builder</option>
</select><p>
<b>Height:</b><br>
<input type="text" size="40" name="height" value="==height==" class="entry">
</div>
<div id="background">
<b class="header">Background & Lifestyle</b><p>
<b>Marital Status:</b><br>
<select name="marital">
<option value="==marital==">==marital==</option>
<option value="Swinger">Swinger</option>
<option value="In a relationship">In a relationship</option>
<option value="Single">Single</option>
<option value="Divorced">Divorced</option>
<option value="Widowed">Widowed</option>
<option value="Married">Married</option>
</select><p>
<b>Sexual Orientation:</b><br>
<select name="orientation">
<option value="==orientation==">==orientation==</option>
<option value="Bi">Bi</option>
<option value="Gay">Gay</option>
<option value="Lesbian">Lesbian</option>
<option value="Straight">Straight</option>
<option value="Not sure">Not sure</option>
<option value="">No answer</option>
</select><p>
<b>Hometown:</b><br>
<input type="text" size="40" name="hometown" value="==hometown==" class="entry"><p>
<b>Religion:</b><br>
<select name="religion">
<option value="==religion==">==religion==</option>
<option value="Agnostic">Agnostin</option>
<option value="Atheist">Atheist</option>
<option value="Buddhist">Buddhist</option>
<option value="Catholic">Catholic</option>
<option value="Christian">Christian</option>
<option value="Hindu">Hindu</option>
<option value="Jewish">Jewish</option>
<option value="Mormon">Mormon</option>
<option value="Muslim">Muslim</option>
<option value="Protestant">Protestant</option>
<option value="Scientology">Scientology</option>
<option value="Taoist">Taoist</option>
<option value="Wiccan">Wiccan</option>
<option value="Other">Other</option>
<option value="">No answer</option>
</select><p>
<b>Smoker:</b><br>
<select name="smoker">
<option value="==smoker==">==smoker==</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
<option value="">No answer</option>
</select><p>
<b>Drinker:</b><br>
<select name="drinker">
<option value="==drinker==">==drinker==</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
<option value="">No answer</option>
</select><p>
<b>Children:</b><br>
<select name="children">
<option value="==children==">==children==</option>
<option value="I don't want kids">I don't want kids</option>
<option value="Someday">Someday</option>
<option value="Undecided">Undecided</option>
<option value="Love kids, but not for me">Love kids, but not for me</option>
<option value="Proud parent">Proud parent</option>
<option value="">No answer</option>
</select><p>
<b>Education:</b><br>
<select name="education">
<option value="==education==">==education==</option>
<option value="Some high school">Some high school</option>
<option value="In high school">In high school</option>
<option value="High school">High school</option>
<option value="Some college">Some college</option>
<option value="In college">In college</option>
<option value="College graduate">College graduate</option>
<option value="Grad / professional school">Grad / professional school</option>
<option value="Post grad">Post grad</option>
<option value="">No answer</option>
</select>
</div>
<div id="location">
<b class="header">Location</b><p>
<b>Country:</b><br>
<select name="country">
<option value="==country==">==country==</option>
<option value="AF">Afghanistan</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>
<option value="AG">Antigua and Barbuda</option>
<option value="AR">Argentina</option>
<option value="AM">Armenia</option>
<option value="AW">Aruba</option>
<option value="AU">Australia</option>
<option value="AT">Austria</option>
<option value="AZ">Azerbaijan</option>
<option value="BS">Bahamas</option>
<option value="BH">Bahrain</option>
<option value="BD">Bangladesh</option>
<option value="BB">Barbados</option>
<option value="BY">Belarus</option>
<option value="BE">Belgium</option>
<option value="BZ">Belize</option>
<option value="BJ">Benin</option>
<option value="BM">Bermuda</option>
<option value="BT">Bhutan</option>
<option value="BO">Bolivia</option>
<option value="BA">Bosnia and Herzegowina</option>
<option value="BW">Botswana</option>
<option value="BV">Bouvet Island</option>
<option value="BR">Brazil</option>
<option value="IO">British Indian Ocean Territory</option>
<option value="BN">Brunei Darussalam</option>
<option value="BG">Bulgaria</option>
<option value="BF">Burkina Faso</option>
<option value="BI">Burundi</option>
<option value="KH">Cambodia</option>
<option value="CM">Cameroon</option>
<option value="CA">Canada</option>
<option value="CV">Cape Verde</option>
<option value="KY">Cayman Islands</option>
<option value="CF">Central African Republic</option>
<option value="TD">Chad</option>
<option value="CL">Chile</option>
<option value="CN">China</option>
<option value="CX">Christmas Island</option>
<option value="CC">Cocoa (Keeling) Islands</option>
<option value="CO">Colombia</option>
<option value="KM">Comoros</option>
<option value="CG">Congo</option>
<option value="CK">Cook Islands</option>
<option value="CR">Costa Rica</option>
<option value="CI">Cote Divoire</option>
<option value="CT">Croatia (Hrvatska)</option>
<option value="CU">Cuba</option>
<option value="CY">Cyprus</option>
<option value="CZ">Czech Republic</option>
<option value="DK">Denmark</option>
<option value="DJ">Djibouti</option>
<option value="DM">Dominica</option>
<option value="DO">Dominican Republic</option>
<option value="TP">East Timor</option>
<option value="EC">Ecuador</option>
<option value="EG">Egypt</option>
<option value="SV">El Salvador</option>
<option value="GQ">Equatorial Guinea</option>
<option value="ER">Eritrea</option>
<option value="EE">Estonia</option>
<option value="ET">Ethiopia</option>
<option value="FK">Falkland Islands (Malvinas)</option>
<option value="FO">Faroe Islands</option>
<option value="FJ">Fiji</option>
<option value="FI">Finland</option>
<option value="FR">France</option>
<option value="GA">Gabon</option>
<option value="GM">Gambia</option>
<option value="GE">Georgia</option>
<option value="DE">Germany</option>
<option value="GH">Ghana</option>
<option value="GI">Gibraltar</option>
<option value="GR">Greece</option>
<option value="GL">Greenland</option>
<option value="GD">Grenada</option>
<option value="GU">Guam</option>
<option value="GT">Guatemala</option>
<option value="GN">Guinea</option>
<option value="GW">Guinea-Bissau</option>
<option value="GY">Guyana</option>
<option value="HT">Haiti</option>
<option value="HM">Heard and Mc Donald Islands</option>
<option value="HN">Honduras</option>
<option value="HK">Hong Kong</option>
<option value="HU">Hungary</option>
<option value="IS">Iceland</option>
<option value="IN">India</option>
<option value="ID">Indonesia</option>
<option value="IR">Iran (Islamic Republic of)</option>
<option value="IQ">Iraq</option>
<option value="IE">Ireland</option>
<option value="IL">Israel</option>
<option value="IT">Italy</option>
<option value="JM">Jamaica</option>
<option value="JP">Japan</option>
<option value="JO">Jordan</option>
<option value="KZ">Kazakhstan</option>
<option value="KE">Kenya</option>
<option value="KI">Kiribati</option>
<option value="KP">Korea, Democratic Peoples Republic of</option>
<option value="KR">Korea, Republic of</option>
<option value="KW">Kuwait</option>
<option value="KG">Kyrgyzstan</option>
<option value="LA">Lao Peoples Democratic Republic</option>
<option value="LV">Latvia</option>
<option value="LB">Lebanon</option>
<option value="LS">Lesotho</option>
<option value="LR">Liberia</option>
<option value="LY">Libyan Arab Jamahiriya</option>
<option value="LI">Liechtenstein</option>
<option value="LT">Lithuania</option>
<option value="LU">Luxembourg</option>
<option value="MO">Macau</option>
<option value="MK">Macedonia, The Former Yugoslav Republic of</option>
<option value="MG">Madagascar</option>
<option value="MW">Malawi</option>
<option value="MY">Malaysia</option>
<option value="MV">Maldives</option>
<option value="ML">Mali</option>
<option value="MT">Malta</option>
<option value="MH">Marshall Islands</option>
<option value="MR">Mauritania</option>
<option value="MU">Mauritius</option>
<option value="MX">Mexico</option>
<option value="FM">Micronesia, Federated States of</option>
<option value="MD">Moldova, Republic of</option>
<option value="MC">Monaco</option>
<option value="MN">Mongolia</option>
<option value="MS">Montserrat</option>
<option value="MA">Morocco</option>
<option value="MZ">Mozambique</option>
<option value="MM">Myanmar</option>
<option value="NA">Namibia</option>
<option value="NR">Nauru</option>
<option value="NP">Nepal</option>
<option value="NL">Netherlands</option>
<option value="AN">Netherlands Antilles</option>
<option value="NZ">New Zealand</option>
<option value="NI">Nicaragua</option>
<option value="NE">Niger</option>
<option value="NG">Nigeria</option>
<option value="NU">Niue</option>
<option value="NF">Norfolk Island</option>
<option value="MP">Northern Mariana Islands</option>
<option value="NO">Norway</option>
<option value="OM">Oman</option>
<option value="PK">Pakistan</option>
<option value="PW">Palau</option>
<option value="PA">Panama</option>
<option value="PG">Papua New Guinea</option>
<option value="PY">Paraguay</option>
<option value="PE">Peru</option>
<option value="PH">Philippines</option>
<option value="PN">Pitcairn</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option value="PR">Puerto Rico</option>
<option value="QA">Qatar</option>
<option value="RO">Romania</option>
<option value="RU">Russian Federation</option>
<option value="RW">Rwanda</option>
<option value="KN">Saint Kitts and Nevis</option>
<option value="LC">Saint Lucia</option>
<option value="VC">Saint Vincent and the Grenadines</option>
<option value="WS">Samoa</option>
<option value="SM">San Marino</option>
<option value="ST">Sao Tome and Principe</option>
<option value="SA">Saudi Arabia</option>
<option value="SN">Senegal</option>
<option value="SC">Seychelles</option>
<option value="SL">Sierra Leone</option>
<option value="SG">Singapore</option>
<option value="SK">Slovakia (Slovak Republic)</option>
<option value="SI">Slovenia</option>
<option value="Sb">Solomon Islands</option>
<option value="SO">Somalia</option>
<option value="ZA">South Africa</option>
<option value="GS">South Georgia and the South Sandwich Islands</option>
<option value="ES">Spain</option>
<option value="LK">Sri Lanka</option>
<option value="SH">St. Helena</option>
<option value="SD">Sudan</option>
<option value="SR">Suriname</option>
<option value="SJ">Svalbard and Jan Mayen Islands</option>
<option value="SZ">Swaziland</option>
<option value="SE">Sweden</option>
<option value="CH">Switzerland</option>
<option value="SY">Syrian ArabRepublic</option>
<option value="TW">Taiwan</option>
<option value="TJ">Tajikistan</option>
<option value="TZ">Tanzania, United Republic of</option>
<option value="TH">Thailand</option>
<option value="TG">Togo</option>
<option value="TK">Tokelau</option>
<option value="TO">Tonga</option>
<option value="TT">Trinidad and Tobago</option>
<option value="TN">Tunisia</option>
<option value="TR">Turkey</option>
<option value="TM">Turkmenistan</option>
<option value="TC">Turks and Caicos Islands</option>
<option value="TV">Tuvalu</option>
<option value="UG">Uganda</option>
<option value="UA">Ukraine</option>
<option value="AE">United ArabEmirates</option>
<option value="UK">United Kingdom</option>
<option value="US" selected>United States</option>
<option value="UM">United States Minor Outlying Islands</option>
<option value="UY">Uruguay</option>
<option value="UZ">Uzbekistan</option>
<option value="VU">Vanuatu</option>
<option value="VA">Vatican City State(Holy See)</option>
<option value="VE">Venezuela</option>
<option value="VN">Viet Nam</option>
<option value="VG">Virgin Islands (British)</option>
<option value="VI">Virgin Islands (U.S.)</option>
<option value="EH">Western Sahara</option>
<option value="YE">Yeman</option>
<option value="YU">Yugoslavia</option>
<option value="ZR">Zaire</option>
<option value="ZM">Zambia</option>
<option value="ZW">Zimbabwe</option>
</select><p>
<b>City:</b><br>
<input type="text" name="city" size="30" value="==city==" class="entry"><p>
<b>State/Region:</b><br>
<input type="text" name="state" size="30" value="==state==" class="entry"><p>
<b>Zip/Postal Code:</b><br>
<input type="text" name="zipcode" size="30" value="==zipcode==" class="entry">
</div>
<div id="contact">
<b class="header">Contact Info</b><p>
<b>Public E-Mail Address</b><br>
<i>(this is the e-mail address shown on your profile)</i><br>
<input type="text" size="30" name="email" value="==email==" class="entry"><p>
<img src="$imgbase/icons/aim.gif" alt="AIM"> AOL Instant Messenger<br>
<input type="text" size="30" name="aim" value="==aim==" class="entry"><p>
<img src="$imgbase/icons/msn.gif" alt="MSN"> MSN/Windows Live Messenger<br>
<input type="text" size="30" name="msn" value="==msn==" class="entry"><p>
<img src="$imgbase/icons/yim.gif" alt="Yahoo"> Yahoo! Messenger<br>
<input type="text" size="30" name="yahoo" value="==yahoo==" class="entry"><p>
<img src="$imgbase/icons/icq.gif" alt="ICQ"> ICQ<br>
<input type="text" size="30" name="icq" value="==icq==" class="entry"><p>
<img src="$imgbase/icons/jabber.gif" alt="Jabber"> Jabber/Google Talk<br>
<input type="text" size="30" name="jabber" value="==jabber==" class="entry"><p>
<img src="$imgbase/icons/http.gif" alt="HTTP"> URL to your MySpace:<br>
<input type="text" size="30" name="myspace" value="==myspace==" class="entry"><p>
<img src="$imgbase/icons/http.gif" alt="HTTP"> URL to your blog or LiveJournal:<br>
<input type="text" size="30" name="blog" value="==blog==" class="entry"><p>
<img src="$imgbase/icons/http.gif" alt="HTTP"> URL to your website:<br>
<input type="text" size="30" name="website" value="==website==" class="entry">
</div>
<div id="privacy">
<b class="header">Privacy Settings</b><p>
<b>Who can comment on my Pictures?</b><br>
<input type="radio" name="picturecommentmode" value="1" id="priv_pic_mode_1"==priv_pic_mode_1==>
<label for="priv_pic_mode_1"> Friends Only</label><br>
<input type="radio" name="picturecommentmode" value="2" id="priv_pic_mode_2"==priv_pic_mode_2==>
<label for="priv_pic_mode_2"> Everyone</label><p>
<b>Who can comment on my Blog Entries?</b><br>
<input type="radio" name="blogcommentmode" value="1" id="priv_blog_mode_1"==priv_blog_mode_1==>
<label for="priv_blog_mode_1"> Friends Only</label><br>
<input type="radio" name="blogcommentmode" value="2" id="priv_blog_mode_2"==priv_blog_mode_2==>
<label for="priv_blog_mode_2"> Everyone</label><p>
<b>Who can comment on my Profile?</b><br>
<input type="radio" name="profilecommentmode" value="1" id="priv_pro_mode_1"==priv_pro_mode_1==>
<label for="priv_pro_mode_1"> Friends Only</label><br>
<input type="radio" name="profilecommentmode" value="2" id="priv_pro_mode_2"==priv_pro_mode_2==>
<label for="priv_pro_mode_2"> Everyone</label><p>
<b>Allow comment posters to delete their own comments?</b><br>
<input type="radio" name="delcomments" value="1" id="delcomments_1"==priv_delcomments_1==>
<label for="delcomments_1">Yes</label><br>
<input type="radio" name="delcomments" value="0" id="delcomments_0"==priv_delcomments_0==>
<label for="delcomments_0">No</label>
</div>
<div id="user">
<b class="header">User Info</b><p>
<b>Username:</b><br>
==username==<p>
<b>Password:</b><br>
******** (<a href="%link=>interests?action=newpass">change</a>)<p>
<b>User Level:</b><br>
==level== (<i>what's this?</i>)
</div>
</div>
<div align="center">
<input type="submit" value="Save All Changes" class="bttn">
</div>
</form>
<script language="JavaScript">
document.onLoad = hideTabs();
var curTab = "basic";
function hideTabs () {
if (document.getElementById) {
document.getElementById('basic').style.display = "block";
document.getElementById('background').style.display = "none";
document.getElementById('location').style.display = "none";
document.getElementById('contact').style.display = "none";
document.getElementById('privacy').style.display = "none";
document.getElementById('user').style.display = "none";
}
}
function showTab (name) {
if (document.getElementById) {
document.getElementById(curTab).style.display = "none";
document.getElementById(name).style.display = "block";
curTab = name;
}
return false;
}
</script>
<perl>
if ($xy->{logged_in}) {
my $rnd = int(rand(99999));
$xy->{content} =~ s/%rand%/$rnd/g;
my $action = $query{action} || 'index';
my $text = $query{text} || '';
# (re)load their profile.
&profileLoad ($xy->{user});
if ($text eq 'success') {
$xy->{content} =~ s/==successful==/<span class=\"error\">Changes saved successfully.<\/span><br>/g;
}
elsif ($text eq 'password') {
$xy->{content} =~ s/==successful==/<span class=\"error\">Your password has been changed successfuly.<\/span><br>/g;
}
else {
$xy->{content} =~ s/==successful==//g;
}
if ($action eq 'index') {
foreach my $field (keys %{$xy->{users}->{$xy->{user}}}) {
my $value = $xy->{users}->{$xy->{user}}->{$field};
$value =~ s/\"/"/g;
$xy->{content} =~ s/==$field==/$value/g;
}
if ($xy->{users}->{$xy->{user}}->{picturecommentmode} == 1) {
$xy->{content} =~ s/==priv_pic_mode_1==/ checked/g;
}
elsif ($xy->{users}->{$xy->{user}}->{picturecommentmode} == 2) {
$xy->{content} =~ s/==priv_pic_mode_2==/ checked/g;
}
if ($xy->{users}->{$xy->{user}}->{blogcommentmode} == 1) {
$xy->{content} =~ s/==priv_blog_mode_1==/ checked/g;
}
elsif ($xy->{users}->{$xy->{user}}->{blogcommentmode} == 2) {
$xy->{content} =~ s/==priv_blog_mode_2==/ checked/g;
}
if ($xy->{users}->{$xy->{user}}->{profilecommentmode} == 1) {
$xy->{content} =~ s/==priv_pro_mode_1==/ checked/g;
}
elsif ($xy->{users}->{$xy->{user}}->{profilecommentmode} == 2) {
$xy->{content} =~ s/==priv_pro_mode_2==/ checked/g;
}
if ($xy->{users}->{$xy->{user}}->{delcomments} == 1) {
$xy->{content} =~ s/==priv_delcomments_1==/ checked/g;
}
elsif ($xy->{users}->{$xy->{user}}->{delcomments} == 2) {
$xy->{content} =~ s/==priv_delcomments_2==/ checked/g;
}
if ($xy->{users}->{$xy->{user}}->{sex} eq 'male') {
$xy->{content} =~ s/==sexmale==/ checked/g;
}
elsif ($xy->{users}->{$xy->{user}}->{sex} eq 'female') {
$xy->{content} =~ s/==sexfemale==/ checked/g;
}
$xy->{content} =~ s/==sex(\w+)==//g;
$xy->{content} =~ s/==priv_(\w+)_mode_\d==//g;
$xy->{content} =~ s/==priv_(\w+)_\d==//g;
# Fill in their "About Me" section.
if (-f "$xy->{path}->{members}/$xy->{user}/about.txt") {
open (ABOUT, "$xy->{path}->{members}/$xy->{user}/about.txt");
my @about = <ABOUT>;
close (ABOUT);
chomp @about;
my $text = join ("\n",@about);
$xy->{content} =~ s/==about==/$text/g;
}
else {
$xy->{content} =~ s/==about==//g;
}
}
elsif ($action eq 'save') {
# Save all the incoming information. But first, filter it.
my @fields = qw(
displayname firstname lastname sex occupation race body height
country city state zipcode
marital orientation hometown religion smoker drinker children education
email aim msn yahoo jabber icq myspace blog website
picturecommentmode blogcommentmode profilecommentmode delcomments
);
my %info = (); # Profile info to send
foreach my $name (@fields) {
my $value = $query{$name};
$value = &limitHTML ($value);
$value = &removeHTML ($value);
$info{$name} = $value;
}
# Limit the HTML usage in the "About Me" section.
$query{aboutme} = &limitHTML ($query{aboutme});
# Save their "About Me" page.
open (ABOUT, ">$xy->{path}->{members}/$xy->{user}/about.txt");
print ABOUT $query{aboutme};
close (ABOUT);
# Send each value in.
&profileSend ($xy->{user}, %info);
$xy->{content} = "<include:interests?text=success>";
}
elsif ($action eq 'newpass') {
$xy->{content} = "<b class=\"header\">Change Password</b><p>\n\n"
. "To change your password, first type in your old password and then "
. "type and confirm a new password. Your password must be at least 4 "
. "characters long and contain both letters and numbers.<p>\n\n"
. "<form name=\"password\" action=\"%link=>interests\" method=\"post\">\n"
. "<input type=\"hidden\" name=\"action\" value=\"resetpass\">\n"
. "<b>Old Password:</b><br>\n"
. "<input type=\"password\" size=\"20\" name=\"old\" class=\"entry\"><p>\n\n"
. "<b>New Password:</b> (confirm)<br>\n"
. "<input type=\"password\" size=\"20\" name=\"password\" class=\"entry\"><br>\n"
. "<input type=\"password\" size=\"20\" name=\"confirm\" class=\"entry\"><p>\n\n"
. "<input type=\"submit\" value=\"Change Password\" class=\"bttn\">\n"
. "</form>";
}
elsif ($action eq 'resetpass') {
my $old = $query{old};
my $new = $query{password};
my $con = $query{confirm};
my @errors = ();
# Encode their old password.
$old = md5_hex ($old);
if ($old ne $xy->{users}->{$xy->{user}}->{password}) {
push (@errors, "Your old password is incorrect.");
}
if (length $new < 4) {
push (@errors, "Your password must be at least 4 characters long.");
}
if ($new !~ /[A-Za-z]/) {
push (@errors, "Your password must have at least one letter.");
}
if ($new !~ /[0-9]/) {
push (@errors, "Your password must have at least one number.");
}
if ($new ne $con) {
push (@errors, "Your passwords do not match.");
}
if (@errors) {
$xy->{content} = "<b class=\"header\">Password Errors:</b><p>\n\n"
. "Your password has not been changed due to the following errors:<p>\n\n"
. "¤ "
. join ("<br>\n¤ ", @errors) . "<p>\n\n"
. "<include:interests?action=newpass>";
}
else {
# Good. Save it.
$new = md5_hex ($new);
&profileSend ($xy->{user}, password => $new);
&profileLoad ($xy->{user});
my $ses = &genSession ($xy->{user},$new,$xy->{users}->{$xy->{user}}->{crypt});
# Create their cookies.
my $usercookie = $cgi->cookie (
-name => $xy->{site}->{cookies}->{username},
-value => $xy->{user},
-domain => $xy->{site}->{cookies}->{domain},
);
my $sescookie = $cgi->cookie (
-name => $xy->{site}->{cookies}->{session},
-value => $ses,
-domain => $xy->{site}->{cookies}->{domain},
);
# Print the headers.
print $cgi->header (
-content_type => 'text/html',
-cookie => [ $usercookie, $sescookie ],
);
$xy->{header} = 1;
# $xy->{content} = "new: $new<br>con: $con<br>old: $old<br>session: $ses<br>user:
$xy->{content} = "<include:interests?text=password>";
}
}
}
else {
$xy->{content} = "<include:login?error=login&linkto=interests>";
}
</perl>
Like I said, on Internet Explorer the pages submit and everything correctly, but on Firefox, it will send the form data to the server but not load the new page.
I tried adding a "?x=(random number)" to the <form> tag thinking that Firefox might've just been caching something, but that didn't help either.
Any help will be appreciated.