Jump to content

unknown00

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Everything posted by unknown00

  1. one quick comment - i get a hanging NaN. any thoughts?
  2. this is only directed to people that don't have an in-house laundry/dryer thing. most likely to someone living in an apartment or in school i think this is ridic. in texas i paid $0.75/wash and dry. here in boston it's $2/wash and $1/dry. that's over DOUBLE what i use to pay how about you?
  3. nope, form doesn't appear again. it seems like when '+nms[$i]+' is used it screws everything up and nothing works properly
  4. yea i caught that typo. the form doesn't appear anymore, i don't know why, so to answer your question no url
  5. doesn't work, actually messes up my form display
  6. not sure what section to post this in, basically i have html in a javascript function that i want to pass into a php. here is some of my javascript code var names = document.getElementById('names').value; var nms = names.split(";;") for (i=0; i<las.length; i++) { var contentString = [ '<div id="tab-1">', '<p><h1>'+nms[i]+'</h1></p>', '</div>' +'<form action="index.php" method="post" enctype="multipart/form-data">'+ '<input id="delbutton" name="delbutton" type="submit" value="Delete">',+'</form>' } then when the button gets pressed it goes to if(isset($_POST['delbutton'])=='Delete') { echo("into the php delete: " . $_POST['name2'] . "<br />\n"); echo '<pre>' . print_r($_POST,true) . '</pre>'; } basically i want to be able to access the value of nms in the php call. i am able to pass anything in <input> tags like normal html, but i want to get nms to go through what should i do?
  7. yup all working. i posted my code above anyone take a look?
  8. view source http://studydojo.com/maps/travel/ as for php <?php // adding a new location to the db if (isset($_POST['name'])) { $name = $_POST['name']; $description = $_POST['description']; $user_name = $_POST['user_name']; $user_location = $_POST['user_location']; $lat = $_POST['lat']; $long = $_POST['long']; $address = $_POST['address']; // generate id $id = 1; $result = mysql_query("select max(id) from locations"); if (mysql_num_rows($result) != 0) { $row = mysql_fetch_array($result); $id = $row['max(id)']+1; } // sql query to add location $result = mysql_query("insert into locations (`id`, `name`, `latitude`, `longitude`, `address`, `description`, `user_name`, `user_location`) values ('$id','$name', '$lat', '$long', '$address', '$description', '$user_name', '$user_location')"); } if(isset($_POST['delbutton'])=='Delete') { //echo "tset<br />"; //echo '<pre>' . print_r($_POST,true) . '</pre>'; //$result = die("A MySQL error has occurred." . mysql_error()); $delete = mysql_query("DELETE FROM locations WHERE locations.id=2") or die(mysql_error()); //echo "Account has been deleted."; } ?>
  9. yes my id is an auto increment but i just changed my delete to $delete = mysql_query("DELETE FROM locations WHERE name='test'") or die(mysql_error()); to get rid of the id and it still doesn't work
  10. <?php if(isset($_POST['delbutton'])=='Delete') { echo '<pre>' . print_r($_POST,true) . '</pre>'; $delete = mysql_query("DELETE FROM locations WHERE id=2") or die(mysql_error()); } ?> still nothing, it seems like the if statement is always false. and yes there id=2 actually exists id is a type int(11)
  11. yes, it never error out. seems like almost if(isset($_POST['delbutton'])) is always false
  12. nope, i actually originally had locations with the '' an added them to try. doesn't work
  13. for my button <form action="index.php" method="post" name="add" id="add" enctype="multipart/form-data"> <input name="name" id="name" type="text" size="30"/> <input type="submit" value="Add"/> <input id="delbutton" name="delbutton" type="submit" value="Delete"> </form> then to delete <?php if(isset($_POST['delbutton'])) { $result = mysql_query("DELETE FROM 'locations' WHERE id='2'"); } ?> i also have an add that works, this code is above my delete code. no idea why the delete doesn't work <?php // adding a new location to the db if (isset($_POST['name'])) { $name = $_POST['name']; $result = mysql_query("insert into locations(`name`) values ('$name')"); } ?> i'm not even passing any parameters yet because i want to test just a simple delete command works but it doesn't work. suggestions?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.