• 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

(Laravel) How to delete multiple models including optional relationships?

Laravel You requested 1 items, but there are only 0 items available

Make Calculator - When Button clicked the No shows in Textbox.

php retrieve specific data onclick from database in a list format

Call authenticate manually in router middleware

Symfony Make:Migration : The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue

How to MODIFY a Google Docs document via API using search-and-replace?

PHP each() function replacement

How can I pass the list to the component variable in Laravel?

Create tags in laravel post publishing

In PHP, which is faster: preg_split or explode?

How do I loop through an MS SQL database with VB.NET?

PHPExcel How to set conditional formatting to change cell background color based on cells values

How To Access A Column In M-M Relationship Table In Laravel

Group rows by column and sum another column within groups [duplicate]

About Contact Privacy policy Terms and conditions