.htaccess probleem

Gestart doorWouter17 reacties29 weergaven

18 berichten · pagina 1 van 2

Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Beste One2xsers

Voor de afgewerkte versie van klikspel.eu zit ik met een .Htaccess-probleem.
Ik heb dus klikmissies die een gebruiker zelf kan aanmaken enzo...

http://www.***.***/dealer.php?dealer=demo&p=klik_1&id=1
heb ik via volgende code in htaccess
RewriteRule ^(.*)/klik_1.php?id=(.*) dealer.php?dealer=$1&p=klik_1&id=$2 [L]
proberen om te vormen naar
http://www.***.***/demo/klik1.php?id=1

Maar als ik naar
http://www.***.***/demo/klik1.php?id=1 ga, dan geeft hij als foutmelding:
Deze klikmissie is niet actief!

Als ik ga naar
http://www.***.***/dealer.php?dealer=demo&p=klik_1&id=1 , geeft hij deze foutmelding niet!

[COLOR= #0000BB]<?php

$bannerid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]);[/COLOR]

[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM klikmissies WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$bannerid[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]" AND game="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$game[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$object[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700])){[/COLOR]
    [COLOR= #0000BB]$actief[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$object[/COLOR][COLOR= #007700]->[/COLOR]actief[COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$url[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$object[/COLOR][COLOR= #007700]->[/COLOR]url[COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$nu[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$object[/COLOR][COLOR= #007700]->[/COLOR]nu[COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$opbrengst[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$object[/COLOR][COLOR= #007700]->[/COLOR]opbrengst[COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$maximaal[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$object[/COLOR][COLOR= #007700]->[/COLOR]maximaal[COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$actief[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"1"[/COLOR][COLOR= #007700]){[/COLOR] [COLOR= #FF8000]//actiefcontrole[/COLOR]
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE `klikmissies` SET nu=nu+1 WHERE `id` = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$bannerid[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]" AND game="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$game[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$nu[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]$maximaal[/COLOR][COLOR= #007700]){[/COLOR] [COLOR= #FF8000]//maximaalcontrole[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE `klikmissies` SET actief=0 WHERE `id` = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$bannerid[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]" AND game="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$game[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
    }[/COLOR]
    [COLOR= #0000BB]$date[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Ymd"[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$result2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM kmkliks WHERE userid = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$guser[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]" AND banner = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$bannerid[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]" AND date = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$date[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]" AND game="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$game[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result2[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]){[/COLOR]
        [COLOR= #FF8000]//als alles klopt[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO kmkliks (id,userid, banner, date, game) VALUES (NULL, "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$guser[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$bannerid[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$date[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$game[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/print"]print[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE `deal_leden` SET saldo=saldo+$opbrengst WHERE `user` = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$guser[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]" AND game="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$game[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Je punten zijn bijgeschreven, je wordt nu doorgestuurd!"[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<meta http-equiv="refresh" content="0;URL="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$url[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"">"[/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]"Je hebt vandaag al geklikt!"[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<meta http-equiv="refresh" content="0;URL="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$url[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"">"[/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]"Deze klikmissie is niet actief!"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
echo eens $_GET[id]. Wat laat ie zien?
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
RewriteRule ^(.*)/klik_1.php?id=(.*)$ dealer.php?dealer=$1&p=klik_1&id=$2 [L]

dit moet werken en ander probeer dit eens:

RewriteRule ^([^/_]+)/klik_1.php?id=([^/_]+)$ dealer.php?dealer=$1&p=klik_1&id=$2 [L]
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
@ Rik, hij laat niets zien
@ Ttsam werkt niet
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
mag ik je hele code dan eens zien?
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Options +FollowSymlinks

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule ^(.*?)$ $1 [L] 

RewriteRule ^(.*)/klik_1.php?id=(.*)$ dealer.php?dealer=$1&p=klik_1&id=$2 [L]
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule ^(.*?)$ $1 [L]

ik snap dat deel daar boven even niet? Waarvoor moet dat dienen(ik denk dat dat de fout veroorzaakt)?
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Welk deel snap je niet?
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik snap niet waarvoor het dient en wat het toevoegd aan het eind resultaat.
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Als ik dat weglaat, werkt heel mijn htaccess niet meer clown
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
<Files .htaccess>
order allow,deny
deny from all
</Files>
RewriteEngine on
RewriteRule ^(.*)/klik_1.php?id=(.*)$ dealer.php?dealer=$1&p=klik_1&id=$2


Probeer deze dan eens, ik heb hem als eens gebruikt(nou ja ongeveer)
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Deze werkt ook niet emo
Graag vanaf nu allen dingen zeggen als je weet dat ze werken... nooo
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik laat wel een script van mij zien, misschien heb je daar wat aan:

<Files .htaccess>
order allow,deny
deny from all
</Files>
ErrorDocument 401 http://localhost/schoolkrant/error.htm // alle error paginas
ErrorDocument 403 http://localhost/schoolkrant/error.htm
ErrorDocument 404 http://localhost/schoolkrant/error.htm
ErrorDocument 500 http://localhost/schoolkrant/error.htm
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
RewriteCond %{REQUEST_URI} !.css$
RewriteCond %{REQUEST_URI} !.js$
RewriteCond %{REQUEST_URI} !img/(.*).
RewriteCond %{REQUEST_URI} !admin/(.*).
RewriteRule ^nieuws.htm$ news.php
RewriteRule ^nieuws/([^/_]+).htm$ news.php?a=$1
RewriteRule ^error.htm$ error.php
RewriteRule ^registreren.htm$ register.php
RewriteRule ^wachtwoord-vergeten.htm$ forgot.php
RewriteRule ^aanmelden.htm$ login.php
RewriteRule ^afmelden.htm$ logout.php

RewriteRule ^instellingen.htm$ edit.php
RewriteRule ^wachtwoord.htm$ edit.pass.php

RewriteRule ^([^/_]+).html$ page.php?root=$1
RewriteRule ^([^/_]+)/([^/_]+).html$ page.php?root=$1&sub=$2
RewriteRule ^([^/_]+)/([^/_]+)/([^/_]+).html$ page.php?root=$1&sub=$2&page=$3
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Het probleem is niet dat mijn .htaccess niet werkt, het probleem is dat hij om en of andere reden het id niet vind!
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je zegt zelf dat als je het via het aangepaste url doet, het niet werkt. En via het onaagepaste url het wel werkt? Dan moet het wel aan de htaccess bestand liggen.
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