1. Post #2441
    Guru mediation error
    Amiga OS's Avatar
    July 2012
    7,119 Posts
    localhost is loopback too.

    Edited:

    It doesn't even need to resolve anything as it's defined in your hosts file so there's literally no difference.
    I do have a huge hosts file for blocking adverts, that may explain it?
    Reply With Quote Edit / Delete United Kingdom Show Events Dumb Dumb x 2Funny Funny x 1 (list)

  2. Post #2442
    Gold Member
    wizard`'s Avatar
    August 2009
    949 Posts
    Has anybody got experience building line graphs?

    I would like to avoid using a pre-made one unless its VERY simplistic (not all the shitty 3d crap) and fairly easy to use. I basically want to graph an archived record of prices.

    Some prices can be as low as $1 and some as high as $20,000 so it would need to be fairly dynamic. I also need to track at least 6 different lines at once.

    If anyone knows a good tutorial for making one that'd be great.
    Reply With Quote Edit / Delete Windows XP Australia Show Events

  3. Post #2443
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    What would be the best way to create a notifications system? ( I mean from a model stand point )

    So far I have a Notifications Model with a type column so I can use STI.

    I would then create a subclass of it to suit each type of notification.

    Like:

    New Reply
    Friend Request
    Quoted

    Only, they all need different data to be displayed. My first thought was that I would for each different notification type create a new model like NewReplyData and link them. But doesn't that defeat the purpose of STI? Even though I only use STI to simplify the query for fetching them all.

    Someone got some input?
    I like using STI for this kind of stuff like so:

    You have a base Notification class in models/notification.rb, then you have specialized classes like Notification::NewReply in models/notification/new_reply.rb, etc.

    Then for each notification type, you can put a partial in views/notification/_new_reply.html.erb.

    Then you can do something like this:

    Code:
    <% @notifications.each do |notification| %>
      <%= render partial: notification.class.name.underscore %>
    <% end %>
    although you'd probably want to move that shit into a helper
    Reply With Quote Edit / Delete Mac Australia Show Events

  4. Post #2444
    secretly a furry
    Jelly's Avatar
    April 2011
    2,023 Posts
    Does anyone have any ideas on how to effectively organise an analytics database table? I'm thinking of just having different columns for the year, month, day, hour and the event that gets incremented every time the event occurs.
    Reply With Quote Edit / Delete Linux Australia Show Events

  5. Post #2445
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    figure out what you want to measure and design your database around that
    Reply With Quote Edit / Delete Mac Australia Show Events

  6. Post #2446
    italian
    TerabyteS_'s Avatar
    June 2011
    2,645 Posts
    Does anyone have any ideas on how to effectively organise an analytics database table? I'm thinking of just having different columns for the year, month, day, hour and the event that gets incremented every time the event occurs.
    Google Analytics offers that out of the box, I don't think it's needed to reinvent the wheel.
    Reply With Quote Edit / Delete Windows 7 Anonymous Proxy Show Events Agree Agree x 2 (list)

  7. Post #2447
    Floatation's Avatar
    November 2011
    86 Posts
    Hi, 2 questions

    Is it possible to use a domain on your own local web server?

    How do you get cpanel-like features on your own web server? Mostly just the subdomain and email account features?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  8. Post #2448
    Gold Member
    Spero78's Avatar
    August 2010
    259 Posts
    Hi, 2 questions

    Is it possible to use a domain on your own local web server?

    How do you get cpanel-like features on your own web server? Mostly just the subdomain and email account features?
    You can edit the DNS information to point a domain to your IP Address, sub domains can be configured in the Apache conf files (assuming you are using Apache) and e-mail uses different server software altogether, although you can host it this is something im not familiar with.

    Honestly I would recommend just paying for some hosting, its much easier and doesn't put strain on your bandwidth, not to mention the cost of running your PC constantly for an e-mail server.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  9. Post #2449
    Floatation's Avatar
    November 2011
    86 Posts
    Been using lithium hosting, but I prefer to be in full control of things.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  10. Post #2450
    z0w0's Avatar
    March 2012
    2 Posts
    My work in progress HTML5 game is lagging like hell with GPU acceleration enabled on Windows (with any browser). However, it's working fine for me with Chromium 21 on Linux and anyone that had absolutely halted performance with GPU acceleration had it running fine at 60fps with acceleration disabled. Does anyone have any idea what could be causing this?

    Notes: I clip the canvas to stop any drawing outside of the viewport, objects use gradients and circles which are laggy to path each time so each object has its own canvas that is compiled once and I use requestAnimationFrame. This is as far as I can think to optimize it without making the game only render the portion of the canvas that has changed each frame.

    WARNING: It may potentially slow down your system.

    EDIT: Forgot to mention that it runs Box2D in the rendering process, but that's not important - one person who was lagging horribly managed to profile it and found Box2D was using hardly any of the total CPU usage (the Chrome profiler stated that Chrome itself was using ~98% of the CPU, which is very strange and unreproducible on my side).
    EDIT: Seems to be fixed now. Looks like the ctx.clip calls were doing it.
    Reply With Quote Edit / Delete Linux Australia Show Events

  11. Post #2451
    Meow :3
    Ac!dL3ak's Avatar
    July 2005
    6,090 Posts
    My work in progress HTML5 game is lagging like hell with GPU acceleration enabled on Windows (with any browser). However, it's working fine for me with Chromium 21 on Linux and anyone that had absolutely halted performance with GPU acceleration had it running fine at 60fps with acceleration disabled. Does anyone have any idea what could be causing this?

    Notes: I clip the canvas to stop any drawing outside of the viewport, objects use gradients and circles which are laggy to path each time so each object has its own canvas that is compiled once and I use requestAnimationFrame. This is as far as I can think to optimize it without making the game only render the portion of the canvas that has changed each frame.
    this is my computer



    you managed to slow it to a fucking crawl
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Informative Informative x 1 (list)

  12. Post #2452
    z0w0's Avatar
    March 2012
    2 Posts
    this is my computer
    you managed to slow it to a fucking crawl
    Yep, and I have absolutely no idea why. It is working fine for me with both GPU acceleration enabled and disabled on Linux. Some Windows users can run it fine as well.

    EDIT: If you can, try disabling GPU acceleration (simple as going to about:flags in Chrome, probably just as easy in Firefox).
    Reply With Quote Edit / Delete Linux Australia Show Events

  13. Post #2453
    McGii's Avatar
    April 2012
    644 Posts
    Doing a group assignment for school, I have to make a login page for a market day bank system with a teacher part and a student part.

    How it works is that I have a username and password text box, a radio option thing to go to the teacher section or the student section, I don't have any php yet but I'm working on the html. What I want to know is if I can have 2 buttons, 1 labelled teacher and the other student, and it takes them to that respective page if the username and password they typed in has the right privileges. I'd also like to encrypt the passwords so I googled it and everyone says "use bcrypt", when I google how i get nothing remotely helpful. Does anyone have a link/willing to type up how i implement it?
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Programming King Programming King x 1 (list)

  14. Post #2454
    Gold Member
    Clavus's Avatar
    September 2009
    6,329 Posts
    Are there any PHP frameworks you guys can recommend? It's for a personal website so I don't need a whole lot of features, but it'd be nice to have some kind of structure I can code my website around.

    Edited:

    Seems Codeigniter is recommended a lot as a simple lightweight framework.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  15. Post #2455
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,692 Posts
    You don't really need a framework for a simple personal website, but whatever.
    Beside CodeIgniter there is CakePHP which is also very popular.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  16. Post #2456
    Gold Member
    Spero78's Avatar
    August 2010
    259 Posts
    Are there any PHP frameworks you guys can recommend? It's for a personal website so I don't need a whole lot of features, but it'd be nice to have some kind of structure I can code my website around.

    Edited:

    Seems Codeigniter is recommended a lot as a simple lightweight framework.
    http://laravel.com/
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  17. Post #2457
    Gold Member
    Nevec's Avatar
    June 2008
    1,094 Posts
    Anyone has any information on search engine friendly URLs that are also user friendly? If each page in my site has a name that is not guaranteed to be unique, how do I encode it so that it becomes unique without sacrificing readability?
    Reply With Quote Edit / Delete Windows 7 Latvia Show Events

  18. Post #2458
    McGii's Avatar
    April 2012
    644 Posts
    <?php //By McGii
    $pass = $_POST["Password"];

    $i = 0;

    echo $pass[$i];

    while ($i <= (strlen($pass)-1)
    $result mysql_query("SELECT Encrypted FROM encryption WHERE Normal = '" . $pass[$i] . "'");





    Why won't the above parse? Apparently there's an unexpected variable in the last line
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  19. Post #2459
    Gold Member
    dastiii's Avatar
    March 2012
    38 Posts
    $result = mysql...?
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  20. Post #2460
    McGii's Avatar
    April 2012
    644 Posts
    I had it pasted into the post box when i said that but i fixed it then forgot to change the code here but posted anyway cause it still wasnt working


    Turns out I was missing a ) as well
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  21. Post #2461
    Airport Dweller
    Slater's Avatar
    October 2005
    1,201 Posts
    Call me an idiot if you will, but I can't get even a damn mail(to) function working in PHP tonight. I don't know if it's my terrible code or the exchange server is rejecting it.

    <form method="post" action="emailsend.php">
    <p id="introparagraph">Name:</p>
    <input name="name" type="text"><br/>
    <p id="introparagraph">E-mail:</p>
    <input name="email" type="text"><br/>
    <p id="introparagraph">Subject:</p>
    <input name="subject" type="text"><br/>
    <p id="introparagraph">Message:</p>
    <textarea name="message" rows="5" cols="45"></textarea><br/><br/>
    <input type="submit">
    </form>
    <?php
    $to = "ryan@ryanslater.co.uk";
    $name = $_REQUEST['name'] ;
    $email = $_REQUEST['email'] ;
    $subject = $_REQUEST['subject'] ;
    $message = $_REQUEST['message'] ;
    $headers = "From: $email";

    $sent = mail($to, $subject, $message, $headers) ;
    if($sent)
    {print "Your mail was sent successfully"; }
    else
    {print "We encountered an error sending your mail"; }
    ?>
    I was planning to add validation if it worked but I'm missing something obvious here, I'm prepared to take it like a man and accept being laughed at. Also, ignore the silly ID tags because they're going to be renamed, alongside the text on the website - I was lazy when copying the template.

    http://secure5.mylha.com/~tazyagfk/contact.php
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  22. Post #2462
    Sharpshooter's Avatar
    April 2007
    1,230 Posts
    I got the 'mail was sent successfully' when I tested it on the page, is that right?


    I have this code snippet from a project I am working on, you could try this if you wanted to see if it worked, although I can't say any glaringly obvious differences with yours beyond the verification that the email was sent.
       $subject = "MarketFortress.com Account Activation Email";
            $message = "Howdy " . $username . "! \r\n\n To activate your account click the link below. \r\n\n http://localhost/tf2m/verify_email.php?email=" . $email . "&activation_pin=" . $activation_pin . "\r\n\n Cheers Mate! \r\n Market Fortress Administration Team.";
            $headers = "From:youremail" . "\r\n" . "Reply-To:youremail" . "\r\n" . "X-Mailer: PHP/" . phpversion();
            
            mail($email, $subject, $message, $headers);
    
    
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  23. Post #2463
    Airport Dweller
    Slater's Avatar
    October 2005
    1,201 Posts
    Yeah the validation is fake right now, I wanted to get the functionality right before fixing that.

    I'll have a look at your code at some point tomorrow, but it could be to do with my e-mail host deeming it as spam, or something similar. I don't exactly know. I appreciate you taking the time to help.

    Having said that, there is nothing in my spam mail inbox. Is it even possible to send an e-mail without having a from address? As in, can you receive an e-mail if no address sends it?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  24. Post #2464
    SteamDB
    Marlamin's Avatar
    November 2007
    10,960 Posts
    Yeah the validation is fake right now, I wanted to get the functionality right before fixing that.

    I'll have a look at your code at some point tomorrow, but it could be to do with my e-mail host deeming it as spam, or something similar. I don't exactly know. I appreciate you taking the time to help.

    Having said that, there is nothing in my spam mail inbox. Is it even possible to send an e-mail without having a from address? As in, can you receive an e-mail if no address sends it?
    My mail() didn't function properly either anyways, had to change php.ini to point to the smtp client I'm using on my box. If this is a simple webhosting box it should have it configured out of the box, if you manage/set it up yourself you might need to change some things.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  25. Post #2465
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,692 Posts
    Setting up mail to work on a VPS/dedi is a fucking pain in the arse, so if you're doing that - good luck.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Disagree Disagree x 2 (list)

  26. Post #2466
    Airport Dweller
    Slater's Avatar
    October 2005
    1,201 Posts
    I have simple hosting from LithiumHosting, I could get in touch with them and see what they say.

    Edited:
    Scratch that, my e-mails are from 123-reg.co.uk. I'll annoy those guys instead :D
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  27. Post #2467
    zhed+redball.jpg
    xmariusx's Avatar
    May 2010
    1,447 Posts
    Could anyone help me out over here?
    http://jsfiddle.net/2Ehtv/
    Got some JS problems, and I can't figure out why it isn't working.

    Why won't the button make the box display:none; ?
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  28. Post #2468
    lkymky's Avatar
    December 2007
    653 Posts
    Could anyone help me out over here?
    http://jsfiddle.net/2Ehtv/
    Got some JS problems, and I can't figure out why it isn't working.

    Why won't the button make the box display:none; ?
    go with jQuery and do the whole show/hide thing...
    http://www.w3schools.com/jquery/jquery_effects.asp

    You will probably end up using jQuery for other stuff on your website anyways so might as well implement it now...
    Reply With Quote Edit / Delete Windows XP United States Show Events

  29. Post #2469
    Gold Member
    antid2's Avatar
    August 2008
    640 Posts
    Could anyone help me out over here?
    http://jsfiddle.net/2Ehtv/
    Got some JS problems, and I can't figure out why it isn't working.

    Why won't the button make the box display:none; ?
    like above said, jquery would be much more simple.
    http://jsfiddle.net/rbZqu/
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  30. Post #2470
    jung3o's Avatar
    October 2011
    2,166 Posts
    what the fuck are you guys teaching him?

    http://jsfiddle.net/HDUfk/
    Not sure if this is the best way for js.

    Edited:

    http://jsfiddle.net/HDUfk/1/
    shorter version.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  31. Post #2471
    Gold Member
    TH3_L33T's Avatar
    June 2006
    1,372 Posts
    So I am looking for some kind of tutorial that will teach me how to make an installer for a database and tables. Like how WHMCS has it where you just place the files in and than it allows you to do everything automatically pretty much just enter the database name username and password and it can auto create all the tables and add in a pre-done user to make it so there is an already made account that the user can enter to control stuff.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  32. Post #2472
    Gold Member
    antid2's Avatar
    August 2008
    640 Posts
    think you're talking about a SQL query my friend :P
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  33. Post #2473
    Gold Member
    TH3_L33T's Avatar
    June 2006
    1,372 Posts
    think you're talking about a SQL query my friend :P
    Yeah but like what are these commands and stuff, is there any tutorials that show you how to create tables nicely and orderly?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  34. Post #2474
    zhed+redball.jpg
    xmariusx's Avatar
    May 2010
    1,447 Posts
    Thanks :)
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  35. Post #2475

    February 2012
    135 Posts
    This maybe doesn't fit here but i rather post here then make a new thread for this. Maybe I'm late but can't be arsed to lurk around everywhere and try to find this.

    http://vimeo.com/44203213#

    The real question is: how many of you are familiar with this?
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  36. Post #2476
    Gold Member
    Sir Whoopsalot's Avatar
    August 2010
    23,104 Posts
    This maybe doesn't fit here but i rather post here then make a new thread for this. Maybe I'm late but can't be arsed to lurk around everywhere and try to find this.

    http://vimeo.com/44203213#

    The real question is: how many of you are familiar with this?
    Please don't tell me people actually get astounded at payment questions.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  37. Post #2477
    gunguy765's Avatar
    April 2010
    1,848 Posts
    I should of made this post it's own thread but whatever. I have no knowledge and experience developing a website and my dad wants me to build one for a business. It's a lacrosse warehouse store/manufacturer in case you're wondering. I already have a domain name and the web hosting, but I need help to get all the resources I need. I want to know what program to use for coding CSS/HTML, the rest I look up and find someone to help (It will be nice if someone here can). I can't think of anything else, I know I have to design and layout the site, but first I need to learn to code.

    Can you help me get started?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  38. Post #2478
    jung3o's Avatar
    October 2011
    2,166 Posts
    I should of made this post it's own thread but whatever. I have no knowledge and experience developing a website and my dad wants me to build one for a business. It's a lacrosse warehouse store/manufacturer in case you're wondering. I already have a domain name and the web hosting, but I need help to get all the resources I need. I want to know what program to use for coding CSS/HTML, the rest I look up and find someone to help (It will be nice if someone here can). I can't think of anything else, I know I have to design and layout the site, but first I need to learn to code.

    Can you help me get started?
    and for program to code in, it doesn't really matter. http://notepad-plus-plus.org/ or http://www.sublimetext.com/ (sorry these are the only two that really pops up in my head )
    but before you really start on something. What kind of E-Commerce applications you want to use on your website.

    I guess you can google it, or wait for a fp'er to recommend one for you.

    Start from there and if you want it easy, just a template online that goes along with the theme of your website. if you can't find one you're either going to hire someone or learn html and css yourself. if you do have to do that, then goto http://htmldog.com/ and learn it there. You are going to need around 1 month ~ 3 months to really create a template (but it probably won't be good). If you want, you can first create a mock up on photoshop or anything and show it to fp WAYWO and we will give some feedback on what you should work on. or maybe Tera can make mock ups for you
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  39. Post #2479
    CarLuver69's Avatar
    August 2012
    185 Posts
    Is there a way JavaScript or even something inside the PayPal button generation that allows you to create multiple fields but the final result is item1, item2, item3 when being submitted? Reason I ask is because I want users to be able to enter their IMEI# in one field, have a dropdown for apple 3G - 4S in another, and then of course a carrier field. Upon clicking submit, in theory, the JavaScript code would then combine everything taken from each field, compile it into a single line, and THEN submit it to the paypal servers.

    Is this possible? Do I need JavaScript or does PayPal's button generation allow you to do something similar? Would PHP be better, etc.? Thanks.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  40. Post #2480
    Dragon Member
    Dragory's Avatar
    January 2006
    1,312 Posts
    Is there a way JavaScript or even something inside the PayPal button generation that allows you to create multiple fields but the final result is item1, item2, item3 when being submitted? Reason I ask is because I want users to be able to enter their IMEI# in one field, have a dropdown for apple 3G - 4S in another, and then of course a carrier field. Upon clicking submit, in theory, the JavaScript code would then combine everything taken from each field, compile it into a single line, and THEN submit it to the paypal servers.

    Is this possible? Do I need JavaScript or does PayPal's button generation allow you to do something similar? Would PHP be better, etc.? Thanks.
    Have a look here: https://www.paypal.com/cgi-bin/websc...ndard-overview
    Choose "Create one now" under "Sell single items". The following page should have options for a dropdown menu and a text field which you can include with your payment button (and I guess you can use e.g. a text field and make it hidden on the real page, then insert the information with JS there).
    Reply With Quote Edit / Delete Windows 7 Finland Show Events