Jump to content

tibberous

Members
  • Posts

    1,187
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by tibberous

  1. I have a PHP script that downloads an image from a 3rd party. It works when I run it from the command line, doesn't work when I run it as a cron daemon. I was thinking it might be having trouble because of relative file paths, so I tried running it from different directories and it still worked. The script is running, it's just the part that saves the image that doesn't - would it be a permissions error? Or is there something common I might want to check for?
  2. I am trying to send an email to approx 2,000 people every time a new event is added to a calendar. I'm guessing that I can't just call mail() 2,000 times, but I'm not real sure how to do this. I was thinking either a cron job that was called every minute, or a script that could be started from the webpage that would run in the background and process a queue. Ideas?
  3. I am using a 3rd party lookup service. Basically, they have you connect to their mysql database, select their db and do a query. I tried: $newconn = mysql_connect() mysql_select_db('db', $newconn); mysql_query("...", $newconn); mysql_close($newconn); But if I try to do mysql_queries without sending $newconn I still get errors. For right now, I'm just closing my first connection and reconnecting, but it seems like there should be a way to query a second database without messing up the connect to the first one.
  4. It is the one at: /usr/local/lib/php.ini Which is the path phpinfo() has for "Loaded Configuration File" I restarted the server after I changed the ini file, if I do phpinfo() it has: session.cookie_lifetime 2592000 2592000 Under the session section. Here is all my session data: session Session Support enabled Registered save handlers files user sqlite Registered serializer handlers php php_binary wddx Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 On On session.bug_compat_warn On On session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_httponly Off Off session.cookie_lifetime 2592000 2592000 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 100 100 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.hash_bits_per_character 4 4 session.hash_function 0 0 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /tmp /tmp session.serialize_handler php php session.use_cookies On On session.use_only_cookies Off Off session.use_trans_sid 0 0 I generally use tables and cookies for everything, thought this would be a good application for sessions =/
  5. I just set: session.cookie_lifetime = 2592000 The number of seconds in a month.
  6. I'm on a dedicated server. Here is how everything is set: session.save_path = /tmp ; Whether to use cookies. session.use_cookies = 1 ; This option enables administrators to make their users invulnerable to ; attacks which involve passing session ids in URLs; defaults to 0. ; session.use_only_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 1440
  7. I have a shopping cart that uses sessions. I keep loosing the session after a little bit of activity. I tried change cookie_lifetime in my php.ini but it is still happening. Any idea how I can prevent this?
  8. Does any country but America have "zip codes"? I thought they were called postal codes in most other countries. I'm talking about the United States, but I think everyone, including you, already knew that.
  9. I need to lookup a state based on a zip code. I found a database on source forge that looks good, but a reviewer complain about it's accuracy / completeness. Is there a better one I should be using? Here is the one I found: http://sourceforge.net/projects/zips/
  10. Be honest. The only reason you hate Java is because it's more difficult. ? I always thought Java was an easy language to program in. I'd say Flash is a touch harder, but they are also both very close to program in. Really the only reason I don't like Java is because of the runtime and it's performance. It isn't that bad for simple programs (I've used Frostwire) but it isn't good for web apps -- which is probably why most developers are writing in Flash. Java is to Flash what Perl is to PHP.
  11. Didn't say there were critical, just that they would make the language better. If floatval stripped everything to the first number, I'd be happy -- returning 0 when there are digits in the string really doesn't make sense. If the people who made PHP weren't worried about convenience when they wrote the language, we wouldn't have anything near what we have now. The ? operator, the foreach loop, $arr[] = $x, the for loop, ect. are all just shortcuts for things that could be done with only slightly more code.
  12. floatval / intval would ignore $ signs (ie: floatval("$5.25") would be 5.25, instead of 0 ) There would be a shorter version of mysql_real_escape_string, or even better, a shorter version of mysql_real_escape_string(trim()) Using [] on a non-array would initialize it as an array
  13. Personally, I hate Java - the runtime is bloated and makes my whole browser lag, plus I use java apps so infrequently that I always have to install or update the runtime. Everyone is going to have their own opinion of different technologies but it is pretty hard to be against using a propriety technology when there isn't a good, non-propriety alternative. I've heard java applets called a dead technology more than once. Flash isn't made to make whole websites, but it is the best platform for games, web cams, streaming video and animation. I'd say, in general, people like flash because they think games. My brother talks about "Flash Games" like they're their own genre or something.
  14. Yeah - that's what I want it to do. The code was originally a foreach loop I rewrote so I could peek ahead. The second line, the if(), is what I was asking the question about.
  15. Not sure how to get that to work - stuff like that was generally done back before browsers were capable of doing much. One of the problems with doing weird stuff like that is that it can easily be broken by server settings (timeout issues), browser versions, php versions, ect. If you have the time, you'd probably do better to write it with ajax. If your sleep is really long, you could even do it with straight meta refreshes and a session/db/file.
  16. I am looping through an array called items: for($i=0;$item=$items[$i];$i++){ // I want to see the price of the next item, if there is a next item if($item[$i+1] && $item[$i+1]['price'] ... Does php look at this, evaluate $item[$i+1] to false, then leave because the condition can never be true? Is $item[$i+1] guaranteed to get evaluated first because it is the left most condition? Is this a standard way to write code, or would 2 if's be better? if($item[$i+1]) if($item[$i+1]['price']) // safe, but makes it look like I don't understand Short circuit evaluation.
  17. Almost every animated game on the net is flash. A lot of colleges push java - it is a good programming language to learn object oriented programming fundamentals in. It might have just been what the developers had a background in.
  18. You learn something new everyday: http://www.arraystudio.com/as-workshop/mysql-get-total-number-of-rows-when-using-limit.html Basically, rather than having to do a query twice, you can do it once, then do a second query to get the amount of total results. Not only is it better performance wise, but you don't need to have conditions in 2 places (and it avoids the bug where the queries are out of sync, and you'll have like 8 pages but only 2 real pages of results)
  19. Yeah - the other thing to keep in mind is that eBay is going to have staff, which is going to be far more expensive than outsourcing. Everything eBay did in 2008 had to be done without causing downtime, while the system ran. Still, it is frustrating to see that projects that, in 2002 would have had 4 developers working for a year and a half, are now expected to be done in a month or two by one guy (for no money)
  20. I actually did search hotscripts before posting here. The problem isn't that I couldn't ONE, it's that I found hundreds and they all looked crappy or somehow , even the ones marked as free. I'm downloading webid now - hopefully it's awesome.
  21. I have a client who wants an auction system in PHP, "just like eBay". Does anyone know of an open source one that is good?... or at least decent?
  22. Using $_GET and $_POST instead of $_REQUEST Using some kind of big framework they wrote themselves that makes the code unreadable to anyone but them. $databaseConnection = new dbc(); $databaseManager = new databaseManager($databaseConnection, $response, true, 4); $databaseManager->executeQuery('users', 'insert', array('name'=>'Bob', 'age'=>'5'), 1); // wtf??
  23. Got the same image from pixmac.com for $4.00 Pretty cool imo. Guess it might be worth to shop around, in case the artist puts it on multiple sites.
  24. I need one image from Shutter Stock but you have to buy a minimum of 5. Does anyone have an account with them? I'll paypal you for an image.
×
×
  • 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.