laat je code eens zien?
Betaald > Saldo opwaarderen
Aarclay schreef:laat je code eens zien?
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE member_accounts SET uCoins = uCoins + 0.80 WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt betaald, er is 0,80 bij je saldo toegevoegd![/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]error:[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
}[/COLOR]
?> [COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE member_accounts SET uCoins = uCoins + 0.80 WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt betaald, er is 0,80 bij je saldo toegevoegd![/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]error:[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
}[/COLOR]
?> En waar maak je verbinding met de database?
Sjoerd schreef:In de config.phpEn waar maak je verbinding met de database?
Maar als ik deze included krijg ik de volgende error:
Warning: include(config.php) [function.include]: failed to open stream: No such file or directory in /home/vandijk/domains/btg4cash.nl/public_html/pages/betaald.php on line 2
Warning: include() [function.include]: Failed opening config.php for inclusion (include_path=.:/usr/local/lib/php) in /home/vandijk/domains/btg4cash.nl/public_html/pages/betaald.php on line 2 No such file.............. duidelijk dus.
En trouwens, dit is geen fatsoenlijke foutafhandeling.
Kijk eerst maar eens wat je mysql_query doet() true false, if else statement erom heen.
pseudocode:
En trouwens, dit is geen fatsoenlijke foutafhandeling.
Kijk eerst maar eens wat je mysql_query doet() true false, if else statement erom heen.
pseudocode:
[COLOR= #0000BB]<?php
$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT blah bla FROM bla WHERE blah blah"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #FF8000]// gelukt[/COLOR]
[COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]// neuh mysql_error() tonen.[/COLOR]
[COLOR= #007700]}[/COLOR]
?> Aarclay schreef:En trouwens, dit is geen fatsoenlijke foutafhandeling.No such file.............. duidelijk dus.
Kijk eerst maar eens wat je mysql_query doet() true false, if else statement erom heen.
pseudocode:
[COLOR= #0000BB]<?php
$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT blah bla FROM bla WHERE blah blah"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #FF8000]// gelukt[/COLOR]
[COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]// neuh mysql_error() tonen.[/COLOR]
[COLOR= #007700]}[/COLOR]
?> error:Access denied for user apache@localhost (using password: NO)
Maar als ik config.php included, doet die ook niets?
Terwijl die file toch écht bestaat.
staat je database-connectie ook in je config?
Ennee, blijkbaar bestaat het bestand niet op de juiste plek.
Ennee, blijkbaar bestaat het bestand niet op de juiste plek.
Bedankt allen, ik heb het voor elkaar gekregen.
Heb hele inhoud van de config in de betaald pagina gezet.
toevoeging op 16 april 2012, 20
28:
Bedankt!
Heb hele inhoud van de config in de betaald pagina gezet.

toevoeging op 16 april 2012, 20
28:Aarclay schreef:Gelukt, zie bericht hierboven.staat je database-connectie ook in je config?
Ennee, blijkbaar bestaat het bestand niet op de juiste plek.
Bedankt!
Los hiervan:
Is er ook een mogelijkheid om een pagina onzichtbaar te maken?
Als een gebruiker nu naar http://btg4cash.nl/pages/betaald.php gaat, krijgt die gewoon 0.80 cent erbij.
Is er ook een mogelijkheid om een pagina onzichtbaar te maken?
Als een gebruiker nu naar http://btg4cash.nl/pages/betaald.php gaat, krijgt die gewoon 0.80 cent erbij.
kijken of een sessie gezet is? unieke code meegeven aan URL en die na gebruik verwijderen.
Aarclay schreef:Kun je dit uitleggen?kijken of een sessie gezet is? unieke code meegeven aan URL en die na gebruik verwijderen.
Want kom dr niet uit na try and error.
om te voorkomen dat iedereen die pagina kan laden, plaats je er toch een sessie in?
Kijken of of de sessie bestaat met isset() zo ja, uitvoeren, zo nee.. niet uitvoeren.
Kijken of of de sessie bestaat met isset() zo ja, uitvoeren, zo nee.. niet uitvoeren.