Jump to content

dcro2

Members
  • Posts

    489
  • Joined

  • Last visited

    Never

Everything posted by dcro2

  1. 'f_name' is still part of the $row array even if you use it like that, so this would work: $results[$row['f_name']] = $row['user_id'];
  2. You're right, but that means you need to select something other than `team_names_id` as value. If they don't have a dedicated id field I suppose you could just select `team_member` again? As in SELECT DISTINCT team_member as text, team_member as value FROM `team_members` WHERE team_names_id='%s'
  3. Sorry, it's kind of obvious now with just the first file. These 5 SQL queries are the same, so why would you expect different results? $query["team_members 1"] = "SELECT DISTINCT team_member as text, team_names_id as value FROM `team_members` WHERE team_names_id='%s'"; $query["team_members 2"] = "SELECT DISTINCT team_member as text, team_names_id as value FROM `team_members` WHERE team_names_id='%s'"; $query["team_members 3"] = "SELECT DISTINCT team_member as text, team_names_id as value FROM `team_members` WHERE team_names_id='%s'"; $query["team_members 4"] = "SELECT DISTINCT team_member as text, team_names_id as value FROM `team_members` WHERE team_names_id='%s'"; $query["team_members 5"] = "SELECT DISTINCT team_member as text, team_names_id as value FROM `team_members` WHERE team_names_id='%s'"; Each one fetches something different, so they should be SELECTing different fields.
  4. I don't see any kind of output on that script... is it all on db_manager.php? Also, you should probably blank out the password in your post.
  5. The PHP you are calling on to retrieve values via AJAX (connection1.php) is returning the wrong things. For example, after choosing "desplaines11" in the Team Name, the values for the rest of the dropdowns come back as desplaines11. {"results":[{"text":"David Mecklenburger","value":"desplaines11"},{"text":"Gary Geppert","value":"desplaines11"},{"text":"David Chapa","value":"desplaines11"},{"text":"Kyle Fischer","value":"desplaines11"}]} If you don't know what that means, post the code for connection1.php so we can help you.
  6. Well, random numbers sound fine to me honestly. //somewhat pseudo code do { $x = rand(0,200); $y = rand(0,200); } while ( num_rows "SELECT * FROM users WHERE x='$x' AND y='$y'" > 0 ) query "INSERT INTO users (x,y) VALUES ('$x', '$y')" As for the distance sorting, I would guess something like $userX = 123; $userY = 123; query "SELECT ABS( SQRT( POW($userX - x, 2) + POW($userY - y, 2) ) ) as distance FROM users SORT BY distance ASC"; Don't know if that's actually valid SQL but it's a start.
  7. Instead of using echo, store everything in a variable and then use a mailer class like PHPMailer or SwiftMailer to send that as an attachment. $xlsFile = ""; //insert your code //using SwiftMailer as an example require_once 'swiftmailer/lib/swift_required.php'; $attachment = Swift_Attachment::newInstance($xlsFile, 'file.xls', 'application/vnd.ms-excel'); $transport = Swift_MailTransport::newInstance(); //using php's mail() $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::newInstance('Wonderful Subject') ->setFrom(array('john@doe.com' => 'John Doe')) ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) ->setBody('Here is the message itself') ->attach($attachment); $result = $mailer->send($message); //append to variable instead of echo function xlsBOF() { global $xlsFile; $xlsFile .= pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); } //repeat for other functions Get rid of all the header() calls if you want the browser to stop prompting you to download it.
  8. The hidden inputs you have for each result all have the same names, so every time you echo another result their values get overwritten. You should append the id of each result to the name of each hidden field, like so: '<td><input type="hidden" value="'.$result1['item_name'].'" name="item_name_'.$result1['id'].'">'.$result1['item_name'].'</td>' That way when you access them through $_POST, you have to also append the id in order to access them: $id = $_POST['test_id']; $_POST["item_name_$id"]; I would not even include any field other than the id in your form, other than for display purposes. I would fetch the corresponding test from the database based on the ID alone, and check if it is actually available. Any inputs on your page, hidden or not, can be modified so you shouldn't trust them so much.
  9. You have your information in flash. I'm not really sure how you would schedule that to run in order to check if the dates match, but if you can get it to call a php script, there's lots of mailer classes you can use like SwiftMailer or PHPMailer or you can build your own email and send it using the mail function built into PHP.
  10. AAAH!! FrontPage! Oh, the evils of FrontPage... and all that IE-only compatible code... Used it once... despised it.
  11. You could use the referer variable in php, $_SERVER['HTTP_REFERER'], but just remember that the referer can be spoofed very easily.
×
×
  • 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.