NoWorries Posted January 10, 2010 Share Posted January 10, 2010 It was made about a year ago and had been working fine. Last time it was known to work for sure was in early October. I got a message from someone saying they didn't think it work and I tried it through both Firefox and IE and it didn't work. What it does do right now is load up fine but when you fill out the form and hit submit it just clears the form. Since it's having the same issue on two different browsers I'm wondering if maybe my host (yahoo) did something or if it's some universal browser change. Any help would be great because I don't see anything wrong with it but I'm far from an expert. I just need to get it working again. Also here is the website to where it is if you want to see how it acts. http://www.thebrocadeblackbird.com/ then click on anything and then go to consultation. <html> <head> <style type="text/css"> head { margin: 0 0 0 0 } body { margin: 0 0 0 0 } img { position:absolute; top:0px; left:20px; } div.alertone { position:absolute; top:10px; left:295px; z-index: 1; } div.alerttwo { position:absolute; top:30px; left:68px; z-index: 1; } div.alertthree { position:absolute; top:10px; left:45px; z-index: 1; } div.one { position:absolute; top:35px; right:355px; z-index: 1; } div.two { position:absolute; top:35px; right:50px; z-index: 1; } div.three { position:absolute; top:74px; right:355px; z-index: 1; } div.four { position:absolute; top:72px; right:103px; z-index: 1; } div.five { position:absolute; top:112px; right:355px; z-index: 1; } div.six { position:absolute; top:112px; right:50px; z-index: 1; } div.seven { position:absolute; top:145px; right:505px; z-index: 1; } div.eight { position:absolute; top:145px; right:48px; z-index: 1; } div.nine { position:absolute; top:73px; right:50px; z-index: 1; } div.submit { position:absolute; top:240px; right:60px; z-index: 1; } div.required { position:absolute; top:338px; right:285px; font-size: 85%; color: #808284; z-index: 1; } </style> </head> <body> <?php # ATTENTION! - IF YOU COPY THIS CODE, CHANGE THE NEXT LINE! $to = "[email protected]"; $ask = 0; if (($FName == "") && ($Email == "") && ($PriPhone == "") && ($TimeContact == "") && ($TypeEvent == "") && ($DateEvent == "") && ($Additional == "")) { $ask = 1; } elseif (($FName == "") || ($Email == "") || ($TypeEvent == "") || ($DateEvent == "")) { $ask = 1; echo "<div class='alertone'>You missed some fields.</div>"; } if ($ask == 1) { echo " <img src='Consultation_BlueBox.jpg' /> <form name='form' method='post' action='Formmiddle.php'> <div class='one'><font color='#808284'>*</font>Name <input type='text' name='FName' value='$FName' size='20'></div> <div class='two'><font color='#808284'>*</font>E-Mail Address <input type='text' name='Email' value='$Email' size='20'></div> <div class='three'>Phone Number <input type='text' name='PriPhone' value='$PriPhone' size='20'></div> <div class='four'>Best Time to Contact <input type='text' name='TimeContact' value='$TimeContact' size='11'></div><div class='nine'><select name='AMPM' value='$AMPM'><option value='AM'>am</option><option value='PM'>pm</option></select></div> <div class='five'><font color='#808284'>*</font>Type of Event <input type='text' name='TypeEvent' value='$TypeEvent' size='20'></div> <div class='six'><font color='#808284'>*</font>Date of Event <input type='text' name='DateEvent' value='$DateEvent' size='20'></div> <div class='seven'>Additional Notes </div><div class='eight'><textarea name='Additional' rows='4' cols='54' wrap='hard'>$Additional</textarea></div> <div class='required'>*required fields</div>"; echo "<div class='submit'><input type='image'SRC='SubmitBox.jpg'></div>"; echo "</form>"; } else { $message = "Name: $FName\nE-mail: $Email\nPrimary Phone: $PriPhone\nBest Time to Contact: $TimeContact $AMPM\nType of Event: $TypeEvent\nDate of Event: $DateEvent\n Additional: $Additional\n"; $eLog="/tmp/mailError.log"; //Get the size of the error log //ensure it exists, create it if it doesn't $fh= fopen($eLog, "a+"); fclose($fh); $originalsize = filesize($eLog); mail ($to, "Website Email", $message); /* * NOTE: PHP caches file status so we need to clear * that cache so we can get the current file size */ clearstatcache(); $finalsize = filesize($eLog); //Check if the error log was just updated if ($originalsize != $finalsize) { print "<div class='alertthree'>There was a problem sending the mail. Please try again later or send the message to<a href=\"$to\">$to</a> using your own mail client progam.</div>"; } else { echo "<div class='alerttwo'>Thank you for your interest in The Brocade Blackbird. You will be contacted shortly.</div> <img src='Consultation_BlueBox.jpg' />"; } } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/187955-had-a-simple-form-script-that-suddenly-stopped-working/ Share on other sites More sharing options...
wildteen88 Posted January 10, 2010 Share Posted January 10, 2010 The problem is your code is outdated. In order for your code to work a setting called register_globals needs to be enabled. It sounds like your webhosts has now disabled this setting (which it should be) and your code no longer works. You need to update your code so it no longer relies on this setting. Please read the manual on register_globals here. Quote Link to comment https://forums.phpfreaks.com/topic/187955-had-a-simple-form-script-that-suddenly-stopped-working/#findComment-992356 Share on other sites More sharing options...
NoWorries Posted January 10, 2010 Author Share Posted January 10, 2010 Thank you I found a solution in there that allowed me to fix this. Quote Link to comment https://forums.phpfreaks.com/topic/187955-had-a-simple-form-script-that-suddenly-stopped-working/#findComment-992410 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.