• 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 Database Strict Mode

insert multiple rows in a saveall in cakephp

Adding reCAPTCHA v2 into my PHP file

How can I make Laravel return a custom error for a JSON REST API

Jquery DataTables: Data not displaying in table via Ajax

PHP Array split string and Integers

How to skip cart page on woocomerce for certain products only?

Inserting data into SQL Server Db An Invalid direction was specified

Spam Filter in Contact Form

How to break out of a foreach once a condition is met?

I want a way to give path to my files which are outside of public folder in laravel

PHP's array_map including keys

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

Group data in a multidimensional array based on two columns

What will the best solution for this multiple optional filter?

About Contact Privacy policy Terms and conditions