• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
Using PHP, using simpleOpenID library, using steam as an auth server, how do I change my login from GET to POST? It's quite the annoyance. I'm hoping that someone here had the same problem and fixed it for themselves.
[QUOTE=01271;41141299]Using PHP, using simpleOpenID library, using steam as an auth server, how do I change my login from GET to POST? It's quite the annoyance. I'm hoping that someone here had the same problem and fixed it for themselves.[/QUOTE] I have never tried simpleOpenID, but I would assume you should just rename all GET to POST... (Most programs give you the super ctrl+f to use)
[QUOTE=B-Rabbit;41111716]Yes. Any .tk site can't be send in a message on Facebook at least in my case.[/QUOTE] I know .tk is normally associated with spam, but isn't that a bit discriminative of Facebook to block .tk domains? .tk is actually the cTLD for Tokelau.
[QUOTE=benbb;41144155]I know .tk is normally associated with spam, but isn't that a bit discriminative of Facebook to block .tk domains? .tk is actually the cTLD for Tokelau.[/QUOTE] Considering you could probably easily make something damaging for free, no.
Not really sure if this belongs in the Programming forum (it deals with Java), or this forum (it deals with embedding Applets), so I finally decided to post it here: Out of curiosity, do any of you know a good place where I can host a Java JAR online, and use it for an Applet? My goal is to make a simple Java applet (I am using the "tic-tac-toe" example Oracle provides for testing), with all of its content contained in a single Jar, and then be able to embed the Applet in an HTML environment, like Tumblr for example. However, I don't have a web server of my own, and I have no FTP or file-server access (again, think Tumblr). I have tested hosting the Jar on my Dropbox, and on Filesmelt, and then linking the Applet to the uploaded Jar. The Dropbox linking works fine, but the Filesmelt linking gives me errors saying it can't find the class it wants (implying it's not loading the Jar at all). The Dropbox solution won't really work, though, because of Dropbox's low bandwidth restrictions. Does anyone have any suggestions of alternatives to using Dropbox or spending money on my own web server? Oh, and if I can help it, I would prefer using an online file-hosting service as opposed to borrowing a private user's web-space, before anyone offers. I feel awkward borrowing someone else's space for my own personal projects.
I want to mongodb update some documents, what is the format for updating certain parts of them but not others? here's a pseudo document: SteamID: 16895651839 S_API_Info: *steam api info* first_added_to_db: *UNIX date* last_updated: *UNIX date* other_info: ** updating the document where SteamID = 16895651839 How would I update everything except the steamID and first_added_to_db entries? How do I make it so that the db entry for first_added_to_db is only added once (when it's originally added)?
Another database question; how would I retrieve rows from multiple tables matching one column value? [code] SELECT data FROM table1 WHERE class='permit' UNION SELECT data FROM table2 WHERE class='permit' UNION SELECT data FROM table3 WHERE class='permit' [/code] The above gives me the results I want in roughly 0.0067 seconds but I feel could become performance expensive during production use or with more rows taken into account. I am currently messing around with JOIN hoping to find some other alternative...
Is there any specific reason why the magic methods __get and __set can't be declared with anything but the public visibility? I want to do something like this: [code] private function __set($property, $value) { $_SESSION[$property] = $value; } public function __get($property) { if (isset($_SESSION[$property])) { return $_SESSION[$property]; } } [/code] So that I can read and write the properties naturally within the class body, but they can only be read from outside of it.
[QUOTE=Epiclulz762;41159880]Another database question; how would I retrieve rows from multiple tables matching one column value? [code] SELECT data FROM table1 WHERE class='permit' UNION SELECT data FROM table2 WHERE class='permit' UNION SELECT data FROM table3 WHERE class='permit' [/code] The above gives me the results I want in roughly 0.0067 seconds but I feel could become performance expensive during production use or with more rows taken into account. I am currently messing around with JOIN hoping to find some other alternative...[/QUOTE] You could try: [CODE] SELECT table1.data, table2.data, table3.data FROM table1 LEFT JOIN table2 ON table1.class = table2.class LEFT JOIN table3 ON table1.class = table3.class WHERE table1.class = 'permit' [/CODE] But I doubt it will be any faster
I suppose this question doesn't really need its own thread. So i took a web design class where i learned HTML, CSS, and some JavaScript. We mainly worked with notepad and Dreamweaver. Very basic stuff. Now i wish to expand my web design abilities past the classes end. I want to be able to work on my own projects, like the ones i see all over facepunch. I've found a multitude of sources for myself to learn from, so information isn't the issue. The issue is: what IDE should i use (just notepad++ or something more?) and what "framework" (which i'm not really sure what is) do i use? I've been reading about Yeoman and it seems really interesting, but i have no idea what to install it to, or how to work with it, even though i've read the wiki and guides. There seems to be a gap between the information i know and the information that lets me expand my work. Another thing i don't understand is what is Foundation? And Bootstrap or something like that? Sorry if i come off as a complete retard, i've really been reading about these things, and i understand somewhat a framework is.
Work from scratch and try to approach fundamental issues; I discover solutions that I know will help myself in the long run, something that a template or framework may not expose me to. Learning Assembly to understand C or Java may be an exaggeration of this advice.
[QUOTE=RCRad;41174051] Another thing i don't understand is what is Foundation? And Bootstrap or something like that?[/QUOTE] CSS frameworks. Basically, instead of having to do a .buttonclass{rounded-borders,height,width,colours,gradients,onhover} and all that stuff you just use its own classes, like .btn .
[QUOTE=Coment;41177169]CSS frameworks. Basically, instead of having to do a .buttonclass{rounded-borders,height,width,colours,gradients,onhover} and all that stuff you just use its own classes, like .btn .[/QUOTE] I think at it's core the most important thing is really the layout frameworks with Bootstrap. Although the components and base CSS is very useful and well made. Also, if you're using LESS the mixins are very useful as well
[QUOTE=RCRad;41174051]I suppose this question doesn't really need its own thread. So i took a web design class where i learned HTML, CSS, and some JavaScript. We mainly worked with notepad and Dreamweaver. Very basic stuff. Now i wish to expand my web design abilities past the classes end. I want to be able to work on my own projects, like the ones i see all over facepunch. I've found a multitude of sources for myself to learn from, so information isn't the issue. The issue is: what IDE should i use (just notepad++ or something more?) and what "framework" (which i'm not really sure what is) do i use? I've been reading about Yeoman and it seems really interesting, but i have no idea what to install it to, or how to work with it, even though i've read the wiki and guides. There seems to be a gap between the information i know and the information that lets me expand my work. Another thing i don't understand is what is Foundation? And Bootstrap or something like that? Sorry if i come off as a complete retard, i've really been reading about these things, and i understand somewhat a framework is.[/QUOTE] First of all, Dreamweaver is bad practice. Also, I like to use Sublime Text. Sublime Text 3 is currently in beta and only for people who bought, but I really like how they improved upon their HTML automatic closing etc. - Sublime text also works for other languages.
[QUOTE=Killervalon;41180359][b]First of all, Dreamweaver is bad practice.[/b] Also, I like to use Sublime Text. Sublime Text 3 is currently in beta and only for people who bought, but I really like how they improved upon their HTML automatic closing etc. - Sublime text also works for other languages.[/QUOTE] I love this. It's quite funny really, don't get me wrong I hate Dreamweaver with a passion, but to suggest it's bad practice is a bit silly really. At the end of the day it's still the same code, wherever you type it from Notepad to DW, so it's hardly bad practice. Sublime Text 2 and other IDEs are simply just easier to use with tools that encourage better practice, but my code is just as good quality no matter what IDE I load it in. But don't get me wrong, if I could remove DW from existence I probably still would. Or I would rename it 'Adobe HTML Email Designer'.
Ive never heard anyone say they work with notepad. I dont understand why people use dreamweaver. It costs so much for just to be mainly used as a web developing IDE [editline]25th June 2013[/editline] I guess in school, sure. Its easier for teachers to explain with
[QUOTE=jung3o;41181046]Ive never heard anyone say they work with notepad. I dont understand why people use dreamweaver. It costs so much for just to be mainly used as a web developing IDE [editline]25th June 2013[/editline] I guess in school, sure. Its easier for teachers to explain with[/QUOTE] In school I was told to use tables though
it's been too long ago that i PHP'd so I forgot a whole bunch but I've always been actively using one of the login scripts I wrote. thanks to php 5.4.x it's broken and I have no idea how to fix it anymore. the login check redirects me back to the login page after entering correct credentials, and doesn't log me in. it does correctly send me back to the login page after entering [I]wrong[/I] credentials as well, though. here's the script: [php] include('config.php'); $username = $_POST['username']; $password = $_POST['password']; $msg = ''; if(isset($username, $password)) { session_start(); ob_start(); $un = stripslashes($username); $pw = stripslashes($password); $un = mysql_real_escape_string($un); $pw = mysql_real_escape_string($pw); $sql = "SELECT * FROM login WHERE username='$un' AND password=SHA('$pw')"; $result = mysql_query($sql); $poop = mysql_num_rows($result); if($poop==1) { session_register("admin"); session_register("password"); $_SESSION['name'] = $un; header("location:admin.php"); } else { $msg = "wrong username/password combination"; header("location:login.php?msg=$msg"); } ob_end_flush(); } else { header("location:login.php?msg=enter something u asshole"); } [/php] i used a "session_ fix script" to fix most of the other pages which looks like this [php] function fix_session_register(){ function session_register(){ $args = func_get_args(); foreach ($args as $key){ $_SESSION[$key]=$GLOBALS[$key]; } } function session_is_registered($key){ return isset($_SESSION[$key]); } function session_unregister($key){ unset($_SESSION[$key]); } } if (!function_exists('session_register')) fix_session_register(); [/php] but I'm gonna redo every page with [B]isset($_SESSION['admin'])[/B] anyway and get rid of the old session vars. I just have no idea how to fix my login script. can anyone help me?
Session_start should always be after <?php [editline]25th June 2013[/editline] why do you have ob_start? I dont see the point of it in that script
I have a problem, basically I'm making elements on my page fade as they're moving off screen and fade in as they are coming on screen. I've got this in the $(window).scroll() event handler, this of course means that every time I scroll it will stop the animation and call the function again. Anybody got any ideas or suggestions? [code] $(window).scroll(function () { updateTiles(); }); function updateTiles() { $('[class^="tile"]').each(function () { // <---loop the divs class starts with .tile var position = $(this).offset().top + $(this).height(); if ((position - $(window).scrollTop()) < 64) { //<---mark the $(this).offset().top of current object $(this).stop().fadeTo(1000, 0); //<----fadeOut the current obj } else if (($(this).offset().top - ($(window).scrollTop() + $(window).height())) > -64) { //<---mark the $(this).offset().top of current object $(this).stop().fadeTo(1000, 0); //<----fadeOut the current obj } else{ $(this).stop().fadeTo(1000, 1); //<----fadeIn the current obj } }); } [/code]
[QUOTE=01271;41154892]I want to mongodb update some documents, what is the format for updating certain parts of them but not others? here's a pseudo document: SteamID: 16895651839 S_API_Info: *steam api info* first_added_to_db: *UNIX date* last_updated: *UNIX date* other_info: ** updating the document where SteamID = 16895651839 How would I update everything except the steamID and first_added_to_db entries? How do I make it so that the db entry for first_added_to_db is only added once (when it's originally added)?[/QUOTE] Still can't solve this: Quick tl;dr: if document does not exist make the document with a FIRST ADDED TO DB DATE. if document does exist: Update the document except for the FIRST ADDED TO DB DATE. how do I do it with mongo.
[QUOTE=Loli;41182988]I have a problem, basically I'm making elements on my page fade as they're moving off screen and fade in as they are coming on screen. I've got this in the $(window).scroll() event handler, this of course means that every time I scroll it will stop the animation and call the function again. Anybody got any ideas or suggestions? [/QUOTE] Seems to be working with the below code, not sure I changed much though. -removed old code- Here's a fiddle [url]http://jsfiddle.net/andrewkhan1/N6Ctc/[/url] I think I'm probably missing the point, what's the problem? edit: I see, the animations are stopping while you scroll, I'll look into it edit: Done. [code] function updateTiles() { /* Loop through tiles */ $('[class^="tile"]').each(function () { var $this = $(this); var offset = $this.offset(); var position = offset.top + $this.height(); if ((position - $(window).scrollTop()) < 64) { if($(this).data("hidden") == false){ /* hide this tile if it is at the top of the screen */ $(this).stop().fadeTo(1000, 0); //<----fadeOut the current obj $(this).data("hidden", true); } } else if ((offset.top - ($(window).scrollTop() + $(window).height())) > -64) { if($(this).data("hidden") == false){ $(this).stop().fadeTo(1000, 0); //<----fadeOut the current obj $(this).data("hidden", true); } } else { if($(this).data("hidden") == true){ $(this).stop().fadeTo(1000, 1); //<----fadeOut the current obj $(this).data("hidden", false); } } }); } $(window).scroll(updateTiles); updateTiles(); [/code] HTML: [code] <div class="tile" data-hidden="false"></div> <div class="tile" data-hidden="false"></div> <div class="tile" data-hidden="false"></div> <div class="tile" data-hidden="false"></div> <div class="tile" data-hidden="false"></div> <div class="tile" data-hidden="false"></div> <div class="tile" data-hidden="false"></div> <div class="tile" data-hidden="false"></div> <div class="tile" data-hidden="false"></div> <div class="tile" data-hidden="false"></div> [/code] Not sure if it's the best practice to use data attributes to do it, but it works. You don't even have to put it in the markup just put [code]$(this).data("hidden", false);[/code] at the top of the each function
Hey guys, this is pretty important. So about a year ago, I put together a little website for a friend of my father, who runs a little side-business and needed a website for it. I looked around, and decided on using Lithium Hosting as the host, since they seemed to be the best choice. They've been working great. However, I just got this email forwarded to me by said friend (we had all the info go to his email, and if he had any questions about anything, he could ask me): [quote=Lithium]This is your final reminder, we will be reclaiming all Dedicated IP's by the end of the month if we do not receive a reply from you with Justification. If you already provided Justification since the last notice, please disregard this email. In response to the global shortage of IPv4 addresses, we have initiated a procedure to ensure IPv4 conservation and efficient utilization of this limited numbering resource. We are requiring all Dedicated IPs to be tied to a valid SSL certificate. If you have an IP and do not have a valid SSL certificate, we will be reclaiming your IP and cancelling billing on the IP by the end of your billing cycle (sooner if paid annually, a credit will be issued for the difference in time). If you have a valid SSL certificate or another reason for using SSL on your domain, please respond to this email to open a ticket and justify your IP usage. We will not be doing the verification, we do require a response from you if you wanto keep your Dedicated IP Address(es). Please don't ignore this message. Regards, Lithium Hosting Support[/quote] This was sent to him five days ago, and he only sent this email to me about an hour ago. What more, he hasn't sent me any of the previous notices. I've googled "SSL Certificates," and it looks like there's various sites for buying certificates? I know almost nothing about SSL certification, so I have no idea what I am doing here. Can someone please offer some insight on this issue?
[QUOTE=Gmod4ever;41191555]Hey guys, this is pretty important. So about a year ago, I put together a little website for a friend of my father, who runs a little side-business and needed a website for it. I looked around, and decided on using Lithium Hosting as the host, since they seemed to be the best choice. They've been working great. However, I just got this email forwarded to me by said friend (we had all the info go to his email, and if he had any questions about anything, he could ask me): This was sent to him five days ago, and he only sent this email to me about an hour ago. What more, he hasn't sent me any of the previous notices. I've googled "SSL Certificates," and it looks like there's various sites for buying certificates? I know almost nothing about SSL certification, so I have no idea what I am doing here. Can someone please offer some insight on this issue?[/QUOTE] I'm not that knowledgeable about this sort of thing, but this doesn't sound right to me. Why would SSL affect this at all? Or I'm missing something completely.
[QUOTE=Gmod4ever;41191555]Hey guys, this is pretty important. So about a year ago, I put together a little website for a friend of my father, who runs a little side-business and needed a website for it. I looked around, and decided on using Lithium Hosting as the host, since they seemed to be the best choice. They've been working great. However, I just got this email forwarded to me by said friend (we had all the info go to his email, and if he had any questions about anything, he could ask me): This was sent to him five days ago, and he only sent this email to me about an hour ago. What more, he hasn't sent me any of the previous notices. I've googled "SSL Certificates," and it looks like there's various sites for buying certificates? I know almost nothing about SSL certification, so I have no idea what I am doing here. Can someone please offer some insight on this issue?[/QUOTE] I presume he has a dedicated IP as an addon with Lithium then? If so, is there a valid reason why he has one, if not you'd be paying extra per month for nothing. If you do have one and you'd want an SSL, you can PM me and I can help you out if needed, it is pretty easy! [QUOTE=Shadow801;41193183]I'm not that knowledgeable about this sort of thing, but this doesn't sound right to me. Why would SSL affect this at all? Or I'm missing something completely.[/QUOTE] One of the main reasons people buy dedicated IP addresses (as an extra) is to use an SSL certificate.
[QUOTE=Snakess;41193185] One of the main reasons people buy dedicated IP addresses (as an extra) is to use an SSL certificate.[/QUOTE] That makes sense.
Maybe everyone will move to IPv6 soon :downs:
[QUOTE=RCRad;41174051]The issue is: what IDE should i use (just notepad++ or something more?) and what "framework" (which i'm not really sure what is) do i use? I've been reading about Yeoman and it seems really interesting, but i have no idea what to install it to, or how to work with it, even though i've read the wiki and guides. There seems to be a gap between the information i know and the information that lets me expand my work. Another thing i don't understand is what is Foundation? And Bootstrap or something like that?[/QUOTE] If you have access to Dreamweaver, keep using that for a while. Once you've built a few pages, use Notepad++ or Sublime Text 2 and open up all the files you've generated. Go through the code by hand, and try to reverse engineer the pages... figure out how the code affects what you see in the browser. Also, go to websites that you think are cool, view the page source, and reverse engineer their code. You can even copy/paste their pages down to duplicate what they are doing. The more you work with the raw code, the better you understand how it all works together to create the web user experience. For all your questions, Google is your friend: [URL="http://goo.gl/Wc4xK"]Learn how to build a website[/URL] [URL="http://goo.gl/gFKzV"]Learn how to code a website[/URL] [URL="http://goo.gl/uKGU4"]What is Twitter Bootstrap[/URL] [URL="http://goo.gl/By9kw"]What is Zurb Foundation[/URL] [editline]26th June 2013[/editline] [QUOTE=Gmod4ever;41191555]Hey guys, this is pretty important. So about a year ago, I put together a little website for a friend of my father, who runs a little side-business and needed a website for it. I looked around, and decided on using Lithium Hosting as the host, since they seemed to be the best choice. They've been working great. However, I just got this email forwarded to me by said friend (we had all the info go to his email, and if he had any questions about anything, he could ask me): This was sent to him five days ago, and he only sent this email to me about an hour ago. What more, he hasn't sent me any of the previous notices. I've googled "SSL Certificates," and it looks like there's various sites for buying certificates? I know almost nothing about SSL certification, so I have no idea what I am doing here. Can someone please offer some insight on this issue?[/QUOTE] Does the business take Credit cards, or process transactions, gather customer data or have a customer portal/members area? If yes, then you need an SSL certificate, and like Snakess said, you need a dedicated IP for an SSL certificate. Contact Lithium support, ask them to help you determine if the website needs to retain the IP or not.
[QUOTE=Rayjingstorm;41196020]Maybe everyone will move to IPv6 soon :downs:[/QUOTE] I wish the IPv6 switch would happen soon too, but it doesn't look like it will
[QUOTE=jung3o;41181715]Session_start should always be after <?php [editline]25th June 2013[/editline] why do you have ob_start? I dont see the point of it in that script[/QUOTE] that didn´t fix my problem, but i moved it regardless because you´re absolutely right.
Sorry, you need to Log In to post a reply to this thread.