Jump to content

CloudSex13

Members
  • Posts

    162
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

CloudSex13's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi all, Thanks for reading. I have this code: $message = strip_tags($_POST['message'], '<p><strong><em>'); My question is however, is there a way that I could disable the onmouseover features in those tags? Thank you.
  2. Okay guys, check this out. So my POST variable was named "search", right? I changed the name of it to something else (and the PHP variable) and now everything works perfectly!
  3. @gizmola I ran the query in phpMyAdmin and all the accounts showed up. It's definitely not a whitespace error it seems. How would I check to see if it's myisamchk? It's definitely the MyISAM format. Thanks to everyone for their suggestions so far.
  4. @jdavidbakr Yes, I originally had them sanitized. But I limited my code to see if they were causing an issue. When I echo the $search variable, it returns the correct entered data (e.g. entered in "Bob Jones", "Bob Jones" is outputted. When I echo out the query, I get "Resource id #11". Additionally, there is no MySQL_error. @Rifts I want a result to simply echo the name in a database if it's found, so simply "Bob Jones" if "Bob Jones" if found. However, "Bob Jones" is in the database and is not being echoed for some odd reason. However, the first 4 names before "Bob Jones" are being echoed properly on search. Additionally, I tried to simplify my code as I stated above, so $results = 1 was a leftover nothing. Thanks for the tip to remove. @Pikachu2000 I ran the results in phpMyAdmin and they were indeed found. When running a name that displays, I received this with the var_dumps: string(16) "Name: John Jones" | string(10) "John Jones" When running a name that doesn't display, I get: string(50) "Your search returned no results. Please try again." | string(4) "Badd"
  5. Hi all, Thanks for reading. I'm hella frustrated at this script I wrote: for some reason, it will not work correctly. Basically, it works. The first 4 names in the table on the database show up when searched. But, anything past these four names in the database will not show up as a result when searched! I'm pulling my hair out here! It's really simple - take a gander: if (isset($_POST['submit'])) { $search = $_POST['search']; $searchQuery = mysql_query("SELECT * FROM Accounts WHERE FullName='$search'"); if (mysql_num_rows($searchQuery) == 0) { $result = "Your search returned no results. Please try again."; } else { $results = 1; while ($getSearchResults = mysql_fetch_array($searchQuery)) { $fullName = $getSearchResults['FullName']; $result = "Name: ".$fullName.""; } } } ?> ...and the HTML form... <form action="search.php" method="post"> <p>Search: <input type="text" name="search" size="35" maxlength="100" /></p> <p><input type="submit" value="Search" name="submit" /></p> <?php echo $result; ?> </form> Does anyone have any ideas?
  6. After further thought, the above probably only displays the happenings already displayed because the <div> ID is the same, however, I plan to implement pagination for all the happenings and would need all these in that one <div>. Hope that helps to clarify.
  7. I came up with an idea of adding a field to the Happenings table in my database called HappeningTodayDisplayed. If it's set to 1, then the auto-refresh script should not fade in/out. But, if HappeningTodayDisplayed is set to 0, then is should fade in/out. I placed these queries separately in the getrows.php file using the GET method, and have links like the following: <script type="text/javascript"> $(document).ready(function() { $("#responsecontainer").load('getrows.php?alreadydisplayed'); var refreshId = setInterval(function() { $("#responsecontainer").fadeOut("fast").load('getrows.php?justadded').fadeIn("slow"); $("#responsecontainer").load('getrows.php?alreadydisplayed'); }, 5000); $.ajaxSetup({ cache: false }); }); </script> However, I'm frustrated to see this only displays the events already displayed...
  8. Hi all, Thanks for reading. I'm running a script using jQuery that auto-refreshes a <div> on the index page from an external PHP script to get all the rows in a database and display them on the index page. The script works great - here it is as follows: <script type="text/javascript"> $(document).ready(function() { $("#responsecontainer").fadeOut("fast").load("getrows.php").fadeIn("slow"); var refreshId = setInterval(function() { $("#responsecontainer").fadeOut("fast").load('getrows.php').fadeIn("slow"); }, 5000); $.ajaxSetup({ cache: false }); }); </script> The getrows.php script I'm working with looks like this: <?php $rowsQuery = mysql_query("SELECT * FROM Happenings WHERE HappeningDate='$today'"); if (mysql_num_rows($rowsQuery) == 0) { $happeningsToday = "There are no happenings today."; } else { $allHappeningsToday = 1; while ($getHappeningsToday = mysql_fetch_array($rowsQuery)) { $happeningName = stripslashes($getHappeningsToday['HappeningName']); $happeningDate = $getHappeningsToday['HappeningDate']; $happeningDescription = $getHappeningsToday['HappeningDescription']; if ($allHappeningsToday == 1) { $happeningsToday .= " <div class=\"box\"> <p>".$happeningName." | ".$happeningDate." | ".$happeningDescription." </div>"; $allHappeningsToday = 2; } else { $happeningsToday .= " <div class=\"box\"> <p>".$happeningName." | ".$happeningDate." | ".$happeningDescription." </div>"; $allHappeningsToday = 1; } } } echo $happeningsToday; ?> This script works great as well. Currently, the auto-refresh jQuery script as you can see if getting and fading in/out all of the rows. Off of the above getrows.php script, is there a way after I could get only the newly created rows since the last refresh and only fade those in and out while leaving the others already loaded by the auto-refresh script to not fade in/out? Any ideas, thoughts or suggestions would be unbelievably helpful. Thank you very much.
  9. MasonPrice, I really, really, really want ribs now. Darn. Anyway, thanks very much for the coding example. It's really spawned some great ideas on how I can approach the situation. Thanks again!
  10. Thanks for your reply, MasonPrice. In a nut-shell, yes. But I'm looking to add some sort of Session variable to prevent duplicate profile views. I don't want a user to be able to refresh they're profile and be able to add a count to it. Maybe I could prevent the user from doing this. Basically, a guest browser (someone without an account) - the session profile view should increase each visit. Any suggestions and ideas are welcome. Thank you!
  11. Thanks for explaining that out to me, Pikachu2000. I really appreciate that. If anyone else has any sort of suggestion as to how I can approach my profile views script, please feel free to let me know. I've begun the process of pulling my hair out. x.x
  12. I mean, should a session variable do the trick, or would anyone have any better ideas they could point me in the direction of?
  13. Thorpe, I tested the idea just now and realized it's not what I'm looking for. I'm looking for user's to be able to access their profile from a link like this one: http://www.example.com/userscustomurl Right now, they can access their profile from a link like this one: http://www.example.com/profile.php?id=1001 If you or anyone else has any further ideas how I could make this happen, please let me know. I appreciate your help!
×
×
  • 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.