• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
Well PHP is server side, unless you specifically need to store or access something on the server, you should use JavaScript as it'll be faster. Of course, login systems and databases stuff like that is where PHP comes in Also bare in mind Sublime Text 2 isn't free
[QUOTE=djjkxbox360;43859942]Also bare in mind Sublime Text 2 isn't free[/QUOTE] But you can get the trial version and use it indefinitely as long as you don't mind a notice every once and a while. I recommend purchasing it only if you can afford it. [b]ex:[/b] [url=http://www.awesomium.com/]Awesomium[/url] lets you use it for free so long as you make <$100,000 in revenue.
[QUOTE=djjkxbox360;43859942]Well PHP is server side, unless you specifically need to store or access something on the server, you should use JavaScript as it'll be faster. Of course, login systems and databases stuff like that is where PHP comes in Also bare in mind Sublime Text 2 isn't free[/QUOTE] Well it is free, sort of :D
[QUOTE=Kidd;43852736]I have never wanted to kill someone more over something as much as this but 2 hours later and I am nowhere. I'm trying to find text between html tags. The html is a string. The tags are <td></td> and all it returns is null. [code] var insultSite = 'http://www.insultgenerator.org/'; var result; var reg = /<td>([abc])<\/td>/g; $.get( insultSite, function( data ) { data = String( data ); result = data.match( reg ); document.write( result ); }); [/code] I tried lots of other things besides [abc]. That is just the last thing I tested. I'm new to all this by the way. [editline]9th February 2014[/editline] It does get me the html but after I try to do the match it just doesn't return what I want only null.[/QUOTE] [abc] matches one character that's either a, b, or c. What you probably want is /<TD>(.+?)</TD>/ig, which matches any character between the two <TD> tags.
How do I use unhex in a mysql string? For example [code] "insert into logevents (logid,event,operatorifapp, logdate) values (DEFAULT, 'New participant registered - UNHEX('$HexName') - ID: UNHEX('$HexOrgNo')', NULL, CURDATE());";[/code] But it doesn't work. [url]http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_unhex[/url]
[QUOTE=Kidd;43852736]I have never wanted to kill someone more over something as much as this but 2 hours later and I am nowhere. I'm trying to find text between html tags. The html is a string. The tags are <td></td> and all it returns is null. [code] var insultSite = 'http://www.insultgenerator.org/'; var result; var reg = /<td>([abc])<\/td>/g; $.get( insultSite, function( data ) { data = String( data ); result = data.match( reg ); document.write( result ); }); [/code] I tried lots of other things besides [abc]. That is just the last thing I tested. I'm new to all this by the way. [editline]9th February 2014[/editline] It does get me the html but after I try to do the match it just doesn't return what I want only null.[/QUOTE] Regex is the wrong tool for this, imo. You should be using an XML or DOM parsing library.
[QUOTE=SammySung;43869539]How do I use unhex in a mysql string? For example [code] "insert into logevents (logid,event,operatorifapp, logdate) values (DEFAULT, 'New participant registered - UNHEX('$HexName') - ID: UNHEX('$HexOrgNo')', NULL, CURDATE());";[/code] But it doesn't work. [url]http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_unhex[/url][/QUOTE] I am not sure, but i think it treats UNHEX( as part of the string, and $HexName as not part of the string (am too tired to remember the name)
[QUOTE=gokiyono;43874562]I am not sure, but i think it treats UNHEX( as part of the string, and $HexName as not part of the string (am too tired to remember the name)[/QUOTE] Yeah it does, any way around it?
[QUOTE=SammySung;43877383]Yeah it does, any way around it?[/QUOTE] CONCAT is there [code] INSERT INTO tableName (columnName) VALUES ( CONCAT('This is a string ', HEX(9), -- This is an integer ' And here is another string.' ) ); -- Returns: This is a string 7b And here is another string. [/code]
[QUOTE=gokiyono;43879990]CONCAT is there [code] INSERT INTO tableName (columnName) VALUES ( CONCAT('This is a string ', HEX(9), -- This is an integer ' And here is another string.' ) ); -- Returns: This is a string 7b And here is another string. [/code][/QUOTE] Oh awesome, didn't think of CONCAT. Cheers.
[URL="http://pastebin.com/jrz11QUg"]Code[/URL] [code] parent child child child child child child child child parent child child [/code] So I would want to create an array that can expand itself like that one above and be able to tell where to put itself based off the parents id Is there any good way to do this, or something similar?
This has been pissing me off for ages.. [url]http://stackoverflow.com/questions/21723436/firefox-downloads-text-plain-instead-of-showing-it[/url] [quote] I have a plain text page with some binary data (most data is text) in it like "\003" etc. I set the Content-Type header to text/plain and set the X-Content-Type-Options to nosniff. This stops Google Chrome and Internet Explorer from downloading the page and are instead showing it. But firefox for some reason decides that the page needs to be downloaded. [code]header("content-type: text/plain; charset=UTF-8"); header("X-Content-Type-Options: nosniff");[/code] What header has to be added to stop firefox from downloading a page and instead showing it? [/quote] Do you guys know the awnser?
[code]<link rel="stylesheet" href="http://127.0.0.1/1001">[/code] Here's your problem. You don't need to use the local IP when referencing local material, just use a relative path from your web root (in this case "/1001" instead of "http://127.0.0.1/1001"). Also adding a "type=text/css" will help greatly, since you don't tell the link element what type of content it references. If you add ".css" to your link, it might work without a "type" property. But better safe than sorry by adding the "type" property.
[QUOTE=pdkm931;43882410][code]<link rel="stylesheet" href="http://127.0.0.1/1001">[/code] Here's your problem. You don't need to use the local IP when referencing local material, just use a relative path from your web root (in this case "/1001" instead of "http://127.0.0.1/1001"). Also adding a "type=text/css" will help greatly, since you don't tell the link element what type of content it references. If you add ".css" to your link, it might work without a "type" property. But better safe than sorry by adding the "type" property.[/QUOTE] i'm pretty sure the browser can judge its a css file due to you actually giving it the[I] rel="stylesheet" [/I]property.
[QUOTE=RusselG;43883007]i'm pretty sure the browser can judge its a css file due to you actually giving it the[I] rel="stylesheet" [/I]property.[/QUOTE] Yeah and the type= isn't required by the HTML5 standard
[QUOTE=Mega1mpact;43881119]This has been pissing me off for ages.. [url]http://stackoverflow.com/questions/21723436/firefox-downloads-text-plain-instead-of-showing-it[/url] Do you guys know the awnser?[/QUOTE] Have you tried using "Content-Disposition: inline;"?
[QUOTE=Khub;43883530]Have you tried using "Content-Disposition: inline;"?[/QUOTE] Doesn't seem to work. [t]http://i.imgur.com/Mw0GMzh.png[/t] I made a test paste with some "\003" etc in it: [url]http://nnmm.nl/?5eT0D[/url]
[QUOTE=RusselG;43883007]i'm pretty sure the browser can judge its a css file due to you actually giving it the[I] rel="stylesheet" [/I]property.[/QUOTE] The browser should be able to tell it's a CSS file from the CSS file itself because the server should be sending the right MIME type for the file.
This one's for providers: Why is mail always the most bitchy thing to configure? On all the hosts I've been, I've always had problems identifying to mail servers one moment or another. And if something happened to the hosting, mail's the first thing that complains. Am I just getting a bad streak, or is it known to give problems?
I am probably doing something really stupid, but tweetstream gem is not working locally for me. It works completely fine on my Nitrous.io machine with the same code. Any ideas why?
[QUOTE=bootv2;43896121]So I'm implementing a messaging system for my webserver, and am wondering how I can disable html tags in the message area.[/QUOTE] If php, just do $var = htmlspecialchars($var);
[QUOTE=bootv2;43898396]I don't use php(I'm using my own webserver which uses c++ as a replacement for php), so I'm going to need some html, or some js tags.[/QUOTE] You'll need to strip out html and JS on the backend before sending the content to the user's browser.
[QUOTE=TrinityX;43896773]If php, just do $var = htmlspecialchars($var);[/QUOTE] htmlspecialchars is borked iirc [editline]13th February 2014[/editline] like most of php
[QUOTE=bootv2;43898795]I guess that'll do. I would say it's a missing feature in plain HTML, but programming a filter shouldnt be too hard.[/QUOTE] Why is it a missing feature?
[QUOTE=bootv2;43898795]I guess that'll do. I would say it's a missing feature in plain HTML, but programming a filter shouldnt be too hard.[/QUOTE] It isn't something that should be handled clientside since it could be incredibly exploitable. Say you could have a textarea with htmlents='true', you could just go into something like Firebug, remove it and send it to the server as html.
I've been considering switching out Wordpress for some other blogging tool with potential, have been looking at something like 'ghost' but I am actually not too sure what's great around really since I've been using Wordpress ever since I remember. ([I]Call it lazy work I guess[/I]) Any recommendations? Or is Wordpress actually the greater tool?
[QUOTE=Moofy;43899091]Any recommendations? Or is Wordpress actually the greater tool?[/QUOTE] You should make your own to learn your language of choice.
-snip- was on wrong page
[QUOTE=TrinityX;43899134]You should make your own to learn your language of choice.[/QUOTE] There's nothing wrong using a tool, that's why I am asking. Save time and work from something I don't find particular interest in.
[QUOTE=Moofy;43899335]There's nothing wrong using a tool, that's why I am asking. Save time and work from something I don't find particular interest in.[/QUOTE] Well if you don't want to make your own, i reccomend [URL="http://www.wordpress.com/"]Wordpress[/URL] or [URL="http://www.squarespace.com/"]Squarespace[/URL].
Sorry, you need to Log In to post a reply to this thread.