• 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

Yii2 redirecting to previous page after login

Laravel-fopen: failed to open stream: Permission denied

Laravel eloquent update record without loading from database

How to fix bootstrap multiselect search data using ajax

yii2 and mssql insert varbinary into model

PHP array sort and remove duplicates by two field values

MISSING UPDATES FOR: MEDIA Drupal 9

How to validate tin and cst using PHP?

PHP: PDO + CSV export not downloading (headers issue?)

Elastic Beanstalk with Laravel Envoy

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

Insert database rows from columns of data from associative array of indexed arrays

How do I set the maximum php memory limit

how to remove %20 in the url in php

Reading input in php from terminal

About Contact Privacy policy Terms and conditions