Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Why would you want to do that? Can't you just setup both domains on the same server?
  2. You may want to take a look at RFC 2821 which specifies how the SMTP protocol works.
  3. Could you paste the particular error you get?
  4. Guess you have to complain to the SMF team.
  5. Indeed. That would constitute having the dll in PATH though.
  6. SELECT a.name FROM #__AuthorList AS a INNER JOIN #__magazine_users AS u ON a.AuthorID = u.userid
  7. Store the user name you get from the database instead of whatever the user inputs. Better yet, store the user ID instead of the user name, then select the user's information from the database on each request (or when you need it anyway).
  8. Well i would not call it lazy when i've been searching for hours to find the answer and didn't. Thanks to the other person who responded and didn't call my issue lazy. Laziness and greediness are two terms used when talking about regular expressions. If a search is greedy then it keeps on looking for matches as long as it can. It's wants as much as possible, it's greedy. A lazy search, however, stops as soon as it finds something that matches. It's lazy, it does the absolute minimum it has to. It's just two metaphors you use in regex. fenway wasn't talking about you being neither lazy nor greedy.
  9. GNU/Linux (e.g. ext3) file systems are case-sensitive, but Windows file systems (e.g. NTFS) are case-insensitive. Where do you get the username from? The database should have the same case as the folder on the disk.
  10. http://www.phpfreaks.com/forums/index.php/topic,243211.msg1135984.html#msg1135984
  11. str_replace('oranges', '<a href="oranges.php">oranges</a>', $text);
  12. You can extract them from an aspell dictionary. I've done that for you for English: UTF-8: http://daniel0.net/dict-utf8-en.txt.bz2 ISO 8859-1 http://daniel0.net/dict-en.txt.bz2 You'll have to import it into a database and filter out the words you don't want yourself. There are 137,883 words in there.
  13. You can use the old mysql extension instead of the new mysqli (MySQL improved) if you wish. You'll also have to modify the query to fit your needs. It was a sample snippet and not supposed to be used verbatim. You'll also have to do error handling and such.
  14. Yes, you need to declare variables before you can use them, if that's what you're asking.
  15. An easier solution might be this. It allows for expansion by just adding the language file in the folder. Theoretically you could have a large list of languages and it would look ugly to have all those if statements all over the place. // get language and set default to de $language = !isset($_POST['language']) || empty($_POST['language']) ? 'de' : $_POST['language']; // get the absolute path to the directory containing the language files $langPath = realpath('includes'); // get the absolute path to the language file we are looking for $langFilePath = realpath($langPath . DIRECTORY_SEPARATOR . $language . '.php'); // $langFilePath will be false if the file doesn't exist. // we also need to check that $langFilePath begins with $langPath to protect against RFI attacks if (!$langFilePath || strpos($langFilePath, $langPath) !== 0) { // if we made it in here then the file doesn't exist or somebody is trying to mess with the system. // either way we just say it doesn't exist. we do not wish to expose any information to the people // trying to mess with the system as that will only help them in further looking for vulnerabilities throw Exception("The language file '{$language}' could not be found."); } // now we can include it include_once $langFilePath;
  16. mysql_fetch_array only fetches a single row and moves the cursor one position forward. When there are no more rows it returns false. You can use a while loop to get all the rows. The loop will run as long as the condition is true and will therefore terminate when there are no rows left. while ($row = mysql_fetch_array($result)) { // do as you want with each $row here }
  17. Well, read the error. The file doesn't exist.
  18. You shouldn't use that kind of join. Make an explicit join using the JOIN keyword instead: SELECT * FROM #__AuthorList AS a INNER JOIN #__magazine_users AS u ON a.AuthorID = u.userid; You can read more about joins here: http://www.phpfreaks.com/tutorial/data-joins-unions
  19. Make sure that the file libmysql.dll exists in PATH.
  20. Try to run this command: chmod g+rw -R /home That will recursively give read and write permissions to group on /home.
  21. Could you post your HTML form at least?
  22. Well, if you can make a list of usernames then making a list of links to user profiles is essentially the same. Sort of like: $db = new mysqli('localhost', 'user', 'password', 'database_name'); if ($result = $db->query('SELECT username FROM users WHERE user_id = 5')) { echo '<ol>'; while($user = $result->fetch_assoc()) { echo '<li><a href="' . htmlentities(urlencode($user['username'])) . '">' . htmlentities($user['username']) . '</a></li>'; } echo '</ol>'; } else { echo '<p>There are no users in this group.</p>'; }
  23. Yeah, I've read that one. I think it's nonsense. It's essentially saying that you shouldn't do it because you may do it in a bad way. That's just plain stupid. Besides, it contradicts common sense (having keywords in the URI would logically make it better) and what is otherwise always said. It also contradicts themselves: http://www.google.com/webmasters/docs/search-engine-optimization-starter-guide.pdf From a usability standpoint it'll also be better. Which address you think a user can best remember and give verbally to another user? example.com/action/name-of-movie or example.com/index.php?action=viewMovie&movie_id=23139
  24. SELECT CONCAT(patron.firstname, ' ', patron.lastname) AS name FROM patron WHERE name = '*******'; name is an identifier. Those do not have single nor double quotes around them in SQL. Otherwise they are string literals. If you do e.g. 'name' = 'foo' then you are selecting all rows from patron where it is true that the string name is the same as the string foo. This is never true and as such you will never get any results. If you do name = 'foo' then you are selecting all rows from patron where it is true that the column[/tt] (or alias) called name equals the string foo. This may or may not be true for some rows, but for those rows where that statement is true will be returned, the others won't.
  25. Yeah I hate that as well. I don't understand why people still use things like mailing lists. I find a linearly laid out conversation much easier to follow.
×
×
  • 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.