ok Posted October 18, 2008 Share Posted October 18, 2008 hallo, I have a form when you press the submit button it should display the form again. But unfortunately it doesn't. It display the page but without the form. take note it has database. It will select, insert query... i don't think posting the codes here is nice, because the codes is too long. actually these codes works before with the original website. I transfered it into different webhosting company with different website name. My question is what is the common problem for this? I hope someone will help me and give advice. Thank you in advance.. Link to comment https://forums.phpfreaks.com/topic/128946-the-form-dont-display-why/ Share on other sites More sharing options...
beansandsausages Posted October 18, 2008 Share Posted October 18, 2008 code maybe??? in [ code ][ /code ] tags please. Link to comment https://forums.phpfreaks.com/topic/128946-the-form-dont-display-why/#findComment-668528 Share on other sites More sharing options...
ok Posted October 18, 2008 Author Share Posted October 18, 2008 ok here is the form codes, <?php session_start(); //get person referer. $rfull_name = $_GET['ufull_name']; ############## #echo "rfull_name: ". $rfull_name; $_SESSION['rfull_name'] = $rfull_name; ?> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <form action="process_contest.php" method="post" enctype="multipart/form-data" name="msgform" id="msgform"> <tr align="center"> <td colspan="2"> <p align="left"> </p> </tr> <tr> <td colspan="2" align="right"><div align="center"><strong>"Tell a Friend and win a $100 gas card every week"</strong></div></td> </tr> <tr> <td colspan="2" align="right"><div align="center"><strong>Your information </strong></div></td> </tr><tr> <td align="right" width="150"><img src="/images.1x1.gif" alt="" width="150" height="1" border="0"></td> <td></td> </tr><tr> <td align="right" bgcolor="ffffff" valign="top">First name : </b> </td> <td bgcolor="ffffff"> <input type="text" name="ufname" size="50" maxLength="150" value=""> <strong></strong></td> </tr> <tr> <td align="right">Last name: </td> <td> <input type="text" name="ulname" size="50" maxLength="50" value=""> </td> </tr><tr> <td align="right">Email address : </td> <td> <input name="uemail" type="text" size="50" maxlength="50"></td> </tr> <tr> <td align="right"> </td> <td><div align="center"></div></td> </tr> <tr> <td align="right"> </td> <td> </td> </tr> <tr> <td align="right"> </td> <td><div align="center"><strong> </strong></div></td> </tr> <tr> <td colspan="2" align="right"><div align="center"><strong>Your friend's information </strong> </div> <div align="center"></div> <div align="center"></div> <div align="center"></div> <div align="center"></div> <div align="center"></div> <div align="center"> <SCRIPT><!-- function updateTextField0() { document.formadd.DOB.value = document.formadd.TempMonth0.options[document.formadd.TempMonth0.selectedIndex].value + '/' + document.formadd.TempDay0.options[document.formadd.TempDay0.selectedIndex].value + '/' + document.formadd.TempYear0.options[document.formadd.TempYear0.selectedIndex].value } //--> </SCRIPT> </div></td> </tr> <tr> <td align="right">First name </td> <td><input name="ffname" type="text" id="ffname" size="50" maxlength="50"> </td> </tr> <tr> <td align="right">Last name : </td> <td> <input name="flname" type="text" id="flname" onKeyUp="javascript:changeCase(formadd.Address)" value="" size="50" maxLength="50"></td> </tr><tr> <td align="right">Email address : </td> <td> <input name="femail" type="text" id="femail" value="" size="50" maxLength="100"></td> </tr><tr> <td align="right"> </td> <td> </td> </tr><tr> <td align="right"> </td> <td align="center"> <input type="submit" value="Submit" name="action" onclick="return checkForm();"/> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="f2f2f2"> </td> </tr> <tr> <td align="right"></TD> <td align="right"> <tr> <td align="right"><div align="center"><img name="gasholder" src="images_contest/gasoline_boy.jpg" width="172" height="152" alt=""></div></TD> <td align="center"><p><strong>How it works?</strong></p> <p align="left">We're giving away $200 in gas EVERY week! </p> <p align="left">Tell your friends or co-workers about our free, weekly email service. When you refer a friend, they are sent an e-mail describing our service. They sign themselves up. Remember, you are not entering your friend into our database, they choose if they want to participate. We never SPAM people and we never sell emails, so this means you can recommend our Wednesday email blast with confidence to everyone at work, school, and play. </p> <p align="left">There are two ways to win each week: </p> <p align="left">1) $100 goes to the person who refers the most, and <br> 2) $100 goes to a randomly-selected winner. </p> <p align="left">1) Our contest tracks the number of your friends who subscribe. You automatically win $100 of free gas (given out each week) if you get the most friends to join in any one week. We publish the Top 10 performers so you can see how close you are to winning. The contest resets every Sunday morning at 12:01 am. 2) We randomly pick a winner from those who have referred at least one friend (who subscribed), so if you tell 20 friends and 20 friends join, you have 20 chances to win. </p> <p align="left">So what are you waiting on? Fill out the fields above and get started. </p> <p align="left"> </p> </td> </tr> </form> </table> and here is the 2nd form or 2nd page. <?php //open database connection. include 'opendb.php'; $tmp_dir = 'http://' . $_SERVER['HTTP_HOST'] . '/contest.php?'; //catching the values. $ufname = $_POST['ufname']; $ulname = $_POST['ulname']; $uemail = $_POST['uemail']; $ffname = $_POST['ffname']; $flname = $_POST['flname']; $femail = $_POST['femail']; ?> <?php $space_tmp = ' '; $ufull_name = $ufname . $space_tmp . $ulname; $ffull_name = $ffname . $space_tmp . $flname; //verify friend if already exist in the database. $query = "SELECT * FROM invitation WHERE invited='$ffull_name'"; $result = mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); $row = mysql_fetch_array($result); $finvited = $row['invited']; //verify if user name already exist. $query = "SELECT user_name FROM user_join WHERE user_name='$ufull_name'"; $result = mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); $row = mysql_fetch_array($result); $user_tmp = $row['user_name']; //search user name record for verification $query = "SELECT invited FROM invitation WHERE invited='$ffull_name'"; $result = mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); $row = mysql_fetch_array($result); $person_referer = $row['invited']; //retrieving referer user name. #$rfull_name = $_SESSION['rfull_name']; $rfull_name = $_SESSION['rfull_name']; ########## # echo "rfull_name: ". $rfull_name; //adding record. if($ffull_name == $finvited) { echo "<center>"; echo "<br><h3> Sorry, $ffull_name is already invited, please try another person to invite.</h3>"; echo "</center>"; } elseif($ffull_name != $finvited) { $query = "INSERT INTO user_join (user_name, email, invited_by, date_join) VALUES ('$ufull_name', '$uemail', '$rfull_name', now())"; mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); if(person_referer != $rfull_name) { $query = "INSERT INTO invitation (user_name, invited) VALUES ('$ufull_name', '$ffull_name')"; mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); } ##################################### # Email referer if friend join. BEGIN include 'count_invited.php'; if($rfull_name != '') { $query = "SELECT user_name, email FROM user_join WHERE user_name='$rfull_name'"; $result = mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); $row = mysql_fetch_array($result); $referer_email = $row['email']; //Count number of invited person. $query = "SELECT * FROM ranking WHERE name='$rfull_name'"; $result = mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); $row = mysql_fetch_array($result); $rank = $row['rank']; //find email addres of referer $recepient = $referer_email; $subject = "Your friend just joined!"; $message = " <html> <head> </head> <body> <h3>Dear subscriber.</h3><br><br> Congratulations!, Your friend, $ufull_name, has subscribed to the <br> Lexington SuddenValues weekly eBlast. This means you have been entered <br> into our gas card drawing. To increase your chances of winning, <br> you can refer another friend by clicking <a href=\"http://www.lexingtonssuddenvalues.com/center.php\">here.</a> <br><br> Joe and Kathy, Lexington SuddenValues<br> </body> </html>"; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: lexingtonssuddenvalues.com <[email protected]>' . "\r\n"; $headers .= 'Cc: [email protected]' . "\r\n"; $headers .= 'Bcc: [email protected]' . "\r\n"; // multiple recipients $to = $referer_email; mail($to, $subject, $message, $headers); } # Email referer if friend join. END ##################################### $ffname2 = $ffname; $ffname2 = ucfirst($ffname2); echo "<br>"; echo "<h3>"; echo " $ffname2 has been sent an invitation to join Lexington SuddenValues. <br>"; echo " Send invitation to another friend to increases your chances of winning."; echo "</h3>"; echo "</br>"; ?> <?php $recepient = $uemail; $subject = "Tell a Friend Contest!"; $message = " <html> <head> </head> <body> <b>Dear $ufname,</b><br><br> Welcome to the Lexington SuddenValues weekly eBlast. <br> Of course you can opt out anytime you wish. <br> We look forward to sharing with you the inside scoop on where <br> to get the best bang for your buck in the Bluegrass. <br> You can print offers that are currently available by visiting us <br> at http://lexington.suddenvalues.com. <br> You will receive the latest specials via email each Wednesday. <br><br> We rely on feedback from our members to find the best values in town, <br> so make sure to share with us your favorites and we will do our best <br> to get them to join the program. <br> Any business you recommend who joins the program will earn you a $25 gift certificate.<br><br> Until Wednesday, <br><br> Joe and Kathy, Lexington SuddenValues <br><br> </body> </html>"; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: lexingtonssuddenvalues.com <[email protected]>' . "\r\n"; $headers .= 'Cc: [email protected]' . "\r\n"; $headers .= 'Bcc: [email protected]' . "\r\n"; #$headers = "Reply-to: [email protected]\n"; #mail($recepient, $subject, $contents, "From: [email protected]"); // multiple recipients $to = $uemail; mail($to, $subject, $message, $headers); ?> <?php $_POST['ufull_name'] = $ufull_name; $recepient = $femail; $subject = "Tell a Friend Contest!"; $message = " <html> <head> </head> <body> <h3>Dear $ffname,</h3><br><br> Your friend, $ufname $ulname, is saving big with Lexington SuddenValues <br> and wanted to invite you to subscribe to their weekly eBlast. <a href=\"http://www.lexingtonssuddenvalues.com/contest.php?ufull_name={$ufull_name} \">Click here </a>to subscribe. <br> This weekly update has been called “the hottest e-mail in town,” and is especially popular <br> in this tough economy. Who wouldn’t want to get great offers from LOCAL businesses each <br> week delivered to their inbox? <b>Your e-mail is protected in our system and we never, ever, <br> ever sell it to anyone.</b><br><br> Lexington SuddenValues is a free service that is saving local shoppers thousands of dollars <br> this year. Each Wednesday morning you receive one email that keeps you connected to the latest <br> values and offers from participating merchants, such as: Collins Bowling, Mancino’s, Gattitown, <br> Arby’s, Cheapside, Schlotsky’s, and dozens more. You can print these offers and use them at local <br> restaurants, retail stores, and service providers. <br><br> By subscribing to our free service, you are automatically entered in a drawing to win <br> a flat screen TV. <b>Also we’re giving away $200 in gas money each week.</b> <a href=\"http://www.lexingtonssuddenvalues.com/contest.php?ufull_name={$ufull_name} \">Click here</a> for details <br> on that contest. You can opt out at any time, so register with confidence by <a href=\"http://www.lexingtonssuddenvalues.com/contest.php?ufull_name={$ufull_name} \">clicking here.</a> <br><br> We look forward to serving you, <br><br> Joe and Kathy, Lexington SuddenValues <br><br> </body> </html>"; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: lexingtonssuddenvalues.com <[email protected]>' . "\r\n"; $headers .= 'Cc: [email protected]' . "\r\n"; $headers .= 'Bcc: [email protected]' . "\r\n"; // multiple recipients $to = $femail; mail($to, $subject, $message, $headers); } ?> <form action="process_contest.php" method="post" enctype="multipart/form-data" name="msgform" id="msgform"> <table width="514" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="189"><div align="right">First name : </div></td> <td width="325"><input type="text" name="ufname" size="50" maxLength="150" value="<?php echo $ufname; ?>"></td> </tr> <tr> <td><div align="right">Last name: </div></td> <td><input type="text" name="ulname" size="50" maxLength="50" value="<?php echo $ulname; ?>"></td> </tr> <tr> <td><div align="right">Email address : </div></td> <td><input type="text" name="uemail" size="50" maxLength="50" value="<?php echo $uemail; ?>"></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td colspan="2"><div align="center"><strong>Your friend's information </strong> </div></td> </tr> <tr> <td><div align="right">First name </div></td> <td><input name="ffname" type="text" id="ffname" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Last name : </div></td> <td><input name="flname" type="text" id="flname" onKeyUp="javascript:changeCase(formadd.Address)" value="" size="50" maxLength="50"> </td> </tr> <tr> <td><div align="right">Email address : </div></td> <td><input name="femail" type="text" id="femail" value="" size="50" maxLength="100"> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><input type="submit" value="Submit" name="action" onclick="return checkForm();"/> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </form> take note i remove some of the unecessary html codes in those codes. Also the php version is 4.4.7 Do you think it has also related with phpinfo (php settings)? Or is this MYSQL TABLE structure issue? I'm confused because there was no error message. I hope somebody can help me. Link to comment https://forums.phpfreaks.com/topic/128946-the-form-dont-display-why/#findComment-668532 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.