Kurmak ve bir url değerleri almak nasıl

3 Cevap

Ben böyle bir url değerleri ayarlamak istiyorum:

<a href='http://$data_url/viewyournote.php?chapter='$name_of_chapter'&note='$id_note'&user='$username'>

Sonra recieving sayfasından sonra kapmak mümkün.

Tıklandığında hemen almak her im şudur:

http://localhost/readnotes/viewyournote.php?chapter=

3 Cevap

Ben size kodu link embed yok nasıl, ama <?php ?> etiketleri dışında ise, o zaman yapmanız gereken:

<a href="http://<?php echo $data_url ?>/viewyournote.php?chapter=<?php echo $name_of_chapter ?>&note=<?php echo $id_note ?>&user=<?php echo $username?>" >

bu etiketleri içinde ise, siz de yapabilirsiniz:

echo  "<a href='http://$data_url/viewyournote.php?chapter=$name_of_chapter&note=$id_note&user=$username?' >";

Sen $_GET['variable_name_here'], örneğin ile recieveing ​​sayfasında bu değerleri alabilirsiniz $_GET['chapter'].

Sorgu dizesi kullanın

$ Val = "yourvalue";

$ Url "http://localhost/readnotes/viewyournote.php?chapter = $ val";

Şimdi $ val belirtilen url geçirilir.

Orada $ _GET ['bölüm'] kullanarak bunu alabilir, Size "yourvalue" verecek

Hattınıza ile değiştirin

<?php
echo "<a href='http://$data_url/viewyournote.php?chapter='$name_of_chapter'&note='$id_note' user='$username'>";
 ?>

Alıcı son kullanıma

<?php
$name_of_chapter = $_GET['chapter'];
...
?>