Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. With description, it should be whatever text provides a summary of the content for that page. Many times, google will display what you have in your Description in their search results. Url's don't factor into it. So in your examples above, example #1 would be the closest. The google blog is often a good source for some information on how they look at it: http://googlewebmastercentral.blogspot.com/2007/09/improve-snippets-with-meta-description.html
  2. Keywords are meant to be a list of "key" words, typically comma seperated. However, Google for one, just ignores them: http://googlewebmastercentral.blogspot.com/2009/09/google-does-not-use-keywords-meta-tag.html
  3. Even in your latest example, you're still screwing up the Bcc header Little details matter. I think you would also benefit from a better understanding of the difference between using single and double quotes for php strings. Start with this: $subject = 'New Announcement From Rhino Shield'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: $to \r\n"; $headers .= "Bcc: $email_array \r\n"; mail($to, $subject, ' Title <br /> table {background-color:white;border:1px solid black;padding:5px;}<br /> table tr {padding:10px;border:1px solid black;background-color:white;}<br /> table tr td {padding:5px;border:1px solid black;}<br /> table tr.odd {background-color:#e2e1df;}<br /> </pre> <table> Please see below for a new announcement. ".$announcement_content." </table> <br><br><br>', $headers
  4. There is whitespace in functions.php, which was interpreted as output. Once php thinks it sees output, it sends it, and thus the http header has already been constructed and sent. It's really very simple. The problem is in functions.php. One thing that cures this is to leave the ending ?> off scripts you include like class scripts, config scripts or function scripts. At any rate, it could be a spurious newline in there before the starting <?php or some other issue.
  5. What you are doing is kind of like taking a data file for an excel spreadsheet and opening it with photoshop. That fact that you get anything at all is astounding, but continuing to ponder it outside of pure academic curiosity is a complete waste of time.
  6. What OS are you running this code on? What is the email server involved? One other thing i just noticed, is that your From header just has a \n, --- the headers all need the \r\n. Here's one article that lays out the right structure. Bottom line, is that email is a 7bit tech, and html doesn't fit into that. If you want to code something that doesn't work right for many email agents because you want to scrape by, it's a lot harder to say definitively what the end result will be or diagnose problems. It's not like doing it the standard compliant way is that difficult. Here's one article, and there are many more that can be found with a quick search: for things like php email, php html email, php multipart etc. http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php
  7. 2 things: -the bcc header is 'Bcc' -this is not how to do an html email, from a standards point of view. You should start with a text only version, and multi part mime encode the html version. There are plenty of articles and tutorials on how to do this.
  8. No Json has nothing to do with xml. A quick google on json would be in order, but in a nutshell, it's a format that serializes the data in a javascript object.
  9. You can use the underscore if you really want -- it's neither here nor there. It won't be a benefit nor will it be a hinderance to anything that is important. Of course there are other strings of characters that could be in a title as alluded to previously. For example, '--', '...'. It is perfectly fine to substitute an underscore for a colon, but from a logical standpoint, what do you gain of value by adding that complexity? The slug has no importance other than: -to pass as a parameter to find the article in the database -to reinforce using words, the title and text of the article, which *may* be of value to some search engines. -to make nicer bookmarks for people, so that when looking in a bookmark list, they might recognize it some time later when they want to refer back to it Considering this, it's just cleaner to exclude the colon or a special replacement for it, and hopefully it's clear that any consideration of the colon is not important, but if you really want to replace it with an underscore it's not going to hurt anything.
  10. Strip out any punctuation characters, quotes, hyphens etc. They are not needed in the slug and will not help with google. All you require is something that has words in it that basically match the article title. Just stick with hyphens for spaces ... so basically: -strip out all punctuation -replace spaces with - And use that for your slug. This is partly functional (characters that are ok in url's without url encoding) , and partly "search engine friendly" and "search engine optimization" strategies you are focusing on. As mjdamato pointed out, you could take the exact title with punctuation and spaces and url encode that, and it will be fine with google. It just won't look friendly to your visitors, and may discourage them from bookmarking it. So for that reason, you really want to remove all the punctuation characters and basically anything else that would have to be url encoded.
  11. If an error is being generated, output will be sent because you have display errors on. You would not have this setting turned on for a production server. Don't turn on output buffering unless you completely understand what it is for, and have a good reason to use it.
  12. Storing files in blobs is not a great solution in most cases, but if you're only talking 5k entries in a year, it really doesn't matter. In 10 years you'd only have 50,000 rows. These days, what most people would probably use is a nosql database. The one that immediately comes to mind for me is membase. You might wonder who is using membase? One company many people have heard of is Zynga, who uses it to store lots of small files associated with their games. Membase is extremely fast, scalable to multiple servers, and was built specifically for storing and retrieving files. For example, you could have 2 or 3 membase servers, and configure them to replicate, and this would insure that if one server went down you'd have a backup. O With that said, this application, if security is at all of importance, shouldn't be running on a godaddy shared server in the first place. Forgetting the impracticality of 700 on a web accessible file ... if the file is available in webspace it doesn't really matter what the perms are. It is already public. If however, these are files that should only be delivered to certain people who authenticate, then you really do have to store them outside the webroot or in a database to have any sort of basic security. That should be doable even on a shared server, where your webroot is typically going to be: /home/username/public_html or something similar. Your home dir of /home/username can have directories underneath it where you can store the files, so that they are not under the webroot.
  13. You have to be clear about what you mean by "post it on my website". Are you trying to download the image and store it somewhere on your server, so that you can display it, or do you simply mean you want the url to the image, so that you can store that and later you will use in in an img tag?
  14. He means that you never assign any variables to $_SESSION in your code. At the top add this 2nd line below yours: if (!isset($model) && isset($_SESSION["model"])) $model = $_SESSION["model"]; $_SESSION['model'] = $model;
  15. Well I think we've been working on trying not to be such pushovers, and insist on people actually doing enough work to justify our help. Lots of questions go without an adequate answer because people get fed up with bad questions and people who don't seem to be able to understand the content of the answers adequately. The nature of the software development field is that there is and always has been a practice of documenting things for the greater good, and helping others. Most programmers understand that they stand on the heads of many who have come before them, and increasingly software has features that allow it to connect and interface with other systems, so it behooves everyone to share and document, and that's what motivates people to do the same. I know that the material I've published based on things I've learned was certainly motivated by that, because a day rarely goes by that I'm not googling and reading information that someone decided to publish, which has helped me figure out how to get around a problem I've encountered, or figure out how to solve a problem I need to tackle in my work. The reality of the world is that most people take more than they give, but overall the system benefits the majority. Simply pointing out that there are people who leech off of others would not be a great surprise to anyone in my opinion.
  16. Start with -- if you're trying to check for the existence of a variable then use isset(). However let's say you have $_SESSION['username'] = ''. What do you think isset() will return? If you're trying to determine if the username actually contains something then try if (isset($_SESSION['username'] || empty(trim($_SESSION['username'])). With that said, the obvious issue with your script is that you are doing session_start() twice. You need to start the session at the start of the script whether or not a person is logged in, and there is no reason to do a 2nd session_start() after that.
  17. As stated in my post, by default php's session "cookie" is a "session cookie". You can override the default, but thorpe is correct. The configuration can be altered of course, and in this case perhaps it has been: http://www.php.net/manual/en/function.session-get-cookie-params.php
  18. I wrote a post previously talking about a number of these questions -- might help a bit: http://www.phpfreaks.com/forums/index.php?topic=223785.msg1579550#msg1579550 When people want to have a session last beyond the life of a browser (as in a "remember me" feature) one typical way of implementing that is to create a separate cookie that can be used instead of logging someone in. This of course is a very dangerous feature if implemented incorrectly, because if someone figures out what you're doing, they could craft a cookie to log them into your system without the need for a name/password combination. So one way of doing that is to generate a hash value that is guaranteed unique, and store that in the user row, while at the same time pushing it as a cookie. Your code would then need to handle this cookie if it exists, when a user is not in a "logged in state" and basically, do the same processing that is done on a login.
  19. isset() is a language construct in php that requires the variable you want to check be passed as a parameter. Thus you need: isset($var1) && isset($var2) etc. if you want to do what you're trying to do above. So yes... your parens are wrong.
  20. Also, stripslashes would be the opposite of what you want. When you add data to a database, you typically would addslashes. When you pull the data back out for display, then you stripslashes. This could also be affected by magic quotes which you would want to determine whether or not it is configured (although hopefully not) and depends on the type of software you're writing (is this generic, or something only you will use, and can safely ignore the magic quotes issue). Depending on the database, there are specific functions to use in lieu of addslashes.
  21. Your mistake is in your lack of understanding of parameters to functions/methods. You have a method connect() that has no parameters, then you attempt to call it passing parameters to it, which php ignores.
  22. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=340556.0
  23. gizmola

    onclick

    Yes, so long as the onclick makes an ajax call. Ajax is not the simplest thing to do in a cross platform manner. I'd suggest using jquery to make it simpler. See http://api.jquery.com/jQuery.get/ for an example of how to use jquery to make a get request to a url.
  24. I am in the process of writing up a small article on how to do this directly with mysql SQL in a query. So if you have the birthdate in a mysql DATE type column, this query will get you a person's age, based on their birthdate. This query assumes a table named "bday", with the birthdate column named "bdate". You would need to adjust for your table and structure accordingly. You'd want to add an appropriate WHERE clause to get only one row as well. SELECT YEAR(CURDATE()) - YEAR(bdate) - IF(STR_TO_DATE(CONCAT(YEAR(CURDATE()), '-', MONTH(bdate), '-', DAY(bdate)) ,'%Y-%c-%e') >= CURDATE(), 1, 0) AS age FROM bday;
×
×
  • 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.