• 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

php curl_exec() Connection refused when retrieving a remote image

how can I set a session variable in Drupal 8 and get it in a php script?

Laravel Schedule not sending email

PHP: Convert any string to UTF-8 without knowing the original character set, or at least try

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in

get data-value with variable value

enable Apache http Authorization header

How to put php code inside opening and closing shortcodes

How can I make a full text index of the column?

Custom add to cart button URL for specific product in WooCommerce?

How to fix bootstrap multiselect search data using ajax

php: command not found Command PhaseScriptExecution failed with a nonzero exit code

how to get value from array in laravel

How to set dynamic `home` and `siteurl` in WordPress?

renameColumn migration fails for existing column with columns does not exist error

About Contact Privacy policy Terms and conditions