Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=Lizart;43220885]how about your first and last name?[/QUOTE]
I hate my name :(
[QUOTE=xianlee;43203461]It was actually http:// off of googles CDN, for some reason it misses it off and it doesn't work without adding it locally..[/QUOTE]
As KmartSqrl told me, the reason you need to add the http:// locally is because it needs to know that it has to fetch from the internet and not locally, if it's hosted on the server it will find the http:// by itself.
[sp]Or something like that[/sp]
[QUOTE=Garrison;43221014]I hate my name :([/QUOTE]
Then use a moniker, or find a creative way to attach your name to something else and create a moniker.
[QUOTE=Garrison;43220594]How do you guys come up with your domain names? I'm looking in the direction of something that could mean anything so I'm not limited to one type of project.[/QUOTE]
I have the same problem, it's basically why I own a ton of domains and then never renew them after a year.
I am having troubles understanding one thing regardless to php, it's kinda important but I can't find a solution.
Example: I finishes my registration page and it redirects you to index.php?value=registered.
On that page you should have some text saying "You have been registered blah blah blah".
Question: I can't figure out how to add content at that stage because if I am redirected to that page it shows the content from index page. I am not sure it that should be a new file where it redirects you or something like this. I am not sure how it has to be done because I don't really understand that bit.
I've that all website has something like that and I am pretty sure they don't create a new file for each redirection.
[QUOTE=BoowmanTech;43222837]I am having troubles understanding one thing regardless to php, it's kinda important but I can't find a solution.
Example: I finishes my registration page and it redirects you to index.php?value=registered.
On that page you should have some text saying "You have been registered blah blah blah".
Question: I can't figure out how to add content at that stage because if I am redirected to that page it shows the content from index page. I am not sure it that should be a new file where it redirects you or something like this. I am not sure how it has to be done because I don't really understand that bit.
I've that all website has something like that and I am pretty sure they don't create a new file for each redirection.[/QUOTE]
Check if the request you're getting is a POST request and work down on that, do the validation and SQL insertion and all things and then you can do something like this.
[code]
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){
//Validation things and whatever or the result page
} else {
// Registration form
}
?>
[/code]
Not a 100% sure if it works like this in PHP but this is a way you could do it. This way there is no need for the index.php?value=registered either.
[QUOTE=Garrison;43220594]How do you guys come up with your domain names? I'm looking in the direction of something that could mean anything so I'm not limited to one type of project.[/QUOTE]
You can use [URL="http://domai.nr"]http://domai.nr[/URL] too, which helps shorten URL's for you if you want a short(er) URL.
[QUOTE=Moofy;43221215]As KmartSqrl told me, the reason you need to add the http:// locally is because it needs to know that it has to fetch from the internet and not locally, if it's hosted on the server it will find the http:// by itself.
[sp]Or something like that[/sp][/QUOTE]
that's the tl;dr or it.
[QUOTE=Superkipje;43223027]Check if the request you're getting is a POST request and work down on that, do the validation and SQL insertion and all things and then you can do something like this.
[code]
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){
//Validation things and whatever or the result page
} else {
// Registration form
}
?>
[/code]
Not a 100% sure if it works like this in PHP but this is a way you could do it. This way there is no need for the index.php?value=registered either.[/QUOTE]
I am not 100% sure what you mean but do you know a website where I can check how these kind of things ulr.com/xx.php[B]?xx=xxx[/B] I am not sure what to look for.
Say if I wanted to give away some cd keys from a humble bundle but through my website, how would I do this?
So say I put it live on my site but then once someone claims it, it disappears for good? which language would be best? php / javascript or some other?
[QUOTE=BoowmanTech;43227914]I am not 100% sure what you mean but do you know a website where I can check how these kind of things ulr.com/xx.php[B]?xx=xxx[/B] I am not sure what to look for.[/QUOTE]
[URL]http://php.net/manual/en/reserved.variables.get.php[/URL]
You should also check [URL="http://www.php.net/manual/en/reserved.variables.post.php"]$_POST[/URL], to know the difference and when to use one or another.
I have a question: Since so many websites do so many things to piss their users off, how come circumvention/alteration websites aren't more prevalent?
Things like a anunderdevelopedsimesetwinbabythinghangingoffofyoutube.com that allowed you to iframe youtube and add things like videos that will circumvent filters, copyright, etc with its own 3rd party servers or p2p etc
Or things as simple as allowing users to alt-fuck thier facebooks into allowing animated gifs or providing an older profile view or adding glitter shit. etc
BECAUSE WE KNOW THIS BULLSHIT WOULD BE POPULAR
I got this
[code]
@media screen and (max-device-width: 720px) {
.cpanel {
text-align: center;
width: 100%;
}
}
[/code]
And it looks good on the computer when minimizing the screen, however if I try it out on phone it looks wrong, I was positive that the above code would fix it. But it didn't, what's wrong?
[editline]19th December 2013[/editline]
Also, it works on iPhone. The problem occurs on (in this case) Samsung Galaxy S III.
Updated the code line as well.
[QUOTE=Moofy;43235308]I got this
[code]
@media screen and (max-device-width: 720px) {
.cpanel {
text-align: center;
width: 100%;
}
}
[/code]
And it looks good on the computer when minimizing the screen, however if I try it out on phone it looks wrong, I was positive that the above code would fix it. But it didn't, what's wrong?
[editline]19th December 2013[/editline]
Also, it works on iPhone. The problem occurs on (in this case) Samsung Galaxy S III.
Updated the code line as well.[/QUOTE]
That is because the Samsung Galaxy s3 is 1080 pixels wide and you are telling it to run on screens 720 pixels or less.
[QUOTE=gokiyono;43235465]That is because the Samsung Galaxy s3 is 1080 pixels wide and you are telling it to run on screens 720 pixels or less.[/QUOTE]
[code]
@media screen and (max-device-width: 1080px) {
.cpanel {
text-align: center;
width: 100%;
}
}
[/code]
Still nothing, same stuff happens :/
[editline]19th December 2013[/editline]
In both portrait and landscape*
[QUOTE=Moofy;43235520][code]
@media screen and (max-device-width: 1080px) {
.cpanel {
text-align: center;
width: 100%;
}
}
[/code]
Still nothing, same stuff happens :/
[editline]19th December 2013[/editline]
In both portrait and landscape*[/QUOTE]
Can you show what happens, like in the form of jsfiddle or something?
[QUOTE=Moofy;43235520][code]
@media screen and (max-device-width: 1080px) {
.cpanel {
text-align: center;
width: 100%;
}
}
[/code]
Still nothing, same stuff happens :/
[editline]19th December 2013[/editline]
In both portrait and landscape*[/QUOTE]
Drop the "screen and" I think that's only used for desktops, usually at least.
[QUOTE=Superkipje;43235551]Drop the "screen and" I think that's only used for desktops, usually at least.[/QUOTE]
Dropped it, works the same on iPhone / Desktop just not the Galaxy.
[QUOTE=gokiyono;43235549]Can you show what happens, like in the form of jsfiddle or something?[/QUOTE]
jsfiddle for a phone? :v All it does is center some links, but on galaxy the 2 links break to one line each.
[QUOTE=Moofy;43235597]jsfiddle for a phone? :v All it does is center some links, but on galaxy the 2 links break to one line each.[/QUOTE]
It's mainly just because more infomation/code is always nice.
[QUOTE=gokiyono;43235619]It's mainly just because more infomation/code is always nice.[/QUOTE]
The div I'm trying to affect:
[code]
<div class="large-4 medium-4 small-12 right cpanel">
<p class="cpanel-info">Logget ind som: <?= $username ?></p>
<a class="cpanel-info" href="logout.php">Log ud</a>
</div>
[/code]
And the media query is still the same.
[QUOTE=Moofy;43235597]Dropped it, works the same on iPhone / Desktop just not the Galaxy.
jsfiddle for a phone? :v All it does is center some links, but on galaxy the 2 links break to one line each.[/QUOTE]
True, screen does work on iPhone but I think only older ones. So I assume it still doesn't work but it does work on desktop / iPhone?
Also, do you want to use max-device-width or max-width?
max-width is the width of the target display area, e.g. the browser
max-device-width is the width of the device's entire rendering area, i.e. the actual device screen
[url]http://stackoverflow.com/questions/6747242/what-is-the-difference-between-max-device-width-and-max-width-for-mobile-web?answertab=votes#tab-top[/url]
[QUOTE=Superkipje;43235631]True, screen does work on iPhone but I think only older ones. So I assume it still doesn't work but it does work on desktop / iPhone?
Also, do you want to use max-device-width or max-width?
max-width is the width of the target display area, e.g. the browser
max-device-width is the width of the device's entire rendering area, i.e. the actual device screen
[url]http://stackoverflow.com/questions/6747242/what-is-the-difference-between-max-device-width-and-max-width-for-mobile-web?answertab=votes#tab-top[/url][/QUOTE]
The div as said above just needs to fill out the screen and have the text within it lined up next to each other as it does on the computer/iPhone. And tried both, worked out the same on the Galaxy!
[editline]19th December 2013[/editline]
Update on the problem, so it seems like the problem is only happening when using Chrome on the phone? :suicide:
SUCCESS!
[QUOTE=Moofy;43235639]The div as said above just needs to fill out the screen and have the text within it lined up next to each other as it does on the computer/iPhone. And tried both, worked out the same on the Galaxy!
[editline]19th December 2013[/editline]
Update on the problem, so it seems like the problem is only happening when using Chrome on the phone? :suicide:
SUCCESS![/QUOTE]
I wonder what happens if you use a [URL="http://www.javascriptkit.com/dhtmltutors/cssmediaqueries3.shtml"]viewport tag[/URL]
[QUOTE=gokiyono;43235699]I wonder what happens if you use a [URL="http://www.javascriptkit.com/dhtmltutors/cssmediaqueries3.shtml"]viewport tag[/URL][/QUOTE]
Already got this
[code]
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
[/code]
I'm developing a visualisation application for my final year project and I'm barely into it :P. I've got a syntax error and I'm starting to feel a bit silly about it, can anyone see whats wrong with this?
[code]
// Nodes and branches
// Table Class
function Table(width,height)
{
// Attributes
var _branches = new Array();
var _branchWidth = width;
var _width = width;
var _height = height;
var colours = new Array();
colours[0] = "#000000";
colours[1] = "#222222";
colours[2] = "#444444";
colours[3] = "#666666";
// Methods
return
{
[B][U][I]Draw: function ()[/I][/U][/B]
{
for (var i = 0; i<_branches.length;i++)
{
drawRect(i*_branchWidth,0,_branchWidth,_height,colours[i])
}
},
AddBranch: function (branch)
{
_branches.push(branch);
_branchWidth = _width/_branches.length;
},
Update: function ()
{
//Write code for update node/branch sizes
Draw();
},
Resize: function (width,height)
{
_width = width;
_height = height;
_branchWidth = _width/_branches.length;
Update();
},
AddNode: function (branchId,node)
{
_branches[branchId].AddNode(node);
Update();
return _branches.length;
},
GetBranch: function (branchId)
{
return _branches[branchId];
},
GetNode: function (branchId, nodeId)
{
return _branches[branchId].GetNode(nodeId);
}
}
}[/code]
I've bolded, underlined and put in italics the line "causing" the problem.
here's the error I get from chrome: "Uncaught SyntaxError: Unexpected token ( "
[QUOTE=Moofy;43235712]Already got this
[code]
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
[/code][/QUOTE]
Im using this on my site
[code]
@media only screen and (max-width: 800px), only screen and (max-device-width: 800px) {
**code**
}[/code]
Not sure what it looks like on any other phone except Nexus 5.. when it drops below 800px it just changes stuff around, the only thing that will look off (hopefully) is the title will be cut off on a phone with a width reso of 320px.
[QUOTE=borisjake;43236546]I'm developing a visualisation application for my final year project and I'm barely into it :P. I've got a syntax error and I'm starting to feel a bit silly about it, can anyone see whats wrong with this?
[code]...[/code]
I've bolded, underlined and put in italics the line "causing" the problem.
here's the error I get from chrome: "Uncaught SyntaxError: Unexpected token ( "[/QUOTE]
Damn, found the problem! I had the return contents on a new line.
[QUOTE=Shadow801;43210738]Is PHP really that bad? I always hear it being put down by proggrammers specifically, but I've been using it and it seems to work fairly well.
Not to mention with platforms like WordPress being built on it, it's hard to stay away from it.[/QUOTE]
[url]http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/[/url]
[QUOTE=Eudoxia;43237870][url]http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/[/url][/QUOTE]
Here we go again...
[QUOTE=Shadow801;43210738]Is PHP really that bad?
I've been using it and it seems to work fairly well. [/QUOTE]
Pretty much sums it up. PHP isn't bad. Some people like it, some people don't.
I prefer PHP, but that may be because i haven't tried Ruby.
Sorry, you need to Log In to post a reply to this thread.