Kleine Vragen Topic #2

Gestart doorKingunit3.067 reacties11.764 weergaven

3.068 berichten · pagina 147 van 205

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Aarclay schreef:
[COLOR= #0000BB]<?php
$datetime[/COLOR] [COLOR= #007700]=[/COLOR] DateTime[COLOR= #007700]::[/COLOR]createFromFormat[COLOR= #007700]([/COLOR][COLOR= #DD0000]Y-m-d*H:i:sT[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]2013-09-15T00:30[/COLOR][COLOR= #007700]);[/COLOR] 
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$datetime[/COLOR][COLOR= #007700]->[/COLOR]format[COLOR= #007700]([/COLOR][COLOR= #DD0000]Y-m-d H:i:s[/COLOR][COLOR= #007700]);[/COLOR]
?>
Thanks! En ik wil ook nog een interval zetten zodat als er in de input iets word getypt dat er niet gelijk een reload word gedaan, maar na 1 seconden.

Codeblok (voorbeeld.php):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

function update() {
var url = document.getElementById(change_frame);
var station = setInterval(document.getElementById(station_input), 1000);
var data = station.value;
if(data.trim() == ) {

} else {
url.src = http://localhost/data.php?s= + data;
}
}

function openwindow() {
var station = document.getElementById(station_input);
var data = station.value;
if(data.trim() == ) {
alert(U heeft geen trein station in het witte vlak getypt!);
} else {

document.getElementById(light).style.display=block;
document.getElementById(fade).style.display=block;

}
}

Ik heb nu dat alleen word die nu nooit geupdated?
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
Eerdere citaten tonen
Aarclay schreef:
[COLOR= #0000BB]<?php
$datetime[/COLOR] [COLOR= #007700]=[/COLOR] DateTime[COLOR= #007700]::[/COLOR]createFromFormat[COLOR= #007700]([/COLOR][COLOR= #DD0000]Y-m-d*H:i:sT[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]2013-09-15T00:30[/COLOR][COLOR= #007700]);[/COLOR] 
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$datetime[/COLOR][COLOR= #007700]->[/COLOR]format[COLOR= #007700]([/COLOR][COLOR= #DD0000]Y-m-d H:i:s[/COLOR][COLOR= #007700]);[/COLOR]
?>
Thanks! En ik wil ook nog een interval zetten zodat als er in de input iets word getypt dat er niet gelijk een reload word gedaan, maar na 1 seconden.

Codeblok (voorbeeld.php):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

function update() {
var url = document.getElementById(change_frame);
var station = setInterval(document.getElementById(station_input), 1000);
var data = station.value;
if(data.trim() == ) {

} else {
url.src = http://localhost/data.php?s= + data;
}
}

function openwindow() {
var station = document.getElementById(station_input);
var data = station.value;
if(data.trim() == ) {
alert(U heeft geen trein station in het witte vlak getypt!);
} else {

document.getElementById(light).style.display=block;
document.getElementById(fade).style.display=block;

}
}

Ik heb nu dat alleen word die nu nooit geupdated?

var station = setInterval(document.getElementById(station_input), 1000);


Is ook geen functie he.

Je moet een var hebben, bij elke update doe je clearInterval op de var en daarna zet je de var opnieuw naar de functie die load veroorzaakt over 500ms ofzo
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Zoiets?

Codeblok (voorbeeld.php):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

var interval = setInterval(function(){update()},1000);
function update() {
var url = document.getElementById(change_frame);
var station = document.getElementById(station_input);
var data = station.value;
if(data.trim() == ) {

} else {
url.src = http://localhost/data.php?s= + data;
}

clearInterval(interval);
}

function openwindow() {
var station = document.getElementById(station_input);
var data = station.value;
if(data.trim() == ) {
alert(U heeft geen trein station in het witte vlak getypt!);
} else {

document.getElementById(light).style.display=block;
document.getElementById(fade).style.display=block;

}
}

Alleen werkt het nog steeds niet? Ik zie ook niks in console staan"?
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Codeblok (voorbeeld.php):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

var interval;
function update() {
var url = document.getElementById(change_frame);
var station = document.getElementById(station_input);
var data = station.value;
if(data.trim() == ) {

} else {
url.src = http://localhost/data.php?s= + data;
}

clearInterval(interval);
interval = setInterval(function(){update()},1000);
}

function openwindow() {
var station = document.getElementById(station_input);
var data = station.value;
if(data.trim() == ) {
alert(U heeft geen trein station in het witte vlak getypt!);
} else {
document.getElementById(light).style.display=block;
document.getElementById(fade).style.display=block;

}
}
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Antonn schreef:
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

var interval;
function update() {
var url = document.getElementById(change_frame);
var station = document.getElementById(station_input);
var data = station.value;
if(data.trim() == ) {

} else {
url.src = http://localhost/data.php?s= + data;
}

clearInterval(interval);
interval = setInterval(function(){update()},1000);
}

function openwindow() {
var station = document.getElementById(station_input);
var data = station.value;
if(data.trim() == ) {
alert(U heeft geen trein station in het witte vlak getypt!);
} else {
document.getElementById(light).style.display=block;
document.getElementById(fade).style.display=block;

}
}

Nu reload om de second.
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
setInterval moet setTimeOut
0
Berichten
3.001
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik denk dat dit redelijk kleine errors zijn, maar ik weet het niet zeker.

Ik heb de volgende code

Codeblok (ubb.php):

1
2
3
4
5
6
7
8
9
10
11

$input = preg_replace("#(.+?)#is","1",$input);
$input = preg_replace("#[marquee](.+?)[/marquee]#is","1",$input);
$input = preg_replace("()(.*)()", "2", $input);
$input = preg_replace("()(.*)()", "2", $input);
$input = preg_replace("()(.*)()", "2", $input);
$input = preg_replace("(
)(.*)(
)"
, "2", $input);
$input = preg_replace("(
Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt.
)"
, "Afbeelding", $input);
$input = preg_replace("([marquee snelheid=)([^[]*)(])([^[]*)([/marquee])", "4", $input);
$input = preg_replace("(*)(])([^[]*)()", "4", $input);
?>

En krijg de volgende errors;

Quote:
preg_replace(): Unknown modifier ( in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 143
Warning: preg_replace(): Unknown modifier ( in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 144
Warning: preg_replace(): Unknown modifier ( in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 145
Warning: preg_replace(): Unknown modifier ( in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 146
Warning: preg_replace(): Unknown modifier ( in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 147
Warning: preg_replace(): Unknown modifier ( in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 148
Warning: preg_replace(): Unknown modifier ( in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 149

Wie kan me helpen?
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
http://regexpal.com/

Die haakjes zijn onnodig lijkt me.
0
Berichten
3.001
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Antonn schreef:
http://regexpal.com/

Die haakjes zijn onnodig lijkt me.

Ah bedankt wink
toevoeging op 15 september 2013, 10:52:49:

Codeblok (ubb.php):

1
2
3
4
5
6
7
8
9

(.+?)#is","1",$input);
$input = preg_replace("#[marquee](.+?)[/marquee]#is","1",$input);
$input = preg_replace(")(.*)(", "2", $input);
$input = preg_replace(")(.*)(", "2", $input);
$input = preg_replace(")(.*)(", "2", $input);
$input = preg_replace("
)(.*)(
", "2", $input);
$input = preg_replace("
Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt.
", "Afbeelding", $input);
$input = preg_replace("[marquee snelheid=)([^[]*)(])([^[]*)([/marquee]", "4", $input);
$input = preg_replace("*)(])([^[]*)(", "4", $input); ?>

Nu krijg ik deze errors en ik snap niks van preg_replace confused, hoe los ik et op..

Quote:
preg_replace(): Delimiter must not be alphanumeric or backslash in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 143
Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 144
Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 145
Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 146
Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 147
Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 148
Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 149
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Doe eens / in begin en einde, zo dus:

/regex/
0
Berichten
3.001
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Codeblok (ubb.php):

141
142
143
144
145
146
147
148
149

= preg_replace("#(.+?)#is","1",$input);
$input = preg_replace("#[marquee](.+?)[/marquee]#is","1",$input);
$input = preg_replace("/)(.*)(/", "2", $input);
$input = preg_replace("/)(.*)(/", "2", $input);
$input = preg_replace("/)(.*)(/", "2", $input);
$input = preg_replace("/
)(.*)(
/"
, "2", $input);
$input = preg_replace("/
Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt.
/"
, "Afbeelding", $input);
$input = preg_replace("/[marquee snelheid=)([^[]*)(])([^[]*)([/marquee]/", "4", $input);
$input = preg_replace("/*)(])([^[]*)(/", "4", $input); ?>

geeft

Quote:
Warning: preg_replace(): Unknown modifier in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 143
Warning: preg_replace(): Unknown modifier in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 144
Warning: preg_replace(): Unknown modifier in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 145
Warning: preg_replace(): Unknown modifier c in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 146
Warning: preg_replace(): Unknown modifier g in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 147
Warning: preg_replace(): Unknown modifier a in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 148
Warning: preg_replace(): Unknown modifier r in /home/hypdohd4/domains/hypdohut.nl/public_html/v2_beta/ubb.inc.php on line 149
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Codeblok (ubb.php):

141
142
143

$input = preg_replace("#(.+?)#is","1",$input);
?>

zo moet die werken
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Afbeelding

Iemand idee hoe ik dit responsive kan maken?
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
Afbeelding

Iemand idee hoe ik dit responsive kan maken?
Ja
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Antonn schreef:
Eerdere citaten tonen
Dylanh schreef:
Iemand idee hoe ik dit responsive kan maken?

Ja
Hoe?
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren