EagleAmerican Posted August 11, 2007 Share Posted August 11, 2007 Just switched hosts and now another problem with PHP. Whenever I add a parasite, the last of 5 fields doesn't get added (removal instructions). I have to edit it multiple times before it will go in. The last problem I had, register_globals was off.. is that causing this too? index.php <?php if (isset($_GET['addparasite'])): ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <label>Name:<br /> <textarea name="parasitename" rows="1" cols="50"> </textarea></label><br /> <label>Origin:<br /> <textarea name="parasitefrom" rows="1" cols="50"> </textarea></label><br /> <label>Genre:<br /> <textarea name="parasitegenre" rows="1" cols="50"> </textarea></label><br / <label>Description:<br /> <textarea name="parasitedescription" rows="5" cols="50"> </textarea></label><br /> <label>Removal Info:<br /> <textarea name="parasiteremoval" rows="5" cols="50"> </textarea></label><br /> <input type="submit" value="Add" name="parasiteadd" /> </form> if (isset($_POST['parasiteadd'])) { $parasitename = $_POST['parasitename']; $parasitefrom = $_POST['parasitefrom']; $parasitegenre = $_POST['parasitegenre']; $parasitedescription = $_POST['parasitedescription']; $parasitetechremoval = $_POST['parasiteremoval']; $sql = "INSERT INTO parasite SET parasitename='$parasitename', parasitefrom='$parasitefrom', parasitegenre='$parasitegenre', parasitedescription='$parasitedescription', parasiteremoval='$parasiteremoval'"; if (@mysql_query($sql)) { echo "<p>The parasite '$parasitename' has been added.</p>"; } else { echo '<p>Error adding submitted parasite: ' . mysql_error() . '</p>'; } } Thanks, Adam Quote Link to comment https://forums.phpfreaks.com/topic/64354-solved-not-all-data-gets-submitted/ Share on other sites More sharing options...
simcoweb Posted August 11, 2007 Share Posted August 11, 2007 You might try doing the query this way: $sql = "INSERT INTO parasite (parasitename, parasitefrom, parasitegenre, parasitedescription, parasiteremoval) VALUES ('$parasitename', '$parasitefrom', '$parasitegenre', '$parasitedescription', '$parasiteremoval')"; Quote Link to comment https://forums.phpfreaks.com/topic/64354-solved-not-all-data-gets-submitted/#findComment-320892 Share on other sites More sharing options...
EagleAmerican Posted August 11, 2007 Author Share Posted August 11, 2007 Same thing happens. Removal Instructions don't get added. I have a feeling that it is something in php.ini because I just switched hosts and now having a lot of problems. If so, which one could it be? Thanks, Adam Quote Link to comment https://forums.phpfreaks.com/topic/64354-solved-not-all-data-gets-submitted/#findComment-320895 Share on other sites More sharing options...
trq Posted August 11, 2007 Share Posted August 11, 2007 Remove the @ error supressor and lets see if your getting any errors. Quote Link to comment https://forums.phpfreaks.com/topic/64354-solved-not-all-data-gets-submitted/#findComment-320904 Share on other sites More sharing options...
EagleAmerican Posted August 11, 2007 Author Share Posted August 11, 2007 Removed the @ and no error. Just said "The parasite 'Test' has been added." But still no Removal Instructions. Quote Link to comment https://forums.phpfreaks.com/topic/64354-solved-not-all-data-gets-submitted/#findComment-320909 Share on other sites More sharing options...
trq Posted August 11, 2007 Share Posted August 11, 2007 You have a naming error. This.... $parasitetechremoval = $_POST['parasiteremoval']; Should be.... $parasiteteremoval = $_POST['parasiteremoval']; Quote Link to comment https://forums.phpfreaks.com/topic/64354-solved-not-all-data-gets-submitted/#findComment-320910 Share on other sites More sharing options...
EagleAmerican Posted August 11, 2007 Author Share Posted August 11, 2007 Thanks a lot! Quote Link to comment https://forums.phpfreaks.com/topic/64354-solved-not-all-data-gets-submitted/#findComment-320912 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.