Php probleem

Gestart doorMikek11 reacties39 weergaven

12 berichten · pagina 1 van 1

Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb een probleem met php.
In mijn script wil ik dat je op de link klikt dat hij dan naar het id gaat.
Dit is mijn script:

<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM CMS_kenzo ORDER BY id DESC"[/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_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]))
  {[/COLOR]

[COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Bericht[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/str_replace"]str_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ubb[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$html[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Bericht[/COLOR][COLOR= #007700]]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<h3>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Onderwerp[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</h3>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"&nbsp;"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Naam[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]","[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Tijd[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"uur"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"&nbsp;"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href="[/COLOR][COLOR= #007700]..[/COLOR]/nieuws/[COLOR= #007700]?[/COLOR]id[COLOR= #007700]=[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">lees het hele artikel</a>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<br />"[/COLOR][COLOR= #007700];

  }[/COLOR]
?>
</html>


Alvast bedankt.

Mvg, MikeK
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het moet sowieso ..nieuws.php?id= zijn, en niet nieuws/?id= want dat gaat niet werken volgens mij.
0
Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja wel want het is nieuws(demap)/index.php?id=
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan moet je wel nieuws/index.php?id= doen volgens mij hoor.smile
0
Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
echo "<a href="../nieuws?id=.$row[id].">lees het hele artikel</a>";


zo toch dan?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Josnl schreef:
Dan moet je wel nieuws/index.php?id= doen volgens mij hoor.smile
Nope. Index is niet perse nodig. Als er geen file wordt opgegeven laad hij standaard index.html of index.php in. Dan vraagt dat bestand vervolgens de $_GET[]s op. Dus index.php hoeft niet perse.
0
Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@marjolein
krijg dit:
Parse error: syntax error, unexpected . lijn 24
0
Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dat komt door die ../nieuws volgens mij.

echo "<a href="/nieuws?id=.$row[id].">lees het hele artikel</a>";


zo of anders de gehele url?
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Verander regel 24 in:

echo "<a href=../nieuws/?id=".$row[id].">lees het hele artikel</a>";
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Marjolein schreef:
dat komt door die ../nieuws volgens mij.

echo "<a href="/nieuws?id=.$row[id].">lees het hele artikel</a>";


zo of anders de gehele url?
Nee, het komt door het feit dat hij echoot met ", maar ook zijn href met " doetwink
0
Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ty dankje
0
Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Eleky schreef:
Nee, het komt door het feit dat hij echoot met ", maar ook zijn href met " doetwink
oja...dat had ik niet gezien tnx smile Heb ik ook weer wat geleerd yummie
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