• 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 Startup: Unable to load dynamic library 'openssl' in Ubuntu

php echo remove slashes from url [duplicate]

Target Individual Form Instance/Counter Inside A PHP While Loop

Implode columnar values between two arrays into a flat array of concatenated strings

json_encode turns array into an object

PHP | "The requested PHP extension bcmath is missing from your system."

Issue with laravel eloquent model property

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

Get lat/lon from google maps url ftid (hex)

How can I remove the "Advanced" panel of all blocks in WordPress block editor?

Assign output of PHP function to a variable

Laravel 5.5 change unauthenticated login redirect url

disable two buttons after clicking another button

how to retrieve the first and last instance of a row in pdo dataset

Why is this PHP array not the same?

About Contact Privacy policy Terms and conditions