Hulp gezocht!

Gestart doorPropje33 reacties163 weergaven

34 berichten · pagina 1 van 3

Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo ik heb weer hulp nodig

ik wil zeg maar

als je op verzenden drukt dan komt het in de databse terecht
en kiest die zelf een woord uit bijvoorbeeld

je drukt op verzenden
komt in de databse te staan dan hoi

dus een soort random

een soort verassing wat er in de databse komt
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$array[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]hoi[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]doei[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$aantal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$array[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$random[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$gekozen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700][[/COLOR][COLOR= #0000BB]$random[/COLOR][COLOR= #007700]];[/COLOR]
?>


zo iets?
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
alleen dan moet het in de databse komen die woord

eerst komt er te staan

je hebt nog niet in de grabeldoos gebrabeld
druk op ok om te grabelen

dan zoekt die wat bijvoorbeeld 2 dat komt dan in de databse

en dan gaat deze tekst weg

je hebt nog niet in de grabeldoos gebrabeld
druk op ok om te grabelen

dan komt er dan voor je hebt 2 gegrabeld.
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
je kan het in de database zetten met deze query(al het mysql is):

INSERT tabel (woord) VALUES ($gekozen)
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
is dit goed?

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR] [COLOR= #007700]&& ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700]))
  }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
          [COLOR= #007700]{[/COLOR]
 [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT tabel (woord) VALUES ($gekozen)"[/COLOR][COLOR= #007700];[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Succesvol verzonden"[/COLOR][COLOR= #007700];
    }
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
  [COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$array[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]hoi[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]doei[/COLOR][COLOR= #007700]);[/COLOR]  
[COLOR= #0000BB]$aantal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$array[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$random[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$gekozen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700][[/COLOR][COLOR= #0000BB]$random[/COLOR][COLOR= #007700]];

<[/COLOR]form action[COLOR= #007700]=[/COLOR][COLOR= #DD0000]""[/COLOR] method[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700]>
<[/COLOR]input type[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"submit"[/COLOR] name[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"verzenden"[/COLOR] value[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"verzenden"[/COLOR][COLOR= #007700]>
<[/COLOR]/form[COLOR= #007700]>[/COLOR]
?>
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/DIR"]DIR[/URL][COLOR= #007700],[/COLOR] [URL="http://www.php.net/dirname"]dirname[/URL][COLOR= #007700]([/COLOR]__FILE__[COLOR= #007700]));[/COLOR]
[URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR]S[COLOR= #007700],[/COLOR] DIRECTORY_SEPARATOR[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/DIR"]DIR[/URL][COLOR= #007700].[/COLOR]S[COLOR= #007700].[/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$array[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]hoi[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]doei[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$aantal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$array[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$random[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$gekozen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700][[/COLOR][COLOR= #0000BB]$random[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]grabbel[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$insert[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT tabel (woord) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$gekozen[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$insert[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Er is een fout opgetreden"[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Het is goed gegaan"[/COLOR][COLOR= #007700];
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<form action=""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]PHP_SELF[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"" action="post">"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<input type="submit" value="Verzenden" name="grabbel"/>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</form>"[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Deze is goed
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik krijg deze error

Parse error: syntax error, unexpected [, expecting ( in /home/pascal/domains/test-up.v3host.nl/public_html/newkids/members.php on line 30

$gekozen = array[$random];
0
Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/DIR"]DIR[/URL][COLOR= #007700],[/COLOR] [URL="http://www.php.net/dirname"]dirname[/URL][COLOR= #007700]([/COLOR]__FILE__[COLOR= #007700]));[/COLOR]
[URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR]S[COLOR= #007700],[/COLOR] DIRECTORY_SEPARATOR[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/DIR"]DIR[/URL][COLOR= #007700].[/COLOR]S[COLOR= #007700].[/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$array[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]hoi[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]doei[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$aantal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$array[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$random[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$gekozen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700][[/COLOR][COLOR= #0000BB]$random[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]grabbel[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$insert[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO tabel (woord) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$gekozen[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$insert[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Er is een fout opgetreden"[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Het is goed gegaan"[/COLOR][COLOR= #007700];
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<form action=""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]PHP_SELF[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"" action="post">"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<input type="submit" value="Verzenden" name="grabbel"/>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</form>"[/COLOR][COLOR= #007700];
}[/COLOR]
?>


$gekozen = array[$random];
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
nog steedshet zelfde

Parse error: syntax error, unexpected [, expecting ( in /home/pascal/domains/test-up.v3host.nl/public_html/newkids/members.php on line 30
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$gekozen = array($random);
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
krijg ik deze error

Parse error: syntax error, unexpected ; in /home/pascal/domains/test-up.v3host.nl/public_html/newkids/members.php on line 32

$insert = mysql_query("INSERT leden (sorteer) VALUES (".$gekozen.")";
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$insert = mysql_query("INSERT leden (sorteer) VALUES (".$gekozen.")") or die(mysql_error());
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
het hele script werkt niet wordt niet naar databse gstuurd

lan iemand anders een nieuwe werkende maken
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$insert = mysql_query("INSERT INTO leden (sorteer) VALUES (".$gekozen.")") or die(mysql_error());
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@milan

kan jij misschien een nieuwe maken want deze is bager
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