Jump to content

onedumbcoder

Members
  • Posts

    175
  • Joined

  • Last visited

    Never

Everything posted by onedumbcoder

  1. I figured out the problem, though I do not understand why it worked in ff. thanks
  2. it does not execute the search. does not return "0 results" or anything
  3. I have this code <?php$search = "<form method='post' action='search.php'> <input type='text' name='searchword' id='searchword' value='Search' style=\"color:#AAA;border: 0 !important;\" onfocus=\"searchAct(this);\"/> <input type='submit' name='submit' value='Search' style=\"margin-left:-5px; border: 0 !important;background:#888 !important;\"> </form>";echo $search;?> and then in other file i have <?phpif($_POST['searchword']) $search = addslashes($_POST['searchword']); else $search = addslashes($_GET['search']);?> but when i hit submit it does not work in ie, i have no idea why not. Does anyone have a clue?
  4. god sometimes im ultra dumb.... after sign up i was not setting the session variables so when it would go to the home page, it would redirect them back to the index page since technically there were never logged in. :-\
  5. now I have another issue, I am trying to allow numbers, letters and spaces but it is not working. here is what i have: /^[0-9a-zA-Z](\s)+$/
  6. I was trimming it with trim but I doubled guess myself and thought maybe I should kick back an error.
  7. is it possible to only all white spaces in the middle and not at the start or end of a value using preg_match?
  8. i am posting some variables to file. however lets say we $_POST['policeofficerid'] if i just echo the variable $policeofficerid without ever setting it to anything~~! it captures that post value (the value stored in $_POST['policeofficerid']) as its default!?!?!! has anyone else every encountered this?
  9. I have a problem with my code. I have something similar to this session_start(); ... if($activesession) { header("Location: home.php"); die(); } session_destroy(); the problem is that even though the if statement is true and it redirects the page, it still executes session_destroy()! I have no idea why, anyone have a clue?
  10. I see what your saying, and its going to be hell for me to go back and change them all, i would have to look over 300 files.
  11. try distinct $searchSQL = "SELECT DISTINCT * FROM contacts "; $searchSQL .= "LEFT JOIN policies ON (policies.policy_contact = contacts.contact_id) "; $searchSQL .= "LEFT JOIN aircraft ON (aircraft.aircraft_contact = contacts.contact_id) "; $searchSQL .= "LEFT JOIN airport ON (airport.airport_contact = contacts.contact_id) "; $searchSQL .= "LEFT JOIN product ON (product.product_contact = contacts.contact_id) "; $searchSQL .= "WHERE policies.policy_num LIKE '%{$searchTermDB}%' "; $searchSQL .= "OR aircraft.aircraft_n LIKE '%{$searchTermDB}%' "; $searchSQL .= "OR contacts.contact_primary LIKE '%{$searchTermDB}%' OR contacts.contact_zip LIKE '%{$searchTermDB}%' "; Without it, your query should return the same results multiple times if I understand it right. This is due to your OR statements.
  12. $sql="SELECT DISTINCT e.* FROM content e WHERE `section` LIKE '%feature%' ORDER BY id DESC LIMIT 2,1";
  13. PFM I think you might be wrong on this one. I just executed this code to test it and it returned the correct number of rows. this is the include file as you can see there is no insert update replace or delete.
  14. i do not understand what the difference is between the two, and where would you use one over the other and vis versa?
  15. thats odd, it seems to work, i been using it all through out my code and it always returns the right number. Am I missing something?
  16. thanks. and yes i have queries that are 40-50 lines each.
  17. i have a function that returns either an array or nothing. so lets say it returns an array $list = getList(); then would $list no longer be empty? !empty($list) == true or would it still be empty and would I need to do this instead !empty($list[0]) == true what if it does not return anything: would list not be set so that this would be false:
  18. Thanks for the reply, but when you say "corporate environments" what does that mean? I have queries that are 40-50 lines grabbing from 6-7 tables, does that count as a large query?
  19. I am wondering if it is necessary or worth it to use mysql_free_result()?
  20. PFMaBiSmAd you nailed it right on the head, I was about to come over here and say that since i just figured it out too. However I did not know the solution. But i dont use cookies or know how to use them, can you help me with it? Also is there a way to do it without cookies?
  21. it only happens at the same page. they all use the same two include files which is connect $host = ""; $user = ""; $password = ""; $database = ""; if (!($db = mysql_pconnect($host, $user , $password))){ die("Can't connect to database server."); } else { if (!(mysql_select_db("$database",$db))) { die("Can't connect to database."); } } and session session_start(); $sessionuser = $_SESSION['username']; $sessionpassword = $_SESSION['password']; $userid = ""; $sessionquery = "SELECT id FROM user WHERE username = '" . trim($sessionuser) . "' AND password = '" . trim($sessionpassword) ."'"; $query_sessionresult = mysql_fetch_array(mysql_query($sessionquery)); if (mysql_affected_rows() < 1) { header("Location: ../index.php"); } $userid = $query_sessionresult['id'];
  22. here is an odd bug i am running into and cant seem to figure out wtf is going on. maybe one of you has encounter something similar? i am encountering a really weird bug this one page i log in from the index page and i go to many different pages and everything is fine but then i got to this page c lets say and it logs me out but when i log in the second time and do the same procedure and go to page C it does not log me out... This is what happens for example a) I log in b) go to page A c) go to page B d) go to page C > site logs me out and sends me back to index page to log in again. So at this point I log in for the second time and do the same thing a) I log in b) go to page A c) go to page B d) go to page C > Page works perfectly and it does not log me out.
×
×
  • 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.