Jump to content

ohdang888

Members
  • Posts

    1,285
  • Joined

  • Last visited

    Never

Everything posted by ohdang888

  1. Ya, that seems to be straightforward. When you transfer files back to live, do you use rsync?
  2. Hey guys, I've got my first beta testers on board, and now I need to setup a development environment as I can clearly no longer develop on the live site. What do you find is the best way to do this? currently I have my public_html directory structured like this: public_html/ site/ app/ api/ Would be it best to just create a beta_site/ folder, and beta_app/ folders, and then when those are ready, just transfer the files over? How do you setup your development environments and methods? Thanks!
  3. Is it a normal or standard practice to set an object var to a MySQL wrapper i.e. $api = new API(); $api->db = new MySQLwrapper(); and in the api methods, they call things like $this->db->query("blah blah blah"); Or should the API class inherit from the MySQLwrapper? Thanks
  4. hm. Well it can be done with another query but thats inefficient. try copying that $result2 into another variable, like $result2copy and use $result2copy in the 2nd loop
  5. 1) We can't see line numbers, be more specific 2) "how to syntax" - say what? your example could simply end the PHP and begin it again ?> <div class="navigation"> <ul> <li><a href="test.php"<?php if($pageOn == 'test.php'){?> id="selected"<?php }?>>home</a></li> <li><a href="book.php"<?php if($pageOn == 'book.php'){?> id="selected"<?php }?>>books</a></li> <li><a href="movie.php"<?php if($pageOn == 'movie.php'){?> id="selected"<?php }?>>movies</a></li> <li><a href="contact.php"<?php if($pageOn == 'contact.php'){?> id="selected"<?php }?>>contact</a></li> </ul> </div> <?php
  6. well, first thoughts: this should be throwing an error: echo $email'; Remove the '
  7. Check it out at http://www.crambu.com/index.php I changed the homepage. Basically my question is this: Do you understand what Crambu is after landing on the homepage? Thanks!
  8. try <?php if (!isset($error)) //if no errors add to DB { mysql_query("INSERT INTO Reg_Profile_Private (UIN, firstname, lastname, email, phone, password, username) VALUES ('$uin', '$firstname', '$lastname', '$email', '$phone', '$passwordenc', '$username')"); } else { //else print errors foreach($error as $key => $myvar) {print "$myvar </p>\n"; } } ?>
  9. well this: " SELECT userid FROM ads WHERE adid='$this_adid' " will ALWAYS be translated as this: "SELECT userid FROM ads WHERE adid='' " because its nested within an empty caluse. Are there any records that have NOTHING in adid column? you should always try print_r on the results
  10. Ya i used date_default_timezone_set("America/New_York"); before anything. And that's what I'm getting. I'm assuming I needed to set it to EST because the time is in EST and i want it to match
  11. Thanks! knew it should that simple. BUT from that exact string i'm getting this time: using Sun Nov 06 2011 09:30:00 GMT-0500 (EST) getting 2011-11-06 4:30:00 using <?php echo date('Y-m-d G:i:s', strtotime(url_decode($_GET["start"]))); ?> I changed the timezone to EST, and its still coming up with the same thing. I've tried messing around with it, but not getting it to work. How do i adust for this difference? thanks
  12. I'm given something like this: Sun Nov 06 2011 09:30:00 GMT-0500 (EST) And i'm trying to turn that into 2011-11-06 09:30:00 I started by using explode and trying to loop through the day and month to figure it out, but that seems inefficient and overly complicated. Am i missing something? Thanks
  13. Google Spreadsheets/Forms always work fine with me.
  14. Hey guys, random question: Does anyone have knowledge of pulling data from the view of an image? For example, I have an image of a map that I'm putting on GoogleMapsApi. Instead of the user drawing a bunch of polygons, I'd like to be able to know where the lines in the image are, and i'd automatically trace the polygon. It'd be a simple black and white image [white background, a few black lines]. Anyone know a solution or method for this? Thanks.
  15. That's returning a row for each user_id with the total number of groups they are in like this: user id total 42 1 53 2 65 1 So, theoretically i could get the total number of unique users by mysql_num_rows, but i'd like to just get that done in the query than wasting extra resources any ideas? thanks
  16. Quick question: should be simple, but its escaping me: I want to get a count of user_ids (not the user_ids themselves, just the number) of users in 2 groups. However, if a user in both groups, they only count for 1 (because you don't want to send them 2 emails). How do i get that number: This query is returning the total count, regardless if a user is in 2 groups. SELECT DISTINCT user_id, COUNT(user_id) AS total FROM group_members WHERE group_id IN (2,17) any thoughts? thanks!
  17. This doesn't asnwer your question, but, in general, depending on your host, I would send it from one of your own email addresses on your domain, then attach a reply-to with the from email. Most spam fliters don't like the from address not matching the domain it is being sent from
  18. with require() ? ya, that's a good idea... at least for the few cases that are 100+ lines long. I haven't minified my JS yet. I don't plan on really taking the time to do while i'm in the building phase of the product Thanks
  19. just wanted to get your thoughts on my ajax setup. I have 20+ ajax calls that all lead to the same ajax file, defined by action... like: myAjax.php?action=delete myAjax.php?action=save The way the actions are decided upon is through one really big SWITCH statement with 20 cases. The file is now about 80kB. Performance is not a problem now, but theres not many users. Could that potentially become a big latency problem down the line, the fact that the file is 80kB (and thus the parser must run through all that code... a lot of it is raw html though)... thoughts? thanks
  20. then build it? google for answers to SPECIFIC issues. when you get stuck, post that code/issues here. We will not build an application for you, sorry. You can hire someone to do this work for you, or you can attempt solutions and post issues here
  21. thats a CSS styling issue, not php examples: http://www.google.com/search?client=safari&rls=en&q=css+%3Ccode%3E&ie=UTF-8&oe=UTF-8#sclient=psy&hl=en&safe=off&client=safari&rls=en&source=hp&q=css%20style%20code%20block&pbx=1&oq=css%20style%20code&aq=1&aqi=g3g-m2&aql=&gs_sm=sc&gs_upl=5728l7491l0l9339l12l8l0l1l1l0l221l910l2.4.1l7l0&bav=on.2,or.r_gc.r_pw.r_cp.&fp=fa292ea85790151c&biw=1276&bih=684&pf=p&pdl=300
  22. i got stuck on this for a while, and it turns out existing cookies were messing my logic patterns up. Clear your cookies, restart your browser, and try again
  23. Well, really, you're limited to the information the client provides you. A.k.a - a bot could send a IE header, and you wouldn't know (using this method, at least). but anyways, a simple search reveals a quick solution: <?php if (preg_match('/slurp|inktomisearch|[Gg]rub|[bb]ot|archiver|[ss]qworm/', $_SERVER['HTTP_USER_AGENT'])) echo "Is not a human"; ?>
  24. ohdang888

    Google+

    It'll be realllyy interesting to see what it takes for people to shift to a new social network
×
×
  • 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.