Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. Here are some other ascii and hex characters that you may want. [quote]" " (ASCII 32 (0x20)), an ordinary space. "\t" (ASCII 9 (0x09)), a tab. "\n" (ASCII 10 (0x0A)), a new line (line feed). "\r" (ASCII 13 (0x0D)), a carriage return. [/quote] You can also wrap your text in <pre> tags to have the formatting remain the same.
  2. What are you using to parse your XML?  PHP's built in functions, or a seperate library?  Additionally, if you are using PHP's functions, what version of PHP are you using, because they differ substantially. I generally use a seperate library because PHP's functions differs so much between versions.  I recommend minixml (http://minixml.psychogenic.com/), as it is easy to use and is compatible with php 4 and 5.
  3. The first place to look should always be the manual: http://www.php.net/functions Be sure to read the sub sections as well. If you still have questions, please ask after reading the manual.
  4. If it is a small amount of data, pass it in the url to the next page, then use $_GET to retrieve it.  If it's a large amount of data, why are you passing it from page to page?  Why not include the second page in the first (or just make one page)? What are you trying to accomplish by passing the data from page to page?
  5. It removes white space and newline characters... [quote] This function returns a string with whitespace stripped from the beginning and end of str. Without the second parameter, trim() will strip these characters:     *       " " (ASCII 32 (0x20)), an ordinary space.     *       "\t" (ASCII 9 (0x09)), a tab.     *       "\n" (ASCII 10 (0x0A)), a new line (line feed).     *       "\r" (ASCII 13 (0x0D)), a carriage return.     *       "\0" (ASCII 0 (0x00)), the NUL-byte.     *       "\x0B" (ASCII 11 (0x0B)), a vertical tab. [/quote] The one's that pertain to your situation are the \n and \r
  6. what type of data?  You can use the url to pass parameters, sessions...any number of ways.
  7. do a trim on $info[1]. You need to remove the newline character from the end, otherwise they won't match. [code]f($password == trim($info[1])){   echo "login succes";   }else{   echo "wrong password";   }[/code]
  8. See here: http://www.php.net/math and here: http://us3.php.net/manual/en/language.operators.arithmetic.php
  9. [quote]Every time someone logged on hits a page, then that page can retrieve the session variables related to that person and can then put the persons username in a communal file which is then included or called into the pages to give the list of currently logged on users.[/quote] Whenever you visit a page generated by SMF it calls the function "writelog()".  That function deletes all users in the "log_online" table who have not visited a page in the predetermined period of time, and inserts your username, the page, and the timestamp into the table. To determine who is online, it uses the function "ssi_whosOnline" to retreive the users who are listed in the log_online table (remember it removes "offline" users everytime a page is loaded). It does not use a file in the file system to keep track of who is online.  They do use sessions while you are logged in, however to keep you logged in constantly (by selecting the "Never" expiration) they use cookies. [quote]I'm sure SMF uses sessions and session cookies because no session id shows on the url[/quote] If you disable cookies the session id will show up in the url.
  10. Assuming the usernames are stored in a db, then you can use a query like: [code]SELECT * FROM users WHERE username LIKE '%$searchterm%';[/code] Then just loop through the result and echo them out with links to the respective profiles.
  11. [quote]You can do this using Javascript.[/quote] You can't delete (unlink) a file on the server with javascript.  At best, and maybe what you are thinking, you can use AJAX to notify the server that a browser window has been closed, but if the file is being viewed in Excel, then JS can't tell when Excel is closed.
  12. what does the file "members/$username" look like?  what are it's contents?
  13. I don't understand what your asking.
  14. I'm not positive, but I'm relatively sure, that the way that SMF tracks when users are "online" is by monitoring their page views.  In other words, when I visit a page, they record it in the database (which helps with determining which threads I've viewed, which I've posted in, etc.), along with the timestamp of when that page was viewed. When they build the list of "online" people at the top, they are going into that table and pulling the names of the users who have viewed a page within the last few minutes (I think it's 15 for SMF, but it's been a while since I admin'd SMF).  If a user hasn't viewed a new page in 15 minutes, then they are consitered "offline". [quote]when the user is offline for a long period is it the duty of server admin(me) to delete manually the username or the login info from the database or the PHP script will automatically delete the login info.[/quote] You don't have to delete anything.  The server determines whether the user is "online" by the timestamp (i.e. if less than 15 minutes has expired since the last page visit, they are online, otherwise they are offline).
  15. Yes, but it's not javascript...it's php.  Which are totally different, but I digress.
  16. Two ways....use sessions or keep track of IPs. Both are essentially the same.  Keep track of page visits from users by recording their ip/session value in a db along with a time stamp, when you haven't seen a page hit from their session var and/or IP for a period of time, consider them no longer online.
  17. I think this is the third time 3 or 4 days I've posted the link to the same tutorial on searching using php and mysql.......... http://www.phpfreaks.com/tutorials/129/0.php
  18. Everytime you visit ANY page on the internet the server knows your IP...it's has to be able to, other wise it wouldn't know who to send the information back to when you request the page. If the server knows your IP, then the programmer can acess it.  It is used for a variety of applications...look at your posts in this thread...notice in the bottom right of each one an ip address is there?  That's your IP.  I can't see it, but you can.  I can see mine, but you can't. In php, you can access the IP of the requesting computer by using $_SERVER['REMOTE_ADDR'].
  19. because you are using a function for your login that has a mysql query inside of it, you have to access the db connection from inside the function.  There are two ways of doing this: 1.  Pass the db connection to the function the same as you do the username and password. 2.  use "global conn;" inside your function so it knows to use the connection from above it. [code]unction login($u, $p) { global conn; $sql = "SELECT * FROM users WHERE username = '".$u."'"; $result = mysql_query($sql, $conn) or die("Error!"); ............[/code] $res = mysql_fetch_assoc($result);
  20. [quote]So are you saying that this isn't keylogging or spyware?[/quote] No, it isn't.  It's just a utility that's built into php to help the programmer make his/her code better.
  21. What are you trying to accomplish?  Unless you tell us what the desired output is, we can't help.
  22. In a nutshell it provides the coder with a greater amount of feedback so that they can optimize their code.  Essentially, it's probably a mistake that you saw it on the part of the Yahoo devs.
×
×
  • 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.