Hier maak ik een inlogsysteem en post al me problemen die ik ermee heb : Meteen iets gevonden ik moet bovenaan elke pagina dit zetten :
Opmerking: ik ga er van uit dat je gebruik maakt van een index.php waarin je alle content include. In die index.php is dan reeds een database connectie aanwezig, en staat session_start() voor alle output.
Mocht dit niet het geval zijn:
Maak bovenaan iedere pagina een databaseconnectie
Plaats boven iedere pagina session_start() zodat de $_SESSION-variabelen overal bereikbaar zijn
Nu heb ik dit gedaan :
Dan geeft hij dit aan :
Fatal error: Cannot redeclare parse_ubb_emo() (previously declared in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/parser.php:3) in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/parser.php on line 40
Op deze pagina :
http://joeriwii.one2xs.nl/testing.php
Maar op joeriwii.one2xs.nl waar ik niks heb veranderd
Werkt het wel gewoon goed wat moet ik nu doen en is de code voor de rest goed?
Opmerking: ik ga er van uit dat je gebruik maakt van een index.php waarin je alle content include. In die index.php is dan reeds een database connectie aanwezig, en staat session_start() voor alle output.
Mocht dit niet het geval zijn:
Maak bovenaan iedere pagina een databaseconnectie
Plaats boven iedere pagina session_start() zodat de $_SESSION-variabelen overal bereikbaar zijn
Nu heb ik dit gedaan :
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]parser.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]// Database details[/COLOR]
[COLOR= #0000BB]$name_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"joeriwii_cpiscool"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Name of database[/COLOR]
[COLOR= #0000BB]$user_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"joeriwii_cpcool"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Username for database[/COLOR]
[COLOR= #0000BB]$pass_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"******"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Password for database[/COLOR]
[COLOR= #0000BB]$host_db[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Host for database[/COLOR]
[COLOR= #0000BB]$connect_db[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$host_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$user_db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pass_db[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]// Making connection to our database [/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$name_db[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$connect_db[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$achtergrond[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kleur[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/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]$achtergrond[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/setcookie"]setcookie[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"achtergrond"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$achtergrond[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Achtergrond verandert naar: "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$achtergrond[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$meta[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"<meta http-equiv="refresh" content="3;url=achtergrond2.php" />"[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Geen geldigen achtergrond."[/COLOR][COLOR= #007700];
}
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"<form method=POST action=achtergrond2.php>
<p>
<input type=radio value=#333333 checked name=kleur>Grijs<br>
<input type=radio name=kleur value=#666666>Grijzer<br>
<input type=radio name=kleur value=#999999>Grijst :P<br>
<input type=submit value=Submit name=submit>
</form>
"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="opmaak.css" />
<title>CPiscool | Voor alles over cp</title>
<script type="text/javascript">
function insertBBCode(elementID, bbCode)
{
if (typeof elementID === undefined || typeof bbCode === undefined) return;
if (document.getElementById(elementID)) {
var elementObject = document.getElementById(elementID);
if (document.selection) { // IE
elementObject.focus();
var sel = document.selection.createRange();
sel.text = bbCode;
} else if (elementObject.selectionStart || elementObject.selectionStart == 0) {
var startPos = elementObject.selectionStart;
var endPos = elementObject.selectionEnd;
elementObject.value = elementObject.value.substring(0, startPos) + bbCode + elementObject.value.substring(endPos, elementObject.value.length);
} else {
elementObject.value += bbCode;
}
elementObject.focus();
}
}
</script>
</head>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$meta[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<body bgcolor="[/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]$HTTP_COOKIE_VARS[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"achtergrond"[/COLOR][COLOR= #007700]])) {[/COLOR][URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"#363636"[/COLOR][COLOR= #007700]; }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$HTTP_COOKIE_VARS[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]achtergrond[/COLOR][COLOR= #007700]];}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]">"[/COLOR][COLOR= #007700];[/COLOR]
?>
<div id="header"></div>
<div id="menu"> <h1> <a title="home" href="index.php" target="_self" class="menu">Home</a> |
<a title="Nieuws" href="nieuws.php" target="_self" class="menu">Nieuws</a> |
<a title="CP-paginas" href="paginas.php" target="_self" class="menu">CP-paginas</a> |
<a title="Adverteren" href="Adverteren.php" target="_self" class="menu">Adverteren</a>|
<a title="Inloggen" href="inloggen.php" target="_self" class="menu">Inloggen</a> |
<a title="Berichtenbalk" href="plaats.php" target="_self" class="menu">Berichtenbalk</a> |
<a title="Contact" href="contact.php" target="_self" class="menu">Contact</a> |
<a title="Settings" href="achtergrond2.php" target="_self" class="menu">Instellingen</a> |
</h1> </div>
<div id="content">
<div id="leftcontent">
<div id="leftcontentheader"></div>
<div id="leftcontentachtergrond"><h2>Welkom</h2>
<h3>
Welkom op CPiscool we hebben onderhoud
<br>
</h3></div>
<div id="leftcontentfooter"></div></div>
<div id="rightcontent"><h2>Log In </h2> <h3> Binnenkort kan je hier inloggen </h3></div></div>
<div id="berichtenbg">
<div id="berichten"><h6><marquee>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]weergeef.php[/COLOR][COLOR= #007700]);[/COLOR] ?></marquee></h6></div></div>
<div id="footer"><h6> Clubpenguinissupercool - alle rechten voorbehouden, niet kopieren, voor vragen mailen naar CPISC@Live.be</h6></div>
</body>
</html> Dan geeft hij dit aan :
Fatal error: Cannot redeclare parse_ubb_emo() (previously declared in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/parser.php:3) in /home/joeriwii/domains/joeriwii.one2xs.nl/public_html/parser.php on line 40
Op deze pagina :
http://joeriwii.one2xs.nl/testing.php
Maar op joeriwii.one2xs.nl waar ik niks heb veranderd
Werkt het wel gewoon goed wat moet ik nu doen en is de code voor de rest goed?
Gewoon aanmelden , uitloggen en registreren

