Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
I am a bit...
I have no idea what is going on here, but
I looked in Firebug on something I was testing, and there was a <script> tag that I don't know where is from.
So I looked into it, and it includes a javascript file containing [URL="http://pastebin.com/tBiJwXCn"]this[/URL]
I unescape the characters and it is [URL="http://pastebin.com/hwevJqN4"]this[/URL]
I am not sure what goes on, especially not with var words.
Could anyone offer... any help?
[QUOTE=gokiyono;42302398]I am a bit...
I have no idea what is going on here, but
I looked in Firebug on something I was testing, and there was a <script> tag that I don't know where is from.
So I looked into it, and it includes a javascript file containing [URL="http://pastebin.com/tBiJwXCn"]this[/URL]
I unescape the characters and it is [URL="http://pastebin.com/hwevJqN4"]this[/URL]
I am not sure what goes on, especially not with var words.
Could anyone offer... any help?[/QUOTE]
It's an ad/tracker. If it's showing up in a page you're developing, it's being placed there by some shitty extension you installed on your browser.
[QUOTE=StinkyJoe;42302451]It's an ad/tracker. If it's showing up in a page you're developing, it's being placed there by some shitty extension you installed on your browser.[/QUOTE]
Apparently something called "WebSite Recommendation" has made its way to one of my school computers.
I think it's a good thing I have adblock, because it doesn't seem SFW
I currently have the following tables in a mysql database:
Table 1 containing rows id (int), name (varchar), type (int)
Table 2 containing rows typeid (int) and a bunch of fields
Right now i'm doing "SELECT * FROM table1 WHERE id = :id" and then a second query "SELECT * FROM table2 WHERE typeid = :id" to select the type data. Is there a better way to do this, preferably in a single query?
[QUOTE=Goz3rr;42302898]I currently have the following tables in a mysql database:
Table 1 containing rows id (int), name (varchar), type (int)
Table 2 containing rows typeid (int) and a bunch of fields
Right now i'm doing "SELECT * FROM table1 WHERE id = :id" and then a second query "SELECT * FROM table2 WHERE typeid = :id" to select the type data. Is there a better way to do this, preferably in a single query?[/QUOTE]
[url=http://dev.mysql.com/doc/refman/5.5/en/subqueries.html]Subqueries[/url].
[QUOTE=jetboy;42303041][url=http://dev.mysql.com/doc/refman/5.5/en/subqueries.html]Subqueries[/url].[/QUOTE]
I managed to find INNER JOIN a minute later, with the following query. Would subqueries be better than this?
[code]
SELECT * FROM table1 INNER JOIN table2 on table1.type = table2.type WHERE id = :id
[/code]
No, what you did is much better. I'm retarded for not suggesting a join. :v:
- snip -
[QUOTE=gokiyono;42301750]One day I might buy a title that says that the script on my homepage is the title fixer.[/QUOTE]
Wouldn't it be easier to have a title to link to the title fixer?
Like a really large obnoxious title that just reads: "DO YOU ALSO HATE LARGE TITLES? CLICK HERE."
[QUOTE=eternalflamez;42303396]Wouldn't it be easier to have a title to link to the title fixer?
Like a really large obnoxious title that just reads: "DO YOU ALSO HATE LARGE TITLES? CLICK HERE."[/QUOTE]
Brilliant idea
I'm having trouble displaying small amounts of data on a page without it looking bare.
[IMG]http://i.imgur.com/mdlZQxT.jpg[/IMG]
This is the best I've come up with so far, but now everything is massive and the whole thing feels like a toy.
Does anybody have any other ideas?
[QUOTE=XL5;42309810]I'm having trouble displaying small amounts of data on a page without it looking bare.
[IMG]http://i.imgur.com/mdlZQxT.jpg[/IMG]
This is the best I've come up with so far, but now everything is massive and the whole thing feels like a toy.
Does anybody have any other ideas?[/QUOTE]
I'd drop the borders and rounded corners, I feel like they're what's contributing to the "toy" feel - go all out flat retard, embrace whitespace and simplicity, and it should look pretty nice!
How does the Facebook mobile app work? Is it just the Facebook mobile website with a browser that has tweaked settings?
What is a free, reliable and private repository host?
[QUOTE=smithy285;42315509]What is a free, reliable and private repository host?[/QUOTE]
[URL="http://bitbucket.org"]bitbucket.org[/URL]
[QUOTE=Coffeee;42314732]How does the Facebook mobile app work? Is it just the Facebook mobile website with a browser that has tweaked settings?[/QUOTE]
Like every freaking online application? Client connects to server, asks for stuff via API etc.
[QUOTE=Coffeee;42314732]How does the Facebook mobile app work? Is it just the Facebook mobile website with a browser that has tweaked settings?[/QUOTE]
It's a native app that communicates with an API on facebook's end. Definitely not just a web browser with a different face.
[QUOTE=smithy285;42315509]What is a free, reliable and private repository host?[/QUOTE]
GitHub will also let you request a [URL="https://github.com/edu"]free micro plan[/URL] if you're a student and have reasonable intentions.
[QUOTE=StinkyJoe;42314012]I'd drop the borders and rounded corners, I feel like they're what's contributing to the "toy" feel - go all out flat retard, embrace whitespace and simplicity, and it should look pretty nice![/QUOTE]
[IMG]http://i.imgur.com/2sLsM9x.png[/IMG]
This is definitely an improvement, I'm still not sure though, anybody got anything to say about improving this?
What is a good way to avoid someone somehow adding a <script>// alert('stuff');</script> on a page?
Is htmlentities just enough? Or is there a nice class that can help?
(I know the OWASP Reform class, but it doesn't like æøå)
[editline]27th September 2013[/editline]
[QUOTE=XL5;42320051][IMG]http://i.imgur.com/2sLsM9x.png[/IMG]
This is definitely an improvement, I'm still not sure though, anybody got anything to say about improving this?[/QUOTE]
I'd say
That looks pretty good
I prefer htmlspecialchars over htmlentities, but otherwise, yeah as long as you don't forget to use it anywhere it should work.
[QUOTE=XL5;42320051]This is definitely an improvement, I'm still not sure though, anybody got anything to say about improving this?[/QUOTE]
I think the (ok/warning) icons look out of place, otherwise it looks nice.
[QUOTE=thejjokerr;42323541]So I've gone through hundreds of redesigns and am still not happy with the way it looks, I can show 3 ideas that I had for a style, the top one is as it is right now.
Is it OK? Is there anything that could be improved or do you guys think I should go for one of the other designs or something completely different?
images[/QUOTE]
You need to have a 'powered by steam' link somewhere on your page when using the steam api
[quote]
Valve Brand and Links
Each page that uses the Steam Web API must contain a link to [url]http://steampowered.com[/url] with the text "Powered by Steam". We suggest that you put this link in your footer so it is out of the way but still visible to interested users.
If you are using OpenID on your site, we request that you use one of the following buttons as your link to the Steam sign in page. These images represent the Steam brand to users, underscoring that Steam account credentials may be used to sign in to your site.
[img]http://cdn.steamcommunity.com/public/images/signinthroughsteam/sits_large_border.png[/img]
[img]http://cdn.steamcommunity.com/public/images/signinthroughsteam/sits_large_noborder.png[/img]
[img]http://cdn.steamcommunity.com/public/images/signinthroughsteam/sits_small.png[/img]
[/quote]
[url]http://steamcommunity.com/dev[/url]
[QUOTE=thejjokerr;42323641]Yeah I had that before, but for now I kinda want to focus on the main design first and think about what Valve wants later.[/QUOTE]
Just thought i'd tell you so you could keep it in mind while doing the design :v:
Need some help, shouldn't be that hard
[CODE]
<?php
foreach (glob($dir."*.php") as $filename) {
$post = file_get_contents($filename);
echo $post;
$i++;
if($i == $max) break;
}
?>
[/CODE]
Okay I would like the file_get_contents to start from my element named "<article class="blogpost">"?
Thanks
[QUOTE=j4NZKUE;42325126]Need some help, shouldn't be that hard
[CODE]
<?php
foreach (glob($dir."*.php") as $filename) {
$post = file_get_contents($filename);
echo $post;
$i++;
if($i == $max) break;
}
?>
[/CODE]
Okay I would like the file_get_contents to start from my element named "<article class="blogpost">"?
Thanks[/QUOTE]
Try this
[code]
preg_match('/<article class="blogpost">(.+?)<\/article>/s', $post, $matches);
print($matches[1]);
[/code]
That will get the content of the article (which i assume is what you want)
If you want to cut off everything before try this
[code]
$pos = strpos($post, '<article class="blogpost">');
$newstring = substr($post, $pos);
[/code]
[QUOTE=Goz3rr;42325163]Try this
[code]
preg_match('/<article class="blogpost">(.+?)<\/article>/s', $post, $matches);
print($matches[1]);
[/code]
That will get the content of the article (which i assume is what you want)
If you want to cut off everything before try this
[code]
$pos = strpos($post, '<article class="blogpost">');
$newstring = substr($post, $pos);
[/code][/QUOTE]
ah, should have thought about getting the content first and then cutting it off. Thanks!
[QUOTE=Goz3rr;42323714]Just thought i'd tell you so you could keep it in mind while doing the design :v:[/QUOTE]
Not that it matters too much, I know a guy who raped the steam servers with his api spamming script, he said while it was running that it took steam responsiveness down by 20%.
He was using two linux machines with a threaded java daemon that mass-downloaded API data for steam users and tf2 backpacks.
That was like 1/2 a year ago and he still has not felt any consequences.
[QUOTE=01271;42326758]Not that it matters too much, I know a guy who raped the steam servers with his api spamming script, he said while it was running that it took steam responsiveness down by 20%.
He was using two linux machines with a threaded java daemon that mass-downloaded API data for steam users and tf2 backpacks.
That was like 1/2 a year ago and he still has not felt any consequences.[/QUOTE]
They're letting you make free use of their service, the least you can do is thank them for it by following their guidelines
- snip -
Sorry, you need to Log In to post a reply to this thread.