[PHP] Side-effect ? [PHP}

Gestart doorAlexnder9 reacties40 weergaven

10 berichten · pagina 1 van 1

Alexnder

Lid · Topicstarter

Berichten
1.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb deze code:

<table width="600">
 <tr>
  <td><b><font size="2" face="Verdana">Gebruikersnaam</font></b></td>
  <td><b><font size="2" face="Verdana">Punten</font></b></td>
  <td><b><font size="2" face="Verdana">Rank</font></b></td>
 </tr>
 [COLOR= #0000BB]<?php
 $sql[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #DD0000]"SELECT * FROM `leden`"[/COLOR][COLOR= #007700]);[/COLOR]
 [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/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_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])) {[/COLOR]
     [COLOR= #0000BB]$gebruikersnaam[/COLOR] [COLOR= #007700]=[/COLOR] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]gebruikersnaam[COLOR= #007700]);[/COLOR]
     [COLOR= #0000BB]$punten[/COLOR] [COLOR= #007700]=[/COLOR] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]punten[COLOR= #007700]);[/COLOR]
     [COLOR= #0000BB]$rank[/COLOR] [COLOR= #007700]=[/COLOR] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]rank[COLOR= #007700]);[/COLOR]
 
  [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$punten[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<tr>
"[/COLOR][COLOR= #007700];[/COLOR]
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td><font size=2><a href=profiel.php?n=$gebruikersnaam>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$gebruikersnaam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</a></font></td>
"[/COLOR][COLOR= #007700];[/COLOR]
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td><font size=2>Deze persoon heeft geen punten</font></td>
"[/COLOR][COLOR= #007700];[/COLOR]
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td><font size=2>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rank[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</font></td>
"[/COLOR][COLOR= #007700];[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</tr>
"[/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]"<tr>
"[/COLOR][COLOR= #007700];[/COLOR]
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td><font size=2><a href=profiel.php?n=$gebruikersnaam>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$gebruikersnaam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</a></font></td>
"[/COLOR][COLOR= #007700];[/COLOR]
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td><font size=2>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$punten[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</font></td>
"[/COLOR][COLOR= #007700];[/COLOR]
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td><font size=2>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rank[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</font></td>
"[/COLOR][COLOR= #007700];[/COLOR]

   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</tr>
"[/COLOR][COLOR= #007700];
  }
 }[/COLOR]
 ?>
</table>
</tr></td></table>


Maar ik krijg steeds deze fout:

Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0

Weet iemand hoe ik dit weg kan krijgen?
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Weet je zeker dat het aan deze code ligt? De error heeft het over sessions en die gebruik jij in dit stukje code niet
0
Alexnder

Lid · Topicstarter

Berichten
1.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dit is de hele pagina dus dat lijkt me wel ja

Hier is de config:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$host[/COLOR] [COLOR= #007700]=[/COLOR]  [COLOR= #DD0000]"***"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Host[/COLOR]
[COLOR= #0000BB]$dbuser[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"***"[/COLOR][COLOR= #007700];[/COLOR]  [COLOR= #FF8000]// Gebruikersnaam[/COLOR]
[COLOR= #0000BB]$dbpass[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"***"[/COLOR][COLOR= #007700];[/COLOR]  [COLOR= #FF8000]// Wachtwoord[/COLOR]
[COLOR= #0000BB]$dbname[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"***"[/COLOR][COLOR= #007700];[/COLOR]  [COLOR= #FF8000]// Database[/COLOR]
[COLOR= #0000BB]$homepage[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"***"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// website[/COLOR]

[COLOR= #0000BB]$connection[/COLOR] [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]$dbuser[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$dbpass[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$db[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$dbname[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$connection[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$get_gegevens[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$gegevens[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$get_gegevens[/COLOR][COLOR= #007700]);[/COLOR]
?>


Want hier deze word geinclude maar verder word er niks aan deze pagina geinclude ofzo
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Zet voor regel 2 van je config eens // en probeer het dan opnieuw
0
Alexnder

Lid · Topicstarter

Berichten
1.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het script dat werkt nu weer smile
0
Alexnder

Lid · Topicstarter

Berichten
1.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Srry er ging iets fout bloos
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat was de fout dan?
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wss

[gebruikersnaam]

ipv

->gebruikersnaam

omdat je anders gekke dingen gaat pointen
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kyron schreef:
Wss

[gebruikersnaam]

ipv

->gebruikersnaam
omdat je anders gekke dingen gaat pointen

Nee,
Object is wat anders als assoc met fetchen van Mysql Data..
Als je object gebruikt kan je wel ->iets doen smile
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat zeg ik toch?
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