• 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

Add record for each array elements if missing in table

How can I get data from PHP to Android TextView?

insert multiple rows in a saveall in cakephp

How to use React Router with Laravel?

Detect emoticons in string

Merge column values from two arrays to form an indexed array of associative arrays

Read users and passwords from a txt file

Dropzone: Submit both form data and dropzone at once

How to get transaction details in notify_url page in paypal

how to youtube api data to print in toolset metabox using a button click before save-post

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

Symfony 4: how to allow dynamic values for array nodes in bundle configuration?

How to keep value of selected value after form submission?

How to convert the int value to inch in PHP [closed]

User pool client {id}does not exist

About Contact Privacy policy Terms and conditions