Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Seeing as I'm on the geek list (aka "Most Time Online"), you can also track my total time online here: http://www.phpfreaks.com/forums/index.php?action=stats The way it works is that if you haven't clicked anywhere for at least 15 minutes, then you're considered offline. Otherwise you're online. When I'm at my computer, I'll often check the "show new replies" thing, so doing that four times within an hour will result in one hour of activity where there might have been one minute, so those stats are hardly accurate (unless of course you just registered). The actual activity measured in time will be considerably lower for everybody. A more accurate representation of one's activity would perhaps be the number of posts or number of posts per day. Remember though, 1000 quality posts is much better than 3000 crap posts
-
Here is something for you to work with: <?php // Find weeks in month: $month = 5; $year = 2008; $firstDay = mktime(0, 0, 0, $month, 1, $year); $numDays = date('t', $firstDay); $weeks = array(); $i = 1; do { $day = mktime(0, 0, 0, $month, $i, $year); $weeks[] = date('W', $day); $i += 7; } while ($i <= $numDays); print_r($weeks); echo "<hr />"; //--------------------------- // Find days in week: $year = 2008; $week = 18; $firstDay = strtotime('+' . $week * 7 . ' days', mktime(0, 0, 0, 1, 1, $year)); $month = date('n', $firstDay); $firstDayNum = date('j', $firstDay); $lastDayNum = $firstDayNum + 6; for ($i = $firstDayNum; $i <= $lastDayNum; $i++) { echo date('l, j', mktime(0, 0, 0, $month, $i, $year)) . '<br />'; } ?> I haven't checked that the output is correct, but in my head it should work perfectly. Edit: Random useless fact: This is the first time ever I have seen the use for a do-while loop...
-
Try to post the code you have and we'll take it from there.
-
Indeed. You'd be surprised at how many people who are doing that though. I've been able to find some live cameras broadcasting to some web interface using Google.
-
http://en.wikipedia.org/wiki/Google_hacking
-
http://google.com/search?q=lolcat http://en.wikipedia.org/wiki/Lolcat http://icanhascheezburger.com/
-
You're running the query at each iteration...
-
Cannot touch physical file after uploading from this script
Daniel0 replied to gdfhghjdfghgfhf's topic in PHP Coding Help
It's because your user nor your group hasn't got write access to the file. It's probably owned by whatever user and group your web server is running as. Only root is allowed to change the ownership using chown so you'll have to give write permissions to all. See: http://en.wikipedia.org/wiki/File_system_permissions#Traditional_Unix_permissions -
Heh... Q.E.D. Vague questions yield vague answers!
-
It does have a default behavior. If you're using PDO it'll throw an exception, the other extensions will generate errors. You should hide both of those from the user. Just tell them an unexpected error occurred.
-
You'll most likely not find a tutorial to do exactly that. You just need to parse the RSS feed (which is an XML format) and insert the information into your database. Parsing XML documents is rather trivial with SimpleXML. You can find the HTML for embedding the videos at every YouTube video.
-
You could use their RSS feed and use the HTML they supply for embedding videos.
-
Well, it's obviously possible to establish a connection seeing as some people have been able to (as long as the computer is on).
-
People answer whatever topics they have time to and they feel their capable of. Sometimes questions don't get answered because the poster is incapable of asking properly. If I see a topic where there is just a bunch of code with a message saying "help, it doesn't work" or something like that then I usually just leave it. If someone cannot take the time to properly formulate a question along with information such as database structure, error messages, expected behavior and how it actually behaved, then I won't always take my time to help that person. Some of those could be reasons why there are topics left unanswered.
-
This is impossible to say because it greatly depends on your location. That's why some companies outsource.
-
An HTTP response would look sort of like this: HTTP/1.1 200 OK Date: Thu, 01 May 2008 13:21:26 GMT Server: Apache/2.2.3 (CentOS) Content-Length: 1542 Connection: close Content-Type: text/html; charset=UTF-8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <head> *snip* The headers end after the first empty line.
-
[SOLVED] Apostrophe problem in simple php/MySQL CMS scripts.
Daniel0 replied to iainlang's topic in PHP Coding Help
This: is the problem. As you see, it's the $section_vis_name one that is the problem. You should run it (and all other values) through mysql_real_escape_string(). -
[SOLVED] Apostrophe problem in simple php/MySQL CMS scripts.
Daniel0 replied to iainlang's topic in PHP Coding Help
Try to add or die(mysql_error()); after the function executing the query. -
[SOLVED] Apostrophe problem in simple php/MySQL CMS scripts.
Daniel0 replied to iainlang's topic in PHP Coding Help
Try running the name through mysql_real_escape_string() before inserting it into the database. Also, what errors are you getting? That page was lost after the old site was taken down. However, see this post. -
You could always start out small and upgrade later if space/memory/bandwidth/whatever becomes a problem. You most likely wont get 20,000 visitors each day for a while after you've started. For instance, during the last couple of days we've had around 1750 visitors per day and from April 22 until now we've served 114,324 page views. It might (hopefully) increase when the site is eventually relaunched. These stats are applicable only for the forums and only for users who are browsing with Javascript on.
-
Ah, then you could do <?php $domain = strstr($_SERVER['HTTP_HOST'], '.'); ?>
-
Uh yeah... just strip everything before the first time two line breaks appear.
-
how to make the activate icon inactive in php
Daniel0 replied to pvpradeepraghav's topic in PHP Coding Help
<?php if ($isActive) { echo 'Active'; } else { echo 'Inactive'; } ?> or <?php echo $isActive ? 'Active' : 'Inactive'; ?> -
If they're all like subdomain<number>, then just replace the "subdomain" part. Otherwise it'd be pretty difficult to figure out programmatically when a new word starts.