Hey guys,
All this code below used to work! I then changed troop to group and since then its not been inputing into the database! I've debugged and all the information is coming through, its just not going into my database.
and this is final.phpCode:<form id="form1" name="form1" action="final.php" method="post"> <p>All Boxes Required</p> <label>Email: </label> <input type="text" name="email" id="textfield" /> <label>Group: </label> <input type="text" name="group" id="textfield" /> <label>Organiser Name: </label> <input type="text" name="name" id="textfield" /> <label>Telephone/Mobile: </label> <input type="text" name="telmob" id="textfield" /> <label> Place </label><input type="text" id="place" name="place" value="<?php echo $place; ?>" /> <label> Activity</label> <input type="text" id="activity" name="activity" value="<?php echo $act; ?>" /> <label> Date Arriving </label><input id="datepicker" name="datearriving" value="" /> <label> Date Leaving</label> <input id="datepicker2" name="dateleaving" value="" /> <button type="submit" name="submit" value="submit">Apply</button> <button type="reset">Clear</button>
Thanks to anyone he helpsCode:$dbname = 'name'; mysql_select_db($dbname); $da = $_POST ["datearriving"]; $dl = $_POST ["dateleaving"]; $email = $_POST["email"]; $group = $_POST["group"]; $name = $_POST ["name"]; $telmob = $_POST ["telmob"]; $place = $_POST ["place"]; $act = $_POST["activity"]; if (isset($_POST['submit'])) { //This makes sure they did not leave any fields blank if (!$_POST['datearriving'] | !$_POST['dateleaving'] | !$_POST['email'] | !$_POST['group'] | !$_POST['name'] | !$_POST['telmob'] | !$_POST['place']| !$_POST['activity']) { header( 'refresh: 3; url=/scouts/index.php' ); die('You did not complete all of the required fields! Please wait...'); } //checks if its an email address if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){ header( 'refresh: 3; url=/book1.php' ); die('Invalid Email Address! Please wait...'); } // now we insert it into the database $insert = "INSERT INTO activities (datearriving, dateleaving, email, group, name, tel, place, activity) VALUES ('".$da."','".$dl."','".$email."','".$group."','".$name."','".$telmob."','".$place."','".$act."')"; $add_activity = mysql_query($insert);![]()


Reply With Quote
Bookmarks