Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Zane

  1. Content, content, content.  The key to SEO.

    There are several, and I mean several, other factors involved (with search engines today), but content is the number one source of information.

    By content, I means words, lots of words, like enough to fill a few blog entries.  For ecommerce sites, the product information, and most importantly the name and descriptions will draw in the traffic.

  2. SELECT UNIX_TIMESTAMP( datetime field);

    This will cause your database to work harder though, especially if you have thousands of records.  Mysql's DATETIME datatype is the better alternative, it will allow you to perform complex date calculations much faster. otherwise you will have to convert all UNIX TIMESTAMPs to a mysql date format before performing any kind of the date functions provided by MySQL.

    Granted, though, NOW() will give you the server time, while the UNIX Timestamp will give you seconds since the epoch.

  3. Just echo out the PHP variables into your Javascript.

          var sender_id = <?php echo $sender_id; ?>;
          var receiver_id = <?php echo $sender_id; ?>;
          var message = <?php echo $sender_id; ?>;

    You can create JavaScript from PHP, but not the other way around.  PHP is parsed FIRST.  You can have PHP output whatever you want, anywhere you want. pretty much.

  4. it was saying thread_id wasn't a defined index because you were echo-ing out the thread_id get variable.  You also commented out the if (isset) portion.

     

    So it seems the answer is that thread_id isn't being passed when you seem to think it is.  If you plan to use the same value on multiple pages, it's best to use the actual tool for that task... $_SESSION.

  5. It's not going to be as easy as getting the average of the two colors.  You're going to have to convert to something like CMYK/HSL/HSV and so on, perform some extremely complex algorithms, and get a result that you would then convert back to RGB. (hex)

     

    Your best bet, and easiest alternative without re-inventing the wheel is to find a jQuery plugin that can do it for you, such as this one

    http://www.xarg.org/project/jquery-color-plugin-xcolor/

  6. Any SQL advice Barand gives you, soak it up like a sponge.  He (and fenway) have helped me several times over the years, without any disappointment.

     

    Creating a blank table with premade records is the most inefficient way possible to do what you are doing.  One day can have several appointments from what I gather so what good would it do you to prepopulate a table?

     

     

     

    I tried to make a date column and make it a primary key.

    Again, you will have multiple appointments for a given day, so using the DATE as a primary key will not work like a primary key should.  Most primary keys are set to auto-increment, so what is going to happen when you want to add a new booking appointment?  You'll have to insert the date everytime and not only that, you would need to check if there is s a duplicate key, since you're not automatically incrementing your index.

     

    What Barand has shown you in the other thread is more than enough to get started.  Read over it several times if you have to.

    I'm closing this thread so you can continue with your original one.

     

    http://forums.phpfreaks.com/topic/290480-appointment-booking-script-for-calendar/?do=findComment&comment=1487931

  7. Install and exclusively use Google Chrome

    Install a Adblock AND Adblock Plus, to keep tempting clicking of ads with chicks with really nice racks and nice everything else... raw.  Well not just to keep them from clicking it, but from having it appear at all on the webpage.

     

    You can also install VNC and remotely access the computer from somewhere else, like your batthroom, sitting on the toilet with your laptop with nothing on your mind other than what your son is falling witness to on the evil Internet.  By adding all of these obstacles to your son's internet experience, you are forcing him to educate himself further and further into how to bypass security.  Whatever you tell a kid not to do, is exactly what they will do.  Perhaps you could just sit down with him while browsing these evil areas and traumatize him with awkwardness, sort of like how parent's make their kids smoke an entire pack of cigarettes to teach them smoking is bad.

  8. My son is 11 and my wife caught him deleting IE history the other day.

     

     

    If your son is capable of this, then it shouldn't take long for him to google around your keylogger, or firewall.  Kids are much more inclined to excel in the digital age than the generation from a decade ago.  The internet is always crawling with trolls, naughty pleasures, and debauchery.  I don't want to tell anyone what to do with their children, but IMO, if you don't want him to witness the evils of the internet, then don't let him use the internet.  He will eventually find a way to get access though because the internet is everywhere.  He's just one question away from using any restaurant or book stores' or libraries' wifi,...... "Can I get the wifi password?"  If they say no, then just head down to the next hotspot, lather, rinse, and repeat.

    • Like 1
  9. Thanks for not being helpful. Don't tell me what to fucking do.

     

    But that is exactly what you asked for right?  Someone to tell you, why, what, where, and how.

    I can see your main question in the title of this thread, that is great, but your post contains nothing but your code(s).  Apparently, members.php is not displaying the username.  Are you sure that your query is correct?  Are you sure that the SESSION is right?

     

    gerkintrigg mentioned only one helpful thing, debug.  He forgot to mention and educate you on some basic debugging techniques.

     

    For instance, to check your SESSION contents, use this snippet

    echo "<pre>", print_r($_SESSION), "</pre>";

    You will want to use this snippet to check out most of your variables.  There is also error_reporting, display_errors, var_dump, and just plain echo statements.  If you can't successfully get the username, then either your query isn't returning anything, which should return an error, or your logic is all wrong.

     

    EDIT: Also, why are you using fetchColumn() when you could just use fetch() which would give you everything in that row as an array?

  10. If your child is using the same computer as you, then just setup a limited account for him.  He doesn't have to use the same account as you, that would be the source of your problems right there.  The honor system is a horrible security measure.

     

    Another option is to edit your hosts file, automatically redirecting bad sites to nothing.  That would also mean that you couldn't go to them, so if you don't want your children checking our your favorite porn/weather site, you might have to write a script that will edit your hosts file on the fly.

     

    There are several ways to accomplish this, but ..... they will all take a lot of time and effort on your part.  This generation of kids have grown up with the Internet, they do not know what the world is like without it, they are essentially better than us at using the Internet anyways.  Several young people make quite a bit of revenue simply from uploading their cell phone videos.

  11. Yeah, your worst decision ever was to host your site on GoDaddy.  The company wasn't meant to be a web host provider, it was made to be a registrar, which, IMO, they do just as good a job as any other registrar does.  It's not like you can make a domain faster, all you do is set your nameservers and forget about GoDaddy until it's bill time, or you switched hosts.

  12. This SymmetricDS is driving me up the wall, I really want to use it, but I can't get the sufficient information to do what I want.  I've posted two questions on their forums and it doesn't seem to be a very active place; but they have a billion and one different user guides and tutorials with hardly any examples.

     

    I downloaded a trial version of SQL Examiner, which is GUI-based, and it seems to do a somewhat decent job, I mean it actually makes the full database comparison and updates the MySQL database successfully on the remote server just fine, but I have to initialize the replication manually.

     

    I experimented with scp and like it very much, but again, replication would have to be manual unless I come up with a script to automate it, and not only that, I would need to create a listener script on the remote server.  And it's not like I need to synchronize the entire database, but rather, only a few tables, from some of which I would only need a few columns.

     

    SQL Server comes with something called Linked Accounts where I can actually query my remote mysal database as if it were local, and eventually I ended up researching triggers for all updates, inserts, and deletes..., but again, I find myself realizing that I suck as a database administrator.

     

    My last resort to this problem would be to schedule an sql dump to run on the in-house server periodically throughout the day, send it to the VPS overwriting an SQL import file, then create a crontab on that VPS that will import that dump periodically...  

     

    Why does something that seems so damned simple have to be so damned complicated?

×
×
  • 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.