jeger003
Members-
Posts
260 -
Joined
-
Last visited
Everything posted by jeger003
-
i want to be able list my users ads specific to their user IDs
jeger003 replied to jeger003's topic in PHP Coding Help
if you see in the code it includes authenticate_class.php I can post that page here if necessary. -
i want to be able list my users ads specific to their user IDs
jeger003 replied to jeger003's topic in PHP Coding Help
the thing with my script is that everything is based from the index.php..........so index.php page calls all the other pages and i have no login.php.......but here is what i found on the index.php page that has to do with the login if you need more or if you need me to post the entire index.php page i can case 10: //login if (!$auth) { include_once("classes/authenticate_class.php"); $auth = new Auth($db,$language_id); if ($auth->configuration_data->IP_BAN_CHECK) $auth->check_ip($db); } if (!$user_id) { if (($_REQUEST["b"]) && (is_array($_REQUEST["b"]))) { $authorized = $auth->login($db,$_REQUEST["b"]['username'],$_REQUEST["b"]['password'],$_COOKIE["classified_session"]); if ($authorized) { if ($_REQUEST["c"]) { $c = str_replace("*is*", "=", urldecode($_REQUEST["c"])); header("Location: ".$browse->configuration_data->CLASSIFIEDS_URL."?".$c); } else { if ($auth->configuration_data->POST_LOGIN_PAGE == 0) { include_once("classes/user_management_home.php"); $user_management = new User_management_home($db,$language_id,$authorized,$classauctions); if (!$user_management->user_management_home_body($db)) $user_management->site_error($db); } elseif ($auth->configuration_data->POST_LOGIN_PAGE == 1) { include_once("classes/browse_ads.php"); $browse = new Browse_ads($db,$authorized,$language_id,0,$_REQUEST["page"],0,$filter_id,$state_filter,$zip_filter,$zip_distance_filter); if (!$browse->main($db)) { if ($debug) echo "in no main browse<Br>\n"; $browse->site_error($db); } } } } else { $auth->login_form($db,$_REQUEST["b"]['username'], $_REQUEST["b"]['password'], urldecode($_REQUEST["c"])); } } else { $auth->login_form($db); } } else { $auth->already_logged_in($db); } $db->Close(); if ($get_execution_time) get_end_time($starttime); exit; break; -
i want to be able list my users ads specific to their user IDs
jeger003 replied to jeger003's topic in PHP Coding Help
does anybody know how i can set this up..........i really need this done......i tried everything and i cant figure any way to get it to display only the users current ads. -
i want to be able list my users ads specific to their user IDs
jeger003 replied to jeger003's topic in PHP Coding Help
thats my problem I know nothing about putting it together........i am using sessions and have a sql table for it........but how would i be able to make it display it specific to usernames? like how would i put the "$_SESSION['username']" so that it displays their ads? -
i want to be able list my users ads specific to their user IDs
jeger003 replied to jeger003's topic in PHP Coding Help
Can anyone help me on this? please -
i want to be able list my users ads specific to their user IDs
jeger003 replied to jeger003's topic in PHP Coding Help
i tried to figure it out.......but i couldnt........i cant find how its checkin user ids..........but i figured out another way we can do it........when users log in their username is displayed as <<DISPLAY_USERNAME>> so it looks like this : Hello <<DISPLAY_USERNAME>> welcome back! so if some how we can get it to search for the username in the db.......or have it display all the ads that match the username.......because it will all be on the same page and wouldnt have to search anywhere else.......the only catch is the username and ads are not on the same table......the ads are on ads_classified which goes by user ID's and the username is on ads_userdata for example: if my user name is jeger003 and i have an ad selling a car and my user id is 23 the ads_classified table would say ID ad_title date_published 23| car for sale | 12-29-08 and the ads_userdata would say ID username email 23| jeger003 | jeger003@blah.com so i would need to some how match the ID from the ads_classified table to the username in the userdata table i hope this makes.......and i thank you for all your help -
i want to be able list my users ads specific to their user IDs
jeger003 replied to jeger003's topic in PHP Coding Help
im sorry im a little confused im not sure what $current_viewing_user_id does or what im supposed to do with but the query wont allow two " cause it cuts it off and when i use ' the $current_viewing_user_id doesnt work -
i want to be able list my users ads specific to their user IDs
jeger003 replied to jeger003's topic in PHP Coding Help
yes, once a user registers they are assigned a "seller" number which is saved in mysql. below is a code i was able to put together to just list all the ads live but of course i cant have this display on users accounts cause it would be displaying all the users ads. seller field below would display the sellers #(user number) and then ad name next to it <? $data = mysql_query("SELECT * FROM ads_classifieds WHERE live='1' ORDER BY seller") or die(mysql_error()); Print "<table border cellpadding=3>"; Print "<br><b>Ads Live</b><br><br>"; Print "<td>". "Title</td> "; Print "<td>". "Seller</td>"; Print "<td>". "Views</td>"; Print "<td>"."Exp Notice</td></tr>"; while($info = mysql_fetch_array( $data )) { Print "<tr>"; Print "<td>".$info['title'] . "</td> "; Print "<td>".$info['seller'] . " </td>"; Print "<td>".$info['viewed'] . " </td>"; Print "<td>".$info['expiration_notice'] . " </td></tr>"; } ?> -
i have a classifieds site where my users can post ads and sell there stuff. what i am trying to do is list the users ads right after they log in....so that they can see what ads they have live and what are expired. So i would have it display specific to the user ID. Im not really sure where to start I was hoping some one can point me in the right direction and let me know what i should be looking for. i would appreciate any help
-
[SOLVED] I want to be able to count an item once using COUNT(*)
jeger003 replied to jeger003's topic in PHP Coding Help
Barand i just saw your post......and yours works as well...counts exactly like i need it to.. thank you for your help -
[SOLVED] I want to be able to count an item once using COUNT(*)
jeger003 replied to jeger003's topic in PHP Coding Help
premiso! you NAILED IT!! it works perfectly! displays "There have been 120 unique visitors today." AWESOME! THANK YOU SOO MUCH! what would you recommend for tracking visits? i use the stat my hosting provides but its not very good cause it includes all sorts of bots. ---------------------------------------------------------------------------------------------- twn---thank you soo much for all your help, your code worked but it counted how many times an ip showed up rather than counting individual ips.... Again thank you all for the help....greatly appreciate it. -
[SOLVED] I want to be able to count an item once using COUNT(*)
jeger003 replied to jeger003's topic in PHP Coding Help
premiso---i think we are kind of getting there........here is what it displays 98.133.240.48 has entered at least once. 71.163.227.133 has entered at least once. 68.133.67.71 has entered at least once. 98.133.163.208 has entered at least once. 69.63.179.33 has entered at least once. 71.133.11.54 has entered at least once. 69.63.133.33 has entered at least once. is there a way to maybe count these....cause i would have to count them myself....for example if only these were the visits, i would count 7...for the ips and say that 7 different ips visited today...is there a way to have it count it by itself? but this is very close twm---im not really sure what you mean....which field would i replace VisPG with? -
[SOLVED] I want to be able to count an item once using COUNT(*)
jeger003 replied to jeger003's topic in PHP Coding Help
premiso--- i put in the code you provided and here is what it displays.... Array ( [98.118.263.48] => 40 [71.163.263.153] => 115 [68.163.67.71] => 55 [63.169.163.208] => 179 [69.63.163.34] => 21 [71.163.63.54] => 10 [69.63.179.33] => 20 [69.63.163.35] => 9 [263.80.163.38] => 2 [84.31.163.193] => 4 [68.163.176.93] => 34 [70.79.163.3] => 15 [174.163.131.149] => 1 [68.630.23.242] => 2 [65.213.232.194] => 53 [69.243.4.25] => 2 [72.196.244.182] => 4 [38.163.41.112] => 2 [208.80.194.48] => 2 [208.80.163.33] => 1 [96.241.163.191] => 2 [68.98.138.19] => 49 [65.55.263.161] => 1 [63.55.109.244] => 2) its basically counted the number of ips that exist for a specific ip.... cant we just get it to count the fields it brings out....that would be like counting individual ips but only once......i tried everything and searched every where and nothing has worked -
[SOLVED] I want to be able to count an item once using COUNT(*)
jeger003 replied to jeger003's topic in PHP Coding Help
i dont think you guys are understanding my question........im sorry if its not clear...im gonna try again ok, my script logs visits......and displays ips and what they visited.. for example say ip # 123.123.213 came to my site and entered the url.........he would go to my index.php page it would display 123.123.213 /index.php so say he then clicks another page on my site for example he clicks the contact us page...that would display 123.123.213 /index.php 123.123.213 /contact_us.php then he goes to back to home and it would be 123.123.213 /index.php 123.123.213 /contact_us.php 123.123.213 /index.php so it displays this guys ip and tells me where he visited...and thats how its stored in mysql....what i want to do is count his ip ONLY once........i dont want it to tell me that there are 3 ips from him, i want one....and not include his other ips. i hope it makes sense guys........thank you -
[SOLVED] I want to be able to count an item once using COUNT(*)
jeger003 replied to jeger003's topic in PHP Coding Help
here it is....this is wat i used with the code sasa gave <?php $query = "SELECT VisIP, COUNT(DISTINCT(VisIP)) FROM logs GROUP BY VisIP"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo "". $row['COUNT(DISTINCT(VisIP))'] ."ips" ; echo "". $row['VisIP'] ."ips" ; echo "<br />"; } -
[SOLVED] I want to be able to count an item once using COUNT(*)
jeger003 replied to jeger003's topic in PHP Coding Help
oh sorry error was: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') FROM logs GROUP BY VisIP' at line 1 but i didnt realize that it was tellin me i had an extra ")" so i removed it......it worked but not wat i wanted it to do this is what it displays 1ips 154.247.714.226 1ips 241.163.123.216 1ips 249.151.1.120 1ips 249.151.1.122 1ips 164.113.13.105 1ips 164.106.16.39 1ips 164.596.59.344 <----same ip i want it to count all the ips but only once 1ips 164.596.59.344 <----same ip 1ips 165.97.345.30 1ips 174.349.131.149 1ips 205.157.206.225 its basically counting ip's sayin heres 1 ip of blah blah.....and here is another of the same ip -
[SOLVED] I want to be able to count an item once using COUNT(*)
jeger003 replied to jeger003's topic in PHP Coding Help
hey guys thanks for the help.... premiso---i used the code worked but it it basically counts the number of ips individually like if i had 192.59.65.23 \ two ips from one person it displays "2-192.59.65.23" so it only counts that there were two ips showing 192.59.65.23 / what im trying to get it to do is to have it count all the ips but only count the them once....i would think i would have to use the "if" statement like if($ip = $otherip) dont count it. Sasa---i tried COUNT(DISTINCT(VisIP))..........it gave me an error i dont think im doing it right....do i just replace all the COUNT(VisIP)? cause thats what i did. thank you guys -
i want to be able to count ips once.........i basically log visits for my site cause i get alot of spam from europe....so i want to be able to count all the ips....but only count the once for example: (not real ips of course) 192.59.65.23 visits page /index.html 192.59.65.23 visits page /classified.html 172.65.35.98 visits page /index.html 172.65.35.98 visits page /classified.html but i want to be able to count the above ips only once.......so that it tells me there were 2 visits and not 4 below code is what i have so far.......i would appreciate any help echo "<b>IP Counts</br></b>"; $query = "SELECT VisIP, COUNT(VisIP) FROM logs GROUP BY VisIP"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo "". $row['COUNT(VisIP)'] ."ips" ; echo "<br />"; }
-
for some reason it keeps collecting from my ip........i double checked my ip and its the same....i have cable.....i looked over the code many times cant find anything wrong......see it below if you can catch something <?php include 'dbconfig.php'; if(isset($_POST['b']['search_text'])) { /* change $myIP to your public IP, you can find it by going to www.whatismyip.com */ $myIP = '123.456.789.0123';//this is of course replaced with my ip if($_SERVER['REMOTE_ADDR'] != $myIP) // if remote address NOT EQUAL to $myIP then track the search term. { $cleanText = mysql_real_escape_string($_POST['b']['search_text']); mysql_query("INSERT INTO searched (text,IP,Date) VALUES ('$cleanText',\"".$_SERVER['REMOTE_ADDR']."\",NOW())"); } } as you can see i also collect the time and ips of visitors....so i know whos coming and looking for what....but im not sure if that would have any effect on it
-
I went through the notices.......and couldnt make much of it.......they are all from my index.php page these are a few things its pointing to $cookie_debug = 0; it says Notice: Undefined variable: persistent_connections Notice: Undefined variable: auth in (looked at this and its a blank line) I wanted to do one last thing......i want to make it so it doesnt collect/store searches from my ip....so i know its not me searching...i know i start off with the code below.....the one you gave nate <?php /* change $myIP to your public IP, you can find it by going to www.whatismyip.com */ $myIP = '123.456.789.0123'; if(isset($_POST['b'])) { if($_SERVER['REMOTE_ADDR'] == $myIP) { echo 'Search Term: '.$_POST['b']['search_text']; //i tried to put the two together, the other code with "mysql_real_escape_string" and this one but no luck.. //i tried looking at how i can make it deny my IP } } ?> but not sure where to go from here i hope it makes sense
-
It works!! i dont know what i did, if anything at all....but i put the code in with the "ini_set('error_reporting', E_ALL);" and it gave me "notices," none said errors, none had to do with the search codes either......i then removed the "ini_set('error_reporting', E_ALL);" tried it and it worked these are the notices it gave Notice: Undefined variable: persistent_connections in....(the location) Notice: Undefined index: set_language_cookie in....(the location) Notice: Undefined property: should i be worried about these? Thank You guys again for the time you are putting into this!! you have no idea how great full i am.
-
Thank You Prismatic, I put in the code but now it doesnt log the searches. doesn't give any errors either. im not sure what injections are but they dont sound very safe........i get alot of visitors from africa and europe (Scammers) so i would like to get this working for the safety of the site. i would appreciate if you could explain injections a little Thanks Again!
-
i got it.......it stores whats searched into a mysql db.....last thing i dont know how to do is to hide the out of "Search Term:" so that it doesnt show up is that possible? <?php include 'dbconfig.php'; if(isset($_POST['b'])) { echo 'Search Term: '.$_POST['b']['search_text']; } $search_text=$_POST['b']['search_text']; mysql_query("INSERT INTO searched (text) VALUES ('$search_text')"); ?>