• 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

How to add class name to an existing tag in php

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

How to remove Deprecated SymfonyComponentDebugDebugClassLoader?

Refresh specific HTML content that retrieves data from MySQL

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

Check If array is null or not in php

laravel 5.6 bulk inserting json data

using random function but it's displaying duplicates

Whats the point of running Laravel with the command 'php artisan serve'?

Create tags in laravel post publishing

Log file is not being written in Laravel 5.5

In PHP, which is faster: preg_split or explode?

WHERE IN array binding in DB::raw laravel 5.4

How to loop sql table data inside a html table

How to set time with DateTime modify?

About Contact Privacy policy Terms and conditions