Hoe moet?

Gestart doorOne2xs4 reacties21 weergaven

5 berichten · pagina 1 van 1

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ik heb dit script:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]
?>
[COLOR= #0000BB]<?[/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]verzenden[/COLOR][COLOR= #007700]]))
{[/COLOR]
 
[COLOR= #0000BB]$woord1[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]woord1[/COLOR][COLOR= #007700]]);[/COLOR] 
[COLOR= #0000BB]$woord2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]woord2[/COLOR][COLOR= #007700]]);[/COLOR]  
 
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE woorden SET woord1="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$woord1[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]", woord2="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$woord2[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/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]
[COLOR= #0000BB]$qLid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM woorden 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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/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/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$aLid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qLid[/COLOR][COLOR= #007700]))[/COLOR]

[URL="http://www.php.net/print"]print[/URL] [COLOR= #DD0000]"<meta http-equiv=refresh content=2 />Aangepast!"[/COLOR][COLOR= #007700]; 
  }[/COLOR] 
[URL="http://www.php.net/else"]else[/URL] 
  [COLOR= #007700]{[/COLOR]
  ?>
  <center>
<form action="" method="POST">
Woord 1: <br><input type="text" name="woord1"><br /> 
Woord 2: <br><input type="text" name="woord2"><br />  
<input type="submit" name="verzenden" value="aanpassen"> 
</form> </center>
[COLOR= #0000BB]<?[/COLOR] 
  [COLOR= #007700]}[/COLOR] 
?>


Dan kan je iets in de tabel aanpassen, maar in de tekstvakken wil ik hebben welke tekst er momenteel in de tabel staat dus tekstveld met name woord1 laat tabel woord1 zien van het id. Kan iemand me helpen?
0
Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/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/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]])) {[/COLOR] 
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE woorden SET woord1="[/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]woord1[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", woord2="[/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]woord2[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is een fout opgetreden: [/COLOR][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]<meta http-equiv="refresh" content="2" />Aangepast![/COLOR][COLOR= #007700]; 
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$qLid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT woord1, woord2 FROM woorden 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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is een fout opgetreden: [/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();[/COLOR]
    [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aLid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qLid[/COLOR][COLOR= #007700])) {[/COLOR]
?>
<center>
    <form action="" method="POST">
        Woord 1: <br><input type="text" name="woord1" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$aLid[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]woord1[/COLOR][COLOR= #007700]];[/COLOR] ?>"><br /> 
        Woord 2: <br><input type="text" name="woord2" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$aLid[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]woord2[/COLOR][COLOR= #007700]];[/COLOR] ?>"><br />  
        <input type="submit" name="verzenden" value="Aanpassen"> 
    </form> 
</center>
[COLOR= #0000BB]<?php[/COLOR]
    [COLOR= #007700]}
}[/COLOR]
?>


Ik raad je trouwens af om te gebruiken.
Niet getest btw.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Jponsen schreef:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/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/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]])) {[/COLOR] 
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE woorden SET woord1="[/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]woord1[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", woord2="[/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]woord2[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is een fout opgetreden: [/COLOR][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]<meta http-equiv="refresh" content="2" />Aangepast![/COLOR][COLOR= #007700]; 
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$qLid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT woord1, woord2 FROM woorden 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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is een fout opgetreden: [/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();[/COLOR]
    [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aLid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qLid[/COLOR][COLOR= #007700])) {[/COLOR]
?>
<center>
    <form action="" method="POST">
        Woord 1: <br><input type="text" name="woord1" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$aLid[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]woord1[/COLOR][COLOR= #007700]];[/COLOR] ?>"><br /> 
        Woord 2: <br><input type="text" name="woord2" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$aLid[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]woord2[/COLOR][COLOR= #007700]];[/COLOR] ?>"><br />  
        <input type="submit" name="verzenden" value="Aanpassen"> 
    </form> 
</center>
[COLOR= #0000BB]<?php[/COLOR]
    [COLOR= #007700]}
}[/COLOR]
?>
Ik raad je trouwens af om te gebruiken.
Niet getest btw.

Parse error: syntax error, unexpected echo (T_ECHO) in /home/fanhabbo/domains/thahab.nl/public_html/***/pages/edit.php on line 5


toevoeging op 16 april 2012, 16:04:49:
Al gelukt! Slotje?
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoe heb je het nou opgelost?
0
Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bij de query or echo weg halen.
Had ook geen idee of dat werkte.
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