Jump to content

dougjohnson

Members
  • Posts

    98
  • Joined

  • Last visited

Everything posted by dougjohnson

  1. How would I create a prepared mysql temp table using PHP? I currently write my prepared statements like the example below. How would I create a "TEMP" table? Thanks! $connection8y = new mysqli("host", "xxx", "xxx", "db"); $result8y = $connection8y->prepare("SELECT ordernum, ordertype, duedate FROM hedord WHERE custnum = ? AND ordertype = ?"); $result8y->bind_param("ss", $custnum, $theordertype); $result8y->execute(); $bindok8y = $result8y->bind_result($ordernum, $ordertype, $duedate, $yyy, $mmm, $ddd); while ($bindok8y && $myrow8y = $result8y->fetch()) { echo "$custnum $ordernum $ordertype $duedate $yyy-$mmm-$ddd<br>"; }
  2. Can you determine which of the records does NOT have the last field, and before inserting it just add a blank value into that field?
  3. I think you are always going to need 2 items to pass a variable using a URL. First is the variable name to be passed and second is the variable value to be passed. So... urlstuff?membername=<? echo $membernamevalue; ?> that might work? On the receiving end: $membername = $_GET["membername"];
  4. Try this? $db = mysql_connect($host, $username, password) or die("Could not connect: " . mysql_error()); mysql_select_db("dbname",$db) or die(mysql_error());
  5. Example: $db = mysql_connect("localhost", "dummy", "password") or die("Could not connect: " . mysql_error()); mysql_select_db("dbname",$db) or die(mysql_error());
  6. I think you need to separate your connection variables with commas.
  7. First, I'm assuming the script we are talking about is ONLY displayed once upon logging in. If it is used more than once you would need to POST the username to it each time. Or you would get the results you are talking about. Probably won't help?
  8. This is happening to our php scripted emails more and more often. If anyone knows something that can be done about this it would be helpful. One thing that might cause some of your emails to be "blocked" is the link within the email? Maybe some filters can be set to detect links and automatically block them. I know this isn't much help but I just wanted to chime in.
  9. I don't know if this will help since we don't use IIS but here's how we do it: function mylogin($username, $password) { $password = addslashes($password); $ldap = @ldap_connect("server.name.com") or die("Could not connect to LDAP server."); // must be a valid LDAP server! if ($ldap) { $bind_results = @ldap_bind($ldap,"cn=" . $username . ",o=tree_name", $password) or die("Please try again."); $dn = "o=tree_name"; $filter="(|(cn=" . $username . "*))"; $nds_stuff = array("title", "sn", "givenname", "mail"); $results=ldap_search($ldap, $dn, $filter, $nds_stuff); $info = ldap_get_entries($ldap, $results); if ($info["count"] != 0) { $_SESSION["login"] = Y;
  10. Are the fields you're referencing in the INSERT statement in your database "exactly" as you have them typed?
  11. You're on the right track. Now just start adding fields and testing after each add. Eventually you'll find the field that's causing the problem. It will be painful but worth it:-) I'm out for the rest of the morning. Good luck.
  12. Let's simplify things and try it. $e_name = $_POST['evaluator_name']; /* data type = text in the table. Also there is one more attribute in the table caled ID with autoincrement */ $aname = $_POST['aname']; /* data type = text */ $sapid = $_POST['sapid']; /* data type = text */ $processing_date = $_POST['processing_date']; /* data type = date */ $review_date = $_POST['review_date']; /* data type = date */ $contact = $_POST['contact_ID']; /* data type = text */ $audit_type = $_POST['audit_type']; /* data type = text */ $case_no = $_POST['case_no']; /* data type = integer */ $product_name1 = $_POST['product_name1']; $product_name2 = $_POST['product_name2']; $product_name3 = $_POST['product_name3']; $product_name4 = $_POST['product_name4']; $product_name5 = $_POST['product_name5']; $product_name6 = $_POST['product_name6']; $product_name7 = $_POST['product_name7']; $product_name8 = $_POST['product_name8']; $product_name9 = $_POST['product_name9']; $product_name10 = $_POST['product_name10']; $product_name11 = $_POST['product_name11']; $product_name12 = $_POST['product_name12']; $product_name13 = $_POST['product_name13']; $product_name14 = $_POST['product_name14']; $product_name16 = $_POST['product_name16']; $Para_A_A1_score = $_POST['Para_A_A1_score']; $Para_A_A2_score = $_POST['Para_A_A2_score']; $Para_A_A3_score = $_POST['Para_A_A3_score']; $Para_A_A4_score = $_POST['Para_A_A4_score']; $Para_A_A5_score = $_POST['Para_A_A5_score']; $Para_A_A6_score = $_POST['Para_A_A6_score']; $Para_A_A1_Comment = $_POST['Para_A_A1_Comment']; $Para_A_A2_Comment = $_POST['Para_A_A2_Comment']; $Para_A_A3_Comment = $_POST['Para_A_A3_Comment']; $Para_A_A4_Comment = $_POST['Para_A_A4_Comment']; $Para_A_A5_Comment = $_POST['Para_A_A5_Comment']; $Para_A_A6_Comment = $_POST['Para_A_A6_Comment']; $query = "INSERT INTO test (e_name, agent_name) VALUES ($evaluator_name, $aname)"; $result = mysql_query($query) or die("Error while inserting data" . mysql_error()); mysql_close($connection); Does it work now? If so, start adding back some of the other field inserts.
  13. I'm not sure what your "." "." are in your insert? I've never seen that before?!? Also, what are the "{" "}" for? Try changing your INSERT to: $query = "INSERT INTO test (e_name, agent_name, userid, processing_date, review_date, contact_ID, audit_type, case_no, product_name, duration, errors, mark_parameter_A, mark_parameter_B, mark_parameter_C, mark_parameter_D, mark_parameter_E, mark_parameter_F, mark_parameter_G, mark_parameter_H, mark_parameter_I, mark_parameter_J, Total_Possible, Score, Para_A_A1, Para_A_A2, Para_A_A3, Para_A_A4, Para_A_A5, Para_A_A6, Para_A_A1_Comment, Para_A_A2_Comment, Para_A_A3_Comment, Para_A_A4_Comment, Para_A_A5_Comment, Para_A_A6_Comment) VALUES ($evaluator_name, $aname, $sapid, $processing_date, $review_date, $contact_ID, $audit_type, $case_no, $product_name1, $product_name2, $product_name3, $product_name4, $product_name5, $product_name6, $product_name7, $product_name8, $product_name9, $product_name10, $product_name11, $product_name12, $product_name13, $product_name14, $product_name16, $Para_A_A1_score, $Para_A_A2_score, $Para_A_A3_score, $Para_A_A4_score, $Para_A_A5_score, $Para_A_A6_score, $Para_A_A1_Comment, $Para_A_A2_Comment, $Para_A_A3_Comment, $Para_A_A4_Comment, $Para_A_A5_Comment, $Para_A_A6_Comment )"; You'll need to make sure every field name has a matching value.
  14. Para_A_A6_Comment,) That last coma before the ) VALUE should not be there.
  15. I don't think you can use images inside of a html drop-down selection.
  16. The $_POST values need to be set first. So one way to do this would be to have the user enter the number value in the form (without the $_POST's) and then post the data to the same script. (action = formpagename.php) You could then use a redirect after you get the posted 'number' value. If 'number' equaled 1, then redirect to flash_card_1.php. Or something like that. Anyway, your post values don't contain anything they way you have it written now.
  17. I think you need to increment $intStart inside of the loop. "+4 month" doesn't increment the $inStart variable.
  18. 19:10:11 $date_entered = "19:10:11"; $dateexplode = explode(':',$date_entered); $year = $dateexplode[2]; //$year = 11 $month = $dateexplode[1]; //$month = 10 $day = $dateexplode[0]; //$day = 19 $convert = mktime(0,0,0,$month,$day,$year);
  19. Human readable to UTC example: 1316549989 = mktime(15,19,49,09,20,2011) $utctime = mktime($hour,$minutes,$seconds,$month,$day,$year); ------------------------------- UTC to Human readable example: 2011-09-20 15:19:49 = date('Y-m-d G:i:s',1316549989) $humanreadabletime = date('Y-m-d G:i:s',$actual_utc_time);
  20. You probably want to use SUBSTR: $class_name = "League_Model"; echo $model_name = substr($class_name,0,6);
  21. Show us your code. I'm very curious about this one. I don't think the META tag has anything to do with it. If I understand correctly, you are trying to get the contents of a specific web page, but instead you are getting the contents of a popup window? I've tried to duplicate this by putting an onload javascript popup in a page and then do a file_get_contents. I get the page contents NOT the popup contents. When you navigate to the page in a browser, do you get a popup?
  22. POST/GET it's the same thing just a different method. I'm guessing you are going to need to build some kind of web interface with form fields to send the authentication and exchange values. <form action="path/to/postauth.cgi" method="post"> User:<input type="text" name="LoginUser" /> Password:<input type="text" name="LoginPass" /> <input name="Submit" type="submit" value="Submit" /> </form> Then on the postauth.cgi page you will get a 200 OK or 404 error messege and a cookie will be dropped. The postexchanger.cgi script would work the same way. Replace/add input names in another form. Hope this helps?
  23. $myvar would equal "true" in the page where it was given the value "true" AND in the included page otherfile.php. In all other pages, $myvar would equal "" unless it was set to some other value. I think that's what you want? You would probably get a php warning in the 'other' pages if $myvar was referenced and not initialized. Or, I may not understand your question. In which case I apologize.
  24. Are you sure this is using AJAX? It looks like it's using cgi scripts. In which case you would just do a GET to the path of the postauth.cgi script on the remote server to authenticate. Then do GETS to the path of the postexchanger.cgi processing script to communicate with the audio equipment? Or, I'm not understanding your question. In which case I apologize.
×
×
  • 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.