• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to get the ID of the link in another page in php

phpmysql


PHP Snippet 1:

<a href="show.php?ref=<?php 
  echo htmlspecialchars(urlencode($row['name']));
?>&id=<?php 
  echo htmlspecialchars(urlencode($id));
?>" 
id="<?php 
  echo htmlspecialchars($id);
?>"><?php 
  echo htmlspecialchars($id) . '.' . htmlspecialchars($row['name']); 
?></a>

PHP Snippet 2:

<?php

   //show.php?ref=5&id=10

   echo $_GET['ref'];
   //5

   echo $_GET['id'];
   //10

?>

PHP Snippet 3:

<?php echo $_GET["id"]; ?>

Related Snippets

Get latest Tweets - What API

WordPress Subquery returns more than 1 row on SELECT

Distribute array row data to make multiple new rows

PHP - CURL using HTTPS [closed]

Check if a string contain multiple specific words

Xdebug 3 not showing in phpinfo on m1 Monterey

How do I pass the dynamic output of a php variable or php function to a CSS variable?

wp_remote_get() not passing authentication

I want to store data in new index as per my key in php [duplicate]

Session timeout in Yii2

Laravel 8: Array to string conversion while calling route:list

Display the WooCommerce product price inside a custom function

how to loop through json response data using ajax jquery?

PHP date() with timezone?

how to fix Service provider class not found when using repository?

About Contact Privacy policy Terms and conditions