• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
[QUOTE=SammySung;42709213]Can anyone point me in the right direction? I need to create a user registration/login system using XML to store the data. Single file, not one file per user.[/QUOTE]
Is there any place that explains how to make a attractive navigation bar for a website?
[QUOTE=jung3o;42709122]Can you check in a console using firebug (seeing you use firefox) why it's not loading? usually there's an error for those kind of stuff that shows up.[/QUOTE] If I did it right this was in the Firebug console: [code] ReferenceError: $ is not defined $(document).ready(function(){ [/code] [QUOTE=gokiyono;42709162]What happens if you change the 'slow' to 10000?[/QUOTE] That didn't change anything. :/
Hey how can I search through an XML file for something specific? My XML file has "Customers" which have username and password elements. I need to check if a user exists when registering to ensure there are no duplicates. PHP
[QUOTE=SammySung;42720360]Hey how can I search through an XML file for something specific? My XML file has "Customers" which have username and password elements. I need to check if a user exists when registering to ensure there are no duplicates.[/QUOTE] Can't you just use CTRL+F in your editor and use the next and prev buttons to check if there is multiple encounters of the specified word/name? - I don't know if that's what you do with XML but seems like a global way of finding stuff
[QUOTE=Moofy;42720425]Can't you just use CTRL+F in your editor and use the next and prev buttons to check if there is multiple encounters of the specified word/name? - I don't know if that's what you do with XML but seems like a global way of finding stuff[/QUOTE] I meant with PHP
[QUOTE=Moofy;42720066]If I did it right this was in the Firebug console: [code] ReferenceError: $ is not defined $(document).ready(function(){ [/code] That didn't change anything. :/[/QUOTE] That reference error hints that you are not using JQuery.
[QUOTE=MuffinZerg;42720553]That reference error hints that you are not using JQuery.[/QUOTE] Yea but doing as [B]KmartSqrl[/B] told me by using this exact thing: [code]<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>[/code] [QUOTE=KmartSqrl;42702258]No, just use //[/QUOTE] [editline]1st November 2013[/editline] But it does indeed work with either [B]http://[/B] or [B]https://[/B] - but when I got told it should work with just [B]//[/B] and it doesn't is really weird.
[QUOTE=SammySung;42720360]Hey how can I search through an XML file for something specific? My XML file has "Customers" which have username and password elements. I need to check if a user exists when registering to ensure there are no duplicates. PHP[/QUOTE] May I ask why exactly you are using XML to do this
[IMG]http://i.imgur.com/4MwbA89.png[/IMG] Could Anyone Tell me why this happens on Facepunch is it because of my resolution.
[QUOTE=Shadow801;42720870]May I ask why exactly you are using XML to do this[/QUOTE] Uni assignment, wasn't my choice.
[QUOTE=Moofy;42720593]Yea but doing as [B]KmartSqrl[/B] told me by using this exact thing: [code]<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>[/code] [editline]1st November 2013[/editline] But it does indeed work with either [B]http://[/B] or [B]https://[/B] - but when I got told it should work with just [B]//[/B] and it doesn't is really weird.[/QUOTE] [QUOTE=KmartSqrl;42713251]That should only happen if you're viewing an html file directly on your HD instead of through a local webserver because then it will try to pull it down from the google CDN with the file: protocol, which won't work. I think you should always be working through a local webserver anyways though because I've run in to weird issues viewing files directly in the past.[/QUOTE]
-snip, didn't refresh-
Go home IE, you're drunk. [QUOTE=ToXIcGaming;42721101][IMG]http://i.imgur.com/4MwbA89.png[/IMG] Could Anyone Tell me why this happens on Facepunch is it because of my resolution.[/QUOTE]
[QUOTE=Moofy;42720593]Yea but doing as [B]KmartSqrl[/B] told me by using this exact thing: [code]<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>[/code] [editline]1st November 2013[/editline] But it does indeed work with either [B]http://[/B] or [B]https://[/B] - but when I got told it should work with just [B]//[/B] and it doesn't is really weird.[/QUOTE] Apparantly it's because you are using a .html file which you are running from your desktop. You need to use a local (or external) webserver, I personally use [URL="http://www.apachefriends.org/en/xampp.html"]xampp [/URL]and it works when I start it from there, and not when I start it from my desktop.
[QUOTE=eternalflamez;42721966]Apparantly it's because you are using a .html file which you are running from your desktop. You need to use a local (or external) webserver, I personally use [URL="http://www.apachefriends.org/en/xampp.html"]xampp [/URL]and it works when I start it from there, and not when I start it from my desktop.[/QUOTE] Yea I just realised that after jung3o quoted KmartSqrl. Thanks!
[QUOTE=ToXIcGaming;42721101][IMG]http://i.imgur.com/4MwbA89.png[/IMG] Could Anyone Tell me why this happens on Facepunch is it because of my resolution.[/QUOTE] Someone forgot to put a float:left; or display: inline-block; on #bottom_box. If you have stylish you can add it there
[QUOTE=rymn;42721905]Go home IE, you're drunk.[/QUOTE] nah its Firefox and Thanks gokiyono i do have stylish and it is now fixed. :)
[QUOTE=xianlee;42710034]Has anyone used this? [url]http://www.google.co.uk/webdesigner/[/url] Any good for mobile sites?[/QUOTE] Pretty rubbish, not at all good for something serious-ish.
[QUOTE=SammySung;42720360]Hey how can I search through an XML file for something specific? My XML file has "Customers" which have username and password elements. I need to check if a user exists when registering to ensure there are no duplicates. PHP[/QUOTE] I'd probably use an XML parser that supports XPath. This is off the top of my head, so it probably won't work totally properly, but will get you on the right track: Say you have this xml: [code] <customers> <customer> <username>Ted</username> <password>anfwafl</password> </customer> <customer> <username>Benny</username> <password>anfwafl</password> </customer> </customers> [/code] You should be able to use this XPath to get all usernames with the text value Ted (the way you run this xpath query will depend on which XML parser you are using): [code] //username[text()='Ted'] [/code] Alternatively, you can just parse the file and loop through all the customers and check their username, but you'll have to write more code to do that.
Well, this is quite irritating. Today, in Fuckups Only PDO Has: I have a somewhat-complicated query to get two things from two tables. LEFT OUTER JOIN with the second, blah blah blah. But, for some reason, it insists on failing [B]a simple bound parameter.[/B] Not some part about operands or something... Nah, a parameter. [CODE] "SELECT u.`coins`, u.`PlayerModel`, u.`Popcorn`, u.`Tag`, u.`VIP`, l.`json` FROM `userinfo` u LEFT OUTER JOIN `log` l ON u.`UniqueID` = CRC32(:concat_s) AND l.LogType = 1 AND l.json LIKE '".'{"Msg":"!title%'." [B]AND l.steamID = :steamid[/B] WHERE u.UniqueID = CRC32(:concat_s) ORDER BY l.id DESC LIMIT 1" [/CODE] (:steamid is a basic Steam ID (duh) and :concat_s is the steamid with gm_..._gm added, since MySQL is a lazy fuck that threw me errors previously when using CONCAT(). ) The error (line in bold) is: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STEAM_0:0:99999999' WHERE u.Un' at line 13 It works with HeidiSQL, tho. [editline]2nd November 2013[/editline] What the hell, the Edit Post field is now empty. I can't edit my own messages...? Ah well, anyways, wanted to remove the (line in bold) above the error. TIL Code tags don't let you highlight things.
why do none of my links actually do anything? [URL="http://almost-there.org/new/fridge.php"]http://almost-there.org/new/fridge.php[/URL]
In your [url]http://almost-there.org/new/scr/animations.jquery.js[/url], lines 20-23: [code] $(document).not('#settingsMenu, #settingsButton').click(function(event) { event.preventDefault(); if (settingsMenu.is(":visible")) { settingsMenu.slideUp(100); } });[/code] This resets all click events, including the ones of your <a> tags. You'll probably just need to add "a" in between, so that the first line is [code]$(document).not('#settingsMenu, #settingsButton, a').click(function(event) {[/code] That's what I think anyway, can't test that now.
snip, too slow
[QUOTE=eternalflamez;42736456]In your [url]http://almost-there.org/new/scr/animations.jquery.js[/url], lines 20-23: [code] $(document).not('#settingsMenu, #settingsButton').click(function(event) { event.preventDefault(); if (settingsMenu.is(":visible")) { settingsMenu.slideUp(100); } });[/code] This resets all click events, including the ones of your <a> tags. You'll probably just need to add "a" in between, so that the first line is [code]$(document).not('#settingsMenu, #settingsButton, a').click(function(event) {[/code] That's what I think anyway, can't test that now.[/QUOTE] I am terrible at JS and still learning, thanks for showing me that. I rewrote the function to this [code] $("#settingsButton").click(function() { $("#settingsMenu").toggleClass( "hover" ); $("#settingsMenu").slideToggle( 250 ); }); [/code]
-snip-
How do forum softwares usually track whether or not a user has seen a thread? (Like, what would be the best way of doing it?)
[QUOTE=AndrewPH;42741088]How do forum softwares usually track whether or not a user has seen a thread? (Like, what would be the best way of doing it?)[/QUOTE] DB table `seen_threads` with thread_id, user_id, timestamp
So I still can't edit my posts... Welp. Anyways, I fixed my problem, for future googlers: I forgot something as simple as a single quote after the {"Msg" thing, so it was thinking the parameter included the rest of the SQL query until the next variable (and its single-quotes).
Can anyone point me in the right direction on how to troubleshoot my webserver not responding after being in use, and needing Apache to be restarted? httpd doesn't crash, I'm unsure of what's going on.
Sorry, you need to Log In to post a reply to this thread.