Het generale PHP hulp topic!

Gestart doorWouterp1 reacties24 weergaven

2 berichten · pagina 1 van 1

Wouterp

Lid · Topicstarter

Berichten
1.631
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heeey,

Het leek me handig om een topic te hebben waar je snel word geholpen met je php problemen.

Regels
- Niet schelden
- Als iemand een tip geeft en niet werkt niet afsnauwen
- De normale one2xs regels.
- Niet slaan en schoppen coool- Codes op de volgende manier laten zien:
- Hulp gaat alleen via topic niet via PB of dergelijk.

[spoiler][code]SCRIPT[/code][/spoiler]


Om te beginnen
---------------------------------------------------------------------------------

Quote:
Wat voor systeem:
Notitie systeem

Probleem:
Weergeeft niet de geupdatede notitie maar degene die voor de update er was als je de pagina refresh dan weergeeft die hem wel goed.

Error:
Geen

Script:
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]

[COLOR= #FF8000]/**
 * @author      Wouter Polman
 * @copyright   2012
 * @link        Letsweb.nl
 * @version     1.0
 * @license     Personal
 */[/COLOR]
[URL="http://www.php.net/require"]require[/URL] [COLOR= #DD0000]connect.php[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT *
FROM  `gebruikers` 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]gebruiker[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]));[/COLOR]
[COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]]==[/COLOR][COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700])
{[/COLOR]
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE gebruikers SET notitie= "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]notitie[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" 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]gebruiker[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
}[/COLOR]
?>
<b>Vul hier jouw notitie in.</b>
<form method="post" >
<textarea cols="50" rows="10" wrap="virtual"  title="notitie" name="notitie">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]notitie[/COLOR][COLOR= #007700]]);[/COLOR] ?></textarea>
<input type="submit"  value="Opslaan" />
</form>
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Als mensen problemen hebben kunnen ze zelf een topic maken.
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