onedumbcoder
Members-
Posts
175 -
Joined
-
Last visited
Never
Everything posted by onedumbcoder
-
[SOLVED] form post not working in ie?
onedumbcoder replied to onedumbcoder's topic in PHP Coding Help
I figured out the problem, though I do not understand why it worked in ff. thanks -
[SOLVED] form post not working in ie?
onedumbcoder replied to onedumbcoder's topic in PHP Coding Help
it does not execute the search. does not return "0 results" or anything -
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?
-
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. :-\
-
[SOLVED] WOW~! i am about to go nutz!!! PHP is CRazY!
onedumbcoder replied to onedumbcoder's topic in PHP Coding Help
-
[SOLVED] WOW~! i am about to go nutz!!! PHP is CRazY!
onedumbcoder posted a topic in PHP Coding Help
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? -
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?
-
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.
-
$sql="SELECT DISTINCT e.* FROM content e WHERE `section` LIKE '%feature%' ORDER BY id DESC LIMIT 2,1";
-
Thanks again PFM
-
i do not understand what the difference is between the two, and where would you use one over the other and vis versa?
-
thanks. and yes i have queries that are 40-50 lines each.
-
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:
-
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?
-
I am wondering if it is necessary or worth it to use mysql_free_result()?
-
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'];
-
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.