• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
Where can I find a good guide on PHP? Written or video, either works for me. Thanks in advance.
[QUOTE=McDunkable;42557335]Where can I find a good guide on PHP? Written or video, either works for me. Thanks in advance.[/QUOTE] [URL]http://www.w3schools.com/php/[/URL] [editline]17th October 2013[/editline] I have a question too! How do I stop a user form submitting a form more than once? It's for a contest and I want to make sure each entrant only enters the contest once. Right now I check the email against the database and revoke people with the same email and I also log IPs in long form to a table. I could also use a cookie, but people can easily turn off cookies. In fact, all of these methods have workarounds. So I'm wondering, is there any 100% satisfaction-guaranteed way of stopping a user from entering the same contest twice?
Probably not. There always is a workaround. For example, look at facepunch. Even with the registration being invite only, permabanned users still found their way back in.
[QUOTE=Poo Monst3r;42557923][URL]http://www.w3schools.com/php/[/URL] [editline]17th October 2013[/editline] I have a question too! How do I stop a user form submitting a form more than once? It's for a contest and I want to make sure each entrant only enters the contest once. Right now I check the email against the database and revoke people with the same email and I also log IPs in long form to a table. I could also use a cookie, but people can easily turn off cookies. In fact, all of these methods have workarounds. So I'm wondering, is there any 100% satisfaction-guaranteed way of stopping a user from entering the same contest twice?[/QUOTE] When it comes to security there are not really any 100%'s I would say sessions and cookies, and the database check. (Also I think some of the $_SERVER values can help)
[QUOTE=Poo Monst3r;42557923][URL]http://www.w3schools.com/php/[/URL] [/QUOTE] [url]http://www.w3fools.com/[/url]
[QUOTE=Goz3rr;42558773][url]http://www.w3fools.com/[/url][/QUOTE] No examples?
[QUOTE=gokiyono;42562136]No examples?[/QUOTE] There used to be but w3schools used w3fools to correct all the problems, w3fools then decided to stop doing the editing work for them and stopped posting the problems. I'm sure there are a load of new problems now.
[QUOTE=CBastard;42562159]There used to be but w3schools used w3fools to correct all the problems, w3fools then decided to stop doing the editing work for them and stopped posting the problems. I'm sure there are a load of new problems now.[/QUOTE] It just sounds stupid to say not to use something without saying why not to use said service.
Any good guides out there to make a music bar wave visualization using CSS and JS?
[QUOTE=eternalflamez;42558354]Probably not. There always is a workaround. For example, look at facepunch. Even with the registration being invite only, permabanned users still find their way back in.[/QUOTE] FP stopped being invite only months ago...
[QUOTE=Cowabanga;42566934]FP stopped being invite only months ago...[/QUOTE] Didn't notice, but I guess you're right. My point still stands though.
does it matter if you use <div class="footer"></div> or <footer></footer> over the other? or is it just whats better practice
[QUOTE=Goz3rr;42558773][url]http://www.w3fools.com/[/url][/QUOTE] its still a useful source of information you sheep
[QUOTE=McDunkable;42557335]Where can I find a good guide on PHP? Written or video, either works for me. Thanks in advance.[/QUOTE] [url]http://www.codecademy.com/tracks/php[/url] [url]http://php.net[/url] (I learned rest of my php from here after i learned some basics from an outdated site called tizag) maybe you can look around and click on articles that might interest you. [url]https://tutsplus.com/tutorials/?q=true&filter_topic=41[/url] [url]https://tutsplus.com/courses/?q=true&filter_topic=41[/url]
I'm new to PHP and am attempting to make a ban page for Exsto. I'm stuck on the time bits. I can't figure out how to get the time until unban. This is what I have, but it doesn't give the correct time until unban. $row["BannedAt"] is time in seconds and $row["Length"] is time in minutes. [code]function seconds_to_time($secs) { $dt = new DateTime('@' . ($secs * 60), new DateTimeZone('UTC')); return array('days' => $dt->format('z'), 'hours' => $dt->format('G'), 'minutes' => $dt->format('i'), 'seconds' => $dt->format('s')); } <? $timearray = seconds_to_time(($row["BannedAt"]/60) + ($row["Length"]) - time()); $banendtime = $timearray["days"] . "d " . $timearray["hours"] . "h " . $timearray["minutes"] . "m"; if ($row["Length"] <= 0) $banendtime = "Never"; if ($banendtime <= 0) $banendtime = "Unbanned"; echo $banendtime; ?>[/code] Thanks.
seconds_to_time(($row["BannedAt"]/60) + ($row["Length"]) - time()) Isn't that backwards? seconds_to_time(time() - (intval($row["BannedAt"]) + intval($row["Length"]) * 60)) Seeing as time() is the UNIX timestamp in seconds you should be keeping BannedAt as a timestamp (not converting it to seconds), and then converting Length from minutes to seconds.
[QUOTE=:0;42569300]does it matter if you use <div class="footer"></div> or <footer></footer> over the other? or is it just whats better practice[/QUOTE] I think it is better to use the <footer> tag since it was added to do that.
seems kinda extraneous and silly to use special new tags for something so simple
[QUOTE=Kwaq;42574338]seems kinda extraneous and silly to use special new tags for something so simple[/QUOTE] Not really. Screen readers likes them. And, if it is a new web standard, then you should probably use it. And, I personally think it makes it easier to read.
[QUOTE=Kwaq;42574338]seems kinda extraneous and silly to use special new tags for something so simple[/QUOTE] No it doesn't. HTML is a markup language that is supposed to semantically describe the content it is marking up. Adding new elements to make the markup you produce more semantically rich/correct makes perfect sense. [editline]19th October 2013[/editline] [QUOTE=Kwaq;42569493]its still a useful source of information you sheep[/QUOTE] I don't think I would call a website that has a long history of having blatantly false information on it a good source of information. Not to mention the whole shady thing where they offer meaningless certifications that are obviously supposed to trick people into thinking they are getting a cert from the w3c.
[url]http://jsfiddle.net/jKsFt/[/url] why is nothing printing... is it because i need to be using window.onload? Also, one other small issue: [code] // This is in the html document <div id="totalCost">Total cost: $0.00</div> // This is in an external javascript function validateInput() { var elements = ["book1", "book2", "book3"]; var prices = [19.99, 86.0, 55.0]; var cost = 0.0; for (var i = 0; i < 3; i++) { var value = document.forms["frm"][elements[i]].value; if (value == null || value == "" || isNaN(parseFloat(value)) ) { alert("Missing/invalid input data in 1 or more fields."); return false; } cost += (parseFloat(value) * prices[i]); } document.getElementById("totalCost").innerHTML = "Total cost: $" + cost; }[/code] The above code seems to work, but as soon as i click the button that calls that function, it will update my html label but then in the next frame, the document reverts back to normal (and therefore erases my changes to the html element). Is there a way around this?
[QUOTE=Banana Lord.;42573569]seconds_to_time(($row["BannedAt"]/60) + ($row["Length"]) - time()) Isn't that backwards? seconds_to_time(time() - (intval($row["BannedAt"]) + intval($row["Length"]) * 60)) Seeing as time() is the UNIX timestamp in seconds you should be keeping BannedAt as a timestamp (not converting it to seconds), and then converting Length from minutes to seconds.[/QUOTE] No, because my seconds_to_time function multiplies $secs by 60 so I can convert $row["Length"] to seconds. Though your misreading of the function caused me to see my error, so it's working perfectly now! Thanks.
[url]http://jsfiddle.net/Yyq53/1/[/url] when the line draws all the way from left to right, the canvas should reset. why doesn't it?
[QUOTE=incognitocob;42579514]No, because my seconds_to_time function multiplies $secs by 60 so I can convert $row["Length"] to seconds. Though your misreading of the function caused me to see my error, so it's working perfectly now! Thanks.[/QUOTE] Glad I could help :v:
[url]http://jsfiddle.net/Yb76p/[/url] CSS question: What do I do to my list so that the sub-list elements display up and down instead of left to right. Instructions: open link, scroll way over to the right in the "result" area, mouse over the 0. I want it to be 1 2 3 instead of 123
[QUOTE=01271;42592507][url]http://jsfiddle.net/Yb76p/[/url] CSS question: What do I do to my list so that the sub-list elements display up and down instead of left to right. Instructions: open link, scroll way over to the right in the "result" area, mouse over the 0. I want it to be 1 2 3 instead of 123[/QUOTE] This is because your '#banner-menu ul li' rule also floats them. You will either have to make that rule more specific or override it for deeper lists
[QUOTE=McDunkable;42557335]Where can I find a good guide on PHP? Written or video, either works for me. Thanks in advance.[/QUOTE] [URL="http://php.net/manual"]Le' Manual[/URL]
[QUOTE=01271;42592507][url]http://jsfiddle.net/Yb76p/[/url] CSS question: What do I do to my list so that the sub-list elements display up and down instead of left to right. Instructions: open link, scroll way over to the right in the "result" area, mouse over the 0. I want it to be 1 2 3 instead of 123[/QUOTE] your reason: float:left usual reason: display:inline makes them go from horizontally; display:block makes them go vertically edit: did i really put a semicolon there
Ok I added clear:both; and it fixed it. Normally it works but it's contained in the banner so it inherited the float:left attribute.
Hey, I'm not so great with web development at all. I'm doing a basic website with dreamweaver and we've probably been given all the non-optimal ways to do things, but we have to for the course we're doing at AS level for the sake of time. Anyway, my question is about jump menus in dreamweaver - is it possible to like, recolor them at all? [t]http://i.imgur.com/Ng3RvwR.png[/t] As you can see my page is going with kind of a red color scheme and yet the menus have a little blue dropdown button and highlight color. As a complete newbie to this, how would I change them to something that fits more with my website - like a red or gray color? This is the first thing I've ever done related to web development at all, like, ever, so excuse the 1990's style I've managed to achieve. Thanks for any advice, guys.
Sorry, you need to Log In to post a reply to this thread.