tekietek Posted February 24, 2008 Share Posted February 24, 2008 Okay, I hope I'm in the right place--if not, forgive me. But I THINK I'm having a problem with PHP. For the record, I've never dealt with PHP, so it's new and scary for me. But I have been working with HTML since high school, so I feel like I'm fairly experienced in that area. Anyway, I am trying to create a "Suggestions" Page for my website. I got a code from thefreecountry.com or some site like that, and it works beautifully. The problem is, I don't want their form (a basic Name/Email/Comment form). I want this form: http://saga.foreverfastlane.com/suggestchar.html I thought I manipulated the code and everything so that it would work, but every time I hit "submit" it brings me to my error page? I guess I need someone intelligent to go over my script and figure out where I messed up, so if anyone is up for a challenge: The problem is probably something stupid or little, but please note that I do know it's not a problem with the URL. I've switched "suggestchar.html" to "endresult.html" just to test a code. Even when it's set up from the page "suggestchar.html" it doesn't work.. "endresult.html", but that's not the problem. Even when it's set up for "suggestchar.html" I get the error Message** THIS CODE WORKS FINE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> </head> <body bgcolor="#ffffff"><br> <form method="post" action="feedback.php"> <table cellspacing="8" cellpadding="8" border="0" summary="feedback form"><tbody><tr><td>Name:</td><td> <input type="text" size="25" name="name"></td></tr><tr><td>Email address:</td><td> <input type="text" size="25" name="email"></td></tr><tr><td colspan="2"> Comments<br> <textarea name="comments" cols="45" rows="15"></textarea></td></tr><tr><td align="center" colspan="2"> <input type="submit" value="Send Feedback"><br> <a href="http://www.thesitewizard.com/">Powered by thesitewizard.com</a></td></tr></tbody></table></form> </body> </html> THIS IS MY CODE, THAT DOESN'T WORK <form method="post" action="feedback.php"> <table summary="feedback form"><tbody><tr><td> <div><font color="#666666"> </font></div> <div><font color="#666666">YOUR NAME </font><font color="#666666"> <input type="text" size="20" name="name"></font></div> <div><font color="#666666">YOUR EMAIL </font><font color="#666666"> <input type="text" size="20" name="email"></font><font color="#666666"> </font></div> <div><font color="#666666">HOW'D YOU FIND ME? </font><font color="#666666"> <input type="text" size="20" name="refer"></font></div> <div><font color="#666666">LJ or FF.NET USERNAME </font><font color="#666666"> <input type="text" size="20" name="sn"></font><br> <font color="#666666"> </font></div> <div><font color="#666666"> </font></div> <div><strong><font color="#666666">ABOUT YOUR CHARACTER</font></strong></div> <div><font color="#666666"> </font></div> <div><font color="#666666">NAME </font><font color="#666666"> <input type="text" size="20" name="charname:"> </font></div> <div><font color="#666666">GENDER</font><font color="#666666"> <input type="text" size="20" name="gender:"> </font></div> <div><font color="#666666">GOOD OR EVIL </font><font color="#666666"> <input type="text" size="20" name="side:"> </font></div> <div><font color="#666666">ABILITIES </font><font color="#666666"> <input type="text" size="20" value="if applicable" name="ability:"></font></div> <div><font color="#666666">BIO INFO </font><font color="#666666"> <input type="text" size="20" value="Personality, Job, Etc." name="bio"></font><font color="#666666"> <br> </font></div> <div><font color="#666666">PHYSICAL DESCRIPTION </font><font color="#666666"> <input type="text" size="20" value="..looks like.." name="desc:"></font><font color="#666666"> <br> </font></div> <div><font color="#666666"> </font></div> <div><font color="#666666"> </font></div> <div><font color="#666666"> </font></div><font color="#666666"><br> <input type="submit" value="Send Feedback"> <input type="reset" value="Reset"></font> </td></tr></tbody></table></form> The PHP code I have is as follows: <?php /* CHFEEDBACK.PHP Feedback Form PHP Script Ver 2.08 Generated by thesitewizard.com's Feedback Form Wizard. Copyright 2000-2007 by Christopher Heng. All rights reserved. thesitewizard and thefreecountry are trademarks of Christopher Heng. Get the latest version, free, from: http://www.thesitewizard.com/wizards/feedbackform.shtml You can read the Frequently Asked Questions (FAQ) at: http://www.thesitewizard.com/wizards/faq.shtml I can be contacted at: http://www.thesitewizard.com/feedback.php Note that I do not normally respond to questions that have already been answered in the FAQ, so *please* read the FAQ. LICENCE TERMS 1. You may use this script on your website, with or without modifications, free of charge. 2. You may NOT distribute or republish this script, whether modified or not. The script can only be distributed by the author, Christopher Heng. 3. THE SCRIPT AND ITS DOCUMENTATION ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE IMPLIED WARRANTY OF MECHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. YOU AGREE TO BEAR ALL RISKS AND LIABILITIES ARISING FROM THE USE OF THE SCRIPT, ITS DOCUMENTATION AND THE INFORMATION PROVIDED BY THE SCRIPTS AND THE DOCUMENTATION. If you cannot agree to any of the above conditions, you may not use the script. Although it is not required, I would be most grateful if you could also link to thesitewizard.com at: http://www.thesitewizard.com/ */ // ------------- CONFIGURABLE SECTION ------------------------ // $mailto - set to the email address you want the form // sent to, eg //$mailto = "youremailaddress@example.com" ; $mailto = 'doherty33@gmail.com' ; // $subject - set to the Subject line of the email, eg //$subject = "Feedback Form" ; $subject = "** CHATARCTER SUGGESTION **" ; // the pages to be displayed, eg //$formurl = "http://www.example.com/feedback.html" ; //$errorurl = "http://www.example.com/error.html" ; //$thankyouurl = "http://www.example.com/thankyou.html" ; $formurl = "http://saga.foreverfastlane.com/endresult.html" ; $errorurl = "http://saga.foreverfastlane.com/missing.html" ; $thankyouurl = "http://saga.foreverfastlane.com/thanks.html" ; $uself = 0; // -------------------- END OF CONFIGURABLE SECTION --------------- $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $name = $_POST['name'] ; $email = $_POST['email'] ; $comments = $_POST['comments'] ; $uname = $_POST['uname'] ; $refer = $_POST['refer'] ; $cname = $_POST['cname'] ; $ability = $_POST['ability'] ; $gender = $_POST['gender'] ; $bio = $_POST['bio'] ; $desc = $_POST['desc'] ; $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (empty($name) || empty($email) || empty($comments)) { header( "Location: $errorurl" ); exit ; } if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ; } if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $name\n" . "Email of sender: $email\n" . "Referral: $refer\n" . "username: $uname\n" . "Suggested Character Name: $cname\n" . "Ability: $ability\n" . "Gender: $gender\n" . "Side: $side\n" . "Biography: $bio\n" . "Physical Description: $desc\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.08" ); header( "Location: $thankyouurl" ); exit ; ?> Quote Link to comment https://forums.phpfreaks.com/topic/92736-scared-lost-and-confused-with-the-php-world/ Share on other sites More sharing options...
Lamez Posted February 24, 2008 Share Posted February 24, 2008 What is your error? Also you set your formaction to form.php, make sure that is the name of the php file. Quote Link to comment https://forums.phpfreaks.com/topic/92736-scared-lost-and-confused-with-the-php-world/#findComment-475135 Share on other sites More sharing options...
tekietek Posted February 24, 2008 Author Share Posted February 24, 2008 Thanks for replying, sorry if I confused you. When I set up the php code to use the suggestchar script, it tells me that the "page is missing" Originally it said "suggestchar" wasn't on the server or something like that, but now it just brings me to my error page. When I set the php code to use the "endresult" script, it works perfectly. I get the response no problem. I am just trying to figure out why the endresult code works, and why the suggestchar didn't work. Quote Link to comment https://forums.phpfreaks.com/topic/92736-scared-lost-and-confused-with-the-php-world/#findComment-475150 Share on other sites More sharing options...
tekietek Posted February 24, 2008 Author Share Posted February 24, 2008 Okay, try this: http://saga.foreverfastlane.com/suggestchar.html If you submit a character to me, I won't get it. It says that a page is missing. When I use the first code I posted, it works fine. But I don't want that form, I want my form. I must have screwed something up with the code. Quote Link to comment https://forums.phpfreaks.com/topic/92736-scared-lost-and-confused-with-the-php-world/#findComment-475157 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.