Kleine Vragen Topic #1
Dan mag een ander zich hierover buigen. Ik weet het dan ook niet meer.
Ik ben meer bevriend met Multiviews wat makkelijker en minder foutgevoeliger werkt.
Ik ben meer bevriend met Multiviews wat makkelijker en minder foutgevoeliger werkt.
Aarclay schreef:Kan ik dat niet gebruiken/Dan mag een ander zich hierover buigen. Ik weet het dan ook niet meer.
Ik ben meer bevriend met Multiviews wat makkelijker en minder foutgevoeliger werkt.
Ja, een kwestie van $_SERVER[REQUEST_URI] uitpluizen en exploden op / in PHP. En MultiViews in htaccess aanzetten.
Genoeg documentatie etc op het wereldwijde web.
Genoeg documentatie etc op het wereldwijde web.
Marvin, je wilt dus alles achter de slash linken naar je index?
Kan je zo doen, heb ik ook gedaan in mijn CMS
Zo werkt het op mijn CMS, als een pagina zo bestaat (voorbeeld: contact.php) en je doet site.nl/contact gaat hij naar contact.php en niet naar index.php?page=contact
Kan je zo doen, heb ik ook gedaan in mijn CMS

RewriteEngine On
RewriteBase /
ErrorDocument 404 /404
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?page=$1
Options +FollowSymLinks +MultiViews Zo werkt het op mijn CMS, als een pagina zo bestaat (voorbeeld: contact.php) en je doet site.nl/contact gaat hij naar contact.php en niet naar index.php?page=contact
Thanx milan! Het werkt!
Bestaat er zo programma met waar mee je kan zien welke IP / web pagina een programma laad?
Kan je met Wireshark doen.
ik heb bij weebly een domein gekregen maar heb de nameservers veranderd,
hij deed het
maar toen ik bestande uploaden niet meer,
domein: Weexhosting.nl
Doet hij het bij jullie ook niet?
EDIT
laatmaar hij werkt
hij deed het
maar toen ik bestande uploaden niet meer,
domein: Weexhosting.nl
Doet hij het bij jullie ook niet?
EDIT
laatmaar hij werkt
Hoe kan ik met mijn database class makkelijk en goed in andere classes werken?
Met extends is het niet handig.
Dus hoe doen jullie dit??
Met extends is het niet handig.
Dus hoe doen jullie dit??
Met extend is het niet correct....
Je kan toch een include in je bootstrap doen, en dan een instance maken?
Je kan toch een include in je bootstrap doen, en dan een instance maken?
Freestyle schreef:Dependency injection...Hoe kan ik met mijn database class makkelijk en goed in andere classes werken?
Met extends is het niet handig.
Dus hoe doen jullie dit??
Hmm ik ben er naar opzoek en ik probeer het uit maar het wilt nog niet bepaald lukken.
Code:
Database.phpMijn builder:Ik krijg nu als error:
Weet iemand wat ik nu dan fout doe?
Code:
Database.php
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/class"]class[/URL] database [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/public"]public[/URL] [COLOR= #0000BB]$connection[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/public"]public[/URL] [COLOR= #007700]function[/COLOR] __construct[COLOR= #007700]([/COLOR][COLOR= #0000BB]$host[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$user[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pass[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$database[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]connection [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$host[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$user[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pass[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$con[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]connection [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$database[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$con[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$selectDb[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]connection[COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Couldnt select to database table"[/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]"Couldnt connect to Database"[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] getInstance[COLOR= #007700]() {[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]connection [COLOR= #007700]==[/COLOR] NULL[COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]connection [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]connection[COLOR= #007700];[/COLOR][COLOR= #FF8000]// init your database connection[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]connection[COLOR= #007700];
}
}[/COLOR]Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/class"]class[/URL] builder [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/private"]private[/URL] [COLOR= #0000BB]$get[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/private"]private[/URL] [COLOR= #0000BB]$root[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]pages/[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/private"]private[/URL] [COLOR= #0000BB]$ext[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000].php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/private"]private[/URL] [COLOR= #0000BB]$forbidden[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/private"]private[/URL] [COLOR= #0000BB]$error404[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/public"]public[/URL] [COLOR= #0000BB]$_db[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/public"]public[/URL] [COLOR= #007700]function[/COLOR] __construct[COLOR= #007700]([/COLOR][COLOR= #0000BB]$get[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$root[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$ext[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000][/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$forbidden[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/array"]array[/URL][COLOR= #007700](),[/COLOR] [COLOR= #0000BB]$error404[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]404[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/global"]global[/URL] [COLOR= #0000BB]$db[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]_db [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$db[/COLOR][COLOR= #007700]->[/COLOR]getInstance[COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]error404 [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$error404[/COLOR][COLOR= #007700];[/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]$ext[/COLOR][COLOR= #007700]))[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]ext [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$ext[/COLOR][COLOR= #007700];[/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]$root[/COLOR][COLOR= #007700]))[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]root [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$root[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/is_array"]is_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$forbidden[/COLOR][COLOR= #007700]))[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]forbidden [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$forbidden[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/is_array"]is_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$forbidden[/COLOR][COLOR= #007700]))[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]forbidden [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$forbidden[/COLOR][COLOR= #007700];[/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]$get[/COLOR][COLOR= #007700])) {[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]get [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$get[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]get [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"home"[/COLOR][COLOR= #007700];
}
}
}[/COLOR]Couldnt connect to Database
Fatal error: Using $this when not in object context in /home/admin/domains/marijnkok.nl/public_html/v3/lib/classes/database.php on line 28 Weet iemand wat ik nu dan fout doe?
Wat is overzichtelijker?
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
SELECT *
FROM users
WHERE lid = 377
"[/COLOR][COLOR= #007700]);[/COLOR]
?>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE lid = 377"[/COLOR][COLOR= #007700]);[/COLOR]
?> Wat vind je zelf? 
