[php] Verkeerde url

Pagina: 1
Acties:
  • 50 views sinds 30-01-2008

  • XippIX
  • Registratie: Augustus 2001
  • Niet online
Ik heb dit scriptje gemaakt:

code:
1
2
3
4
5
6
7
8
9
10
function kapaf($tekst,$aantal,$id) {
global $PHP_SELF;

  if (strlen($tekst) > $aantal) {
    $kort = substr($tekst,0,$aantal);
    $lastspace = strrpos($kort," ");
    if($lastspace) { $kort = substr($kort,0,$lastspace); }
    $kort .= " <A href=\"" . $PHP_SELF . "/details.php?image_id=". $id . 
"\"><I>Meer</I></A>";
  }


Het is dus de bedoeling dat je op "meer" klikt je een andere pagina met meer details te zien krijgt.

Als ik dan op "meer" klik dan krijg ik dus b.v.
http://www.deurl.com/bestand.php/details.php?image_id=1
Maar het moet dan worden:
http://www.deurl.com/details.php?image_id=1

Hoe krijg ik dit voor mekaar zonder dat ik elke keer die verkeerde url krijg :?

[ Voor 0% gewijzigd door XippIX op 23-10-2002 11:53 . Reden: typo ]


  • muba
  • Registratie: April 2002
  • Laatst online: 19-10-2013

muba

Prince of Persia!

gewoon, zonder $PHP_SELF. Ik weet niet zoveel van PHP maar probeer in die href gewoon te zetten "details.php?image_id="... enzo.

Reporter: Mister Gandhi, what do you think of western civilisation?
Gandhi: I think it would be a good idea


  • smaij
  • Registratie: November 2000
  • Laatst online: 00:20
$PHP_SELF is iets heel anders.. doe
PHP:
1
2
3
<?php
 phpinfo();
?>

en gij zult zien

  • thomaske
  • Registratie: Juni 2000
  • Laatst online: 14-07 14:28

thomaske

» » » » » »

Brusselmans: "Continuïteit bestaat niet, tenzij in zinloze vorm. Iets wat continu is, is obsessief, dus ziekelijk, dus oninteressant, dus zinloos."


  • BasieP
  • Registratie: Oktober 2000
  • Laatst online: 19-10-2025
of gewoon erg basic href="../details.php?basldfas=sf"

This message was sent on 100% recyclable electrons.


  • DiNo!
  • Registratie: Juni 2000
  • Laatst online: 30-08 17:00
Waarschijnlijk voldoet dit wel......
PHP:
1
2
3
<?php
$url = "$_SERVER['HTTP_HOST']/details.php?image_id=$id";
?>

https://github.com/atoomnetmarc/


  • XippIX
  • Registratie: Augustus 2001
  • Niet online
BasieP schreef op 23 oktober 2002 @ 12:25:
of gewoon erg basic href="../details.php?basldfas=sf"
werkt niet helaas, dat andere "dirname"ben ik nu aan het proberen maar snap het nog niet helemaal hoe het precies in zijn werk gaat

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Met dirname lezen in de manual, kom je er wel uit.

suc6

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz

Pagina: 1

Dit topic is gesloten.