Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
-
how long do .tk domains take to propagate? a friend of mine tells me they don't take long at all, but others say up to 24 hours
or is it entirely dependent on the webhost?
[QUOTE=Soleeedus;40134943]how long do .tk domains take to propagate? a friend of mine tells me they don't take long at all, but others say up to 24 hours
or is it entirely dependent on the webhost?[/QUOTE]
Why would you get a .tk domain?
A domain is like $10 per year.
using it as a substitute for .me for now
[QUOTE=Soleeedus;40134943]how long do .tk domains take to propagate? a friend of mine tells me they don't take long at all, but others say up to 24 hours
or is it entirely dependent on the webhost?[/QUOTE]
It depends on the registrar. It can be instant or it can take a week. But once it's done, it's done. There's no waiting.
Now the next part of your problem, what you describe as "propagation", doesn't exist. It's actually caching. In order to tell if a server is still caching old information, query it directly with a tool like "dig" or "nslookup". If you need more help, just give me some more info and I can give you some example commands to use.
I've got integer values from a set of checkboxes using the following:
[code]if(!empty($_POST['check'])) {
foreach($_POST['check'] as $check)
{
echo $check;
}
}[/code]
Having done that, how do I add said values into a single variable?
[QUOTE=Sir Whoopsalot;40141982]I've got integer values from a set of checkboxes using the following:
[code]if(!empty($_POST['check'])) {
foreach($_POST['check'] as $check)
{
echo $check;
}
}[/code]
Having done that, how do I add said values into a single variable?[/QUOTE]
If you added them to a variable, they would just override the previous value on each loop... The best way would be adding them to an array, but that would be pretty stupid.
Unless you got like 30 or 40 checkboxes, I'd just put a different name to them and get them individually.
[QUOTE=Coment;40142327]If you added them to a variable, they would just override the previous value on each loop... The best way would be adding them to an array, but that would be pretty stupid.
Unless you got like 30 or 40 checkboxes, I'd just put a different name to them and get them individually.[/QUOTE]
That was my intent but I've fixed it in the meantime. Apparently declaring a variable with value 0 outside the loop and having the check added to that every time at the foreach is a REALLY FUCKING difficult feat.
Anyone have AWS experience, I've got a paid job going.
[QUOTE=Sir Whoopsalot;40142442]That was my intent but I've fixed it in the meantime. Apparently declaring a variable with value 0 outside the loop and having the check added to that every time at the foreach is a REALLY FUCKING difficult feat.[/QUOTE]
No it's not, post code.
I am creating a CMS, i have a functions folder with different files which have alot of functions used for all sorts. i have a init.php which links all the functions together so i link init.php at the top of index.php
[CODE] include 'db/connect.php';
include 'functions/users.php';
include 'functions/general.php';
include 'functions/badges.php';
[/CODE]
My content is loaded in using this javascript
[CODE]function updateContent(filetoget) {
$("#right").fadeOut(function() {
$('#right').load('includes/menu/' + filetoget , function() {
$("#right").fadeIn();
});
});
}
[/CODE]
but when i load in the content, the content doesn't get the functions.
Fatal error: Call to undefined function protectpage() in L:\Apache\htdocs\******************** on line 7
but protectpage() is defined in one of the function files.
i have no idea why this isnt working.
[QUOTE=boshuajackman;40147382]I am creating a CMS, i have a functions folder with different files which have alot of functions used for all sorts. i have a init.php which links all the functions together so i link init.php at the top of index.php
[CODE] include 'db/connect.php';
include 'functions/users.php';
include 'functions/general.php';
include 'functions/badges.php';
[/CODE]
My content is loaded in using this javascript
[CODE]function updateContent(filetoget) {
$("#right").fadeOut(function() {
$('#right').load('includes/menu/' + filetoget , function() {
$("#right").fadeIn();
});
});
}
[/CODE]
but when i load in the content, the content doesn't get the functions.
Fatal error: Call to undefined function protectpage() in L:\Apache\htdocs\******************** on line 7
but protectpage() is defined in one of the function files.
i have no idea why this isnt working.[/QUOTE]
Are the functions also included in the files you load with AJAX? Because they are a separate request and thus also need to have the functions included in them.
I'm sorry I can't help with the above question, since it's out of my league, but I have what I think is a pretty simple question (I hope).
I'm trying to get my line breaks from a textarea to show when I echo the same text back into the textarea.
For example, I write some text in a textarea:
[code]
This
is
text
[/code]
Now I submit that form, it goes into the database with all the \r\n's in there. Now I want to take that text, bring it back into a textarea and edit it, then update the entry on my database. The problem is, the text is outputted in the textarea like so:
[code]
This\r\nis\r\ntext
[/code]
Is there any way I can make those \r\n's actual line breaks within the textarea?
I'm aware of nl2br(), but that doesn't seem to work for textareas, as it doesn't change the output at all.
Any ideas on how to do this would be so very much appreciated.
[QUOTE=Poo Monst3r;40148353]I'm sorry I can't help with the above question, since it's out of my league, but I have what I think is a pretty simple question (I hope).
I'm trying to get my line breaks from a textarea to show when I echo the same text back into the textarea.
For example, I write some text in a textarea:
[code]
This
is
text
[/code]
Now I submit that form, it goes into the database with all the \r\n's in there. Now I want to take that text, bring it back into a textarea and edit it, then update the entry on my database. The problem is, the text is outputted in the textarea like so:
[code]
This\r\nis\r\ntext
[/code]
Is there any way I can make those \r\n's actual line breaks within the textarea?
I'm aware of nl2br(), but that doesn't seem to work for textareas, as it doesn't change the output at all.
Any ideas on how to do this would be so very much appreciated.[/QUOTE]
you can use double quotes, but i doubt that's gonna fix from your problem. can you not upload the data as[code]This
is
text[/code] into mysql? How are you doing this.
[QUOTE=jung3o;40148520]you can use double quotes, but i doubt that's gonna fix from your problem. can you not upload the data as[code]This
is
text[/code] into mysql? How are you doing this.[/QUOTE]
If I insert:
[code]This
is
text[/code]
it will show up as:
[code]This\r\nis\r\ntext[/code]
in the db table, and then when I grab it from the database and show it back into the textarea, it still shows up with the \r\n instead of an actual line break.
I don't think it matters, but I'm using PDO and binding the text from the textarea into a prepared statement.
[QUOTE=Poo Monst3r;40148353]I'm sorry I can't help with the above question, since it's out of my league, but I have what I think is a pretty simple question (I hope).
I'm trying to get my line breaks from a textarea to show when I echo the same text back into the textarea.
For example, I write some text in a textarea:
[code]
This
is
text
[/code]
Now I submit that form, it goes into the database with all the \r\n's in there. Now I want to take that text, bring it back into a textarea and edit it, then update the entry on my database. The problem is, the text is outputted in the textarea like so:
[code]
This\r\nis\r\ntext
[/code]
Is there any way I can make those \r\n's actual line breaks within the textarea?
I'm aware of nl2br(), but that doesn't seem to work for textareas, as it doesn't change the output at all.
Any ideas on how to do this would be so very much appreciated.[/QUOTE]
Check if [url=http://php.net/manual/en/security.magicquotes.php]magic quotes[/url] are enabled on the server.
[QUOTE=Ac!dL3ak;40148587]Check if [url=http://php.net/manual/en/security.magicquotes.php]magic quotes[/url] are enabled on the server.[/QUOTE]
magic_quotes_gpc is enabled on my server.
That's your problem.
[editline]3rd April 2013[/editline]
Disable it, it's a bad idea, especially if you're using PDO.
[QUOTE=Ac!dL3ak;40148712]That's your problem.[/QUOTE]
Ohhh that seems like a logical conclusion. Hopefully I can get my host to turn that shit off.
If I turn it off, will I start having problems when I do something like this:
[code]
echo("<input type = 'text' name = 'someText' />");
[/code]
As in, using single quotes within a double quote? Will that still be fine? Or will I have to escape them?
[QUOTE=Poo Monst3r;40148802]Ohhh that seems like a logical conclusion. Hopefully I can get my host to turn that shit off.
If I turn it off, will I start having problems when I do something like this:
[code]
echo("<input type = 'text' name = 'someText' />");
[/code]
As in, using single quotes within a double quote? Will that still be fine? Or will I have to escape them?[/QUOTE]
that's fine.
Sauce Code
[code]
var output = []+[];
document.write("So, I wonder what this produces?" + output);
[/code]
Output
[code]
So, I wonder what this produces?
[/code]
Javascript... What are you doing... Javascript... Stahp!
[code]
> {} + []
0
[/code]
wait, what?
Hmm... I wonder if adding an object to an array would produce the same result, due to the transitive property...
[code]
> [] + {}
"[object Object]"
[/code]
what the fuck??
With Node I get:
[CODE]
> {} + []
'[object Object]'
> [] + {}
'[object Object]'
[/CODE]
Which is due to the fact that the repl evals the code with parenthesis wrapped around which removes the ambiguity.
[editline]a[/editline]
Brendan Eich's response to the wat talk that you obviously saw (around 5:10)
[MEDIA]http://www.youtube.com/watch?v=Rj49rmc01Hs[/MEDIA]
Anyone got good design tips? I can't show my site here yet but I've been told it needs a grid and I'm wondering what I can do to adhere to a grid.
Hey, I have a Flash problem:
How do I create a delay function? I want to create a button that when you click it, it plays a few frames and then the scene-switching function sets in, after a 10 frame delay.
I am a complete novice to Flash, so please feel free to dumb it down all you want.
EDIT: To simplify my question: How do I make an action go off after a delay. I can't get my Interval to work:
[PHP]stop();
Kollektiv.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);
function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void{ gotoAndPlay(29);
}
Kollektiv.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextScene_13);
function fl_ClickToGoToNextScene_13(event:MouseEvent):void
{
setInterval(fl_ClickToGoToNextScene_13,3000);
MovieClip(this.root).nextScene();
}
[/PHP]
[QUOTE=mac338;40167855]Hey, I have a Flash problem:
How do I create a delay function? I want to create a button that when you click it, it plays a few frames and then the scene-switching function sets in, after a 10 frame delay.
I am a complete novice to Flash, so please feel free to dumb it down all you want.
EDIT: To simplify my question: How do I make an action go off after a delay. I can't get my Interval to work:
[PHP]stop();
Kollektiv.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);
function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void{ gotoAndPlay(29);
}
Kollektiv.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextScene_13);
function fl_ClickToGoToNextScene_13(event:MouseEvent):void
{
setInterval(fl_ClickToGoToNextScene_13,3000);
MovieClip(this.root).nextScene();
}
[/PHP][/QUOTE]
Your current code would, at the same time, start an interval for the same function [i]and[/i] go to the next scene immediately. I.e., it wouldn't wait for the interval.
Try starting the interval in another function and don't bind fl_ClickToGoToNextScene_13 to the click event, e.g. like this:
[php]
stop();
Kollektiv.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);
function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void
{
gotoAndPlay(29);
setInterval(fl_ClickToGoToNextScene_13,3000);
}
function fl_ClickToGoToNextScene_13():void
{
MovieClip(this.root).nextScene();
}
[/php]
[QUOTE=Dragory;40168922]Your current code would, at the same time, start an interval for the same function [i]and[/i] go to the next scene immediately. I.e., it wouldn't wait for the interval.
Try starting the interval in another function and don't bind fl_ClickToGoToNextScene_13 to the click event, e.g. like this:[/QUOTE]
Jesus Christ man you just saved my ass, thanks a million!
Though, when it goes to the next scene the scene repeats after a few frames. There's no actionscript keyframe there, and a stop(); function later on - do you know what could be wrong?
[QUOTE=01271;40163601]Anyone got good design tips? I can't show my site here yet but I've been told it needs a grid and [B]I'm wondering what I can do to adhere to a grid[/B].[/QUOTE]
What? What don't you understand about how grid based design works?
[QUOTE=KmartSqrl;40170793]What? What don't you understand about how grid based design works?[/QUOTE]
I do but I'm wondering how I'm going to make a grid work from within my site.
I've done grids before and it's always been in programs where I'll just ask for a grid then start placing my elements and they'll just snap to the grid. I have no experience placing elements on a page otherwise and Dreamweaver's not an image editing program so I don't know how I'll do that anyways.
Oh yeah and my designs using grids suck but that's beside the point.
Poorly worded last post on my part.
I should probably use this thread when I have a genuine quantifiable problem instead of a frustration.
[QUOTE=Dragory;40168922]Your current code would, at the same time, start an interval for the same function [I]and[/I] go to the next scene immediately. I.e., it wouldn't wait for the interval.
Try starting the interval in another function and don't bind fl_ClickToGoToNextScene_13 to the click event, e.g. like this:
[/QUOTE]
Wait, hold on - with this, how do I dictate specifically what scene it jumps to?
EDIT: Figured it out. How do I get the Interval to keep from repeating after it's used once? Because I tried clearInterval but I couldn't get it working.
EDIT: When my code looks like this it refuses to change scenes:
[PHP]stop();
Kollektiv.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);
function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void{
gotoAndPlay(29);
var myInterval:uint = setInterval(fl_ClickToGoToNextScene_14,3000);
clearInterval(myInterval);
}
function fl_ClickToGoToScene_14(event:MouseEvent):void{
MovieClip(this.root).gotoAndPlay(1, "Testside");
}
[/PHP]
When my code looks like this it refuses to stop looping:
[PHP]stop();
Kollektiv.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);
function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void{
gotoAndPlay(29);
setInterval(fl_ClickToGoToNextScene_14,3000);
}
function fl_ClickToGoToScene_14(event:MouseEvent):void{
MovieClip(this.root).gotoAndPlay(1, "Testside");
}
[/PHP]
It's a bit messy because I had to reformat it for Facepunch.
Sorry, you need to Log In to post a reply to this thread.