Ik heb de volgende PHP code:
En als ik ga naar DOMEIN.NL/csi ga, dan krijg ik deze errors:
Er is geen pagina csi.php maar dan word ie dus doorgestuurd naar prog.php?p=csi. Maar die pagina kan hij niet vinden.
Het gekke hieraan is, als ik naar DOMEIN.NL/prog.php?p=csi ga, dan krijg ik die pagina gewoon...
Voor als het bruikbaar zou zijn, prog.php heeft de volgende code:
Even in eht kort: Prog.php werkt wel als je m gewoon bezoekt, maar nietmeer als hij geincluded is...
Weet iemand wat hieraan te doen valt??
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]])) {[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]home.php[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]]==[/COLOR] home[COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]home.php[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000].php[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000].php[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]prog.php?p=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]];
}[/COLOR]
?> En als ik ga naar DOMEIN.NL/csi ga, dan krijg ik deze errors:
Warning: include(prog.php?p=CSI) [function.include]: failed to open stream: No such file or directory in /home/hftmaeyc/domains/tvfan.be/public_html/content.php on line 9
Warning: include(prog.php?p=CSI) [function.include]: failed to open stream: No such file or directory in /home/hftmaeyc/domains/tvfan.be/public_html/content.php on line 9
Warning: include() [function.include]: Failed opening prog.php?p=CSI for inclusion (include_path=.:/usr/local/lib/php) in /home/hftmaeyc/domains/tvfan.be/public_html/content.php on line 9 Er is geen pagina csi.php maar dan word ie dus doorgestuurd naar prog.php?p=csi. Maar die pagina kan hij niet vinden.
Het gekke hieraan is, als ik naar DOMEIN.NL/prog.php?p=csi ga, dan krijg ik die pagina gewoon...
Voor als het bruikbaar zou zijn, prog.php heeft de volgende code:
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/include_once"]include_once[/URL][COLOR= #DD0000]config.inc.php[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$prog[/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]p[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #FF8000]// Get all the data from the "example" table[/COLOR]
[COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM *WEGGELATEN* WHERE naam="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$prog[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/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/echo"]echo[/URL] [COLOR= #DD0000]"<table border=1>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<tr> <th>Naam</th> <th>Leden</th> </tr>"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #FF8000]// keeps getting the next row until there are no more to get[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR] [COLOR= #0000BB]$result[/COLOR] [COLOR= #007700])) {[/COLOR]
[COLOR= #FF8000]// Print out the contents of each row into a table[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<tr><td>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</td><td>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]leden[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</td></tr>"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</table>"[/COLOR][COLOR= #007700];[/COLOR]
?> Even in eht kort: Prog.php werkt wel als je m gewoon bezoekt, maar nietmeer als hij geincluded is...
Weet iemand wat hieraan te doen valt??
.
Had ik niet gezien