• 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

What is my SQL missing?

Read users and passwords from a txt file

How to convert time from one timezone to another in PHP

Object of class stdClass could not be converted to string error

How to use $this->session->set_userdata in codeigniter

Call to a member function givePermissionTo() on null

Too few arguments to function PendingResourceRegistration::name(),1 passed in C:xampphtdocsproject outesweb.php on line 18 and exactly 2 expected

How to create a scheduler application in php

OAuth2 Token PHP

Move a child array to parent array and change parent/child name

Access denied for user 'homestead'@'localhost' (using password: YES)

PHP only Hit Counter?

How to unlink image from folder?

Adding the custom page with add_menu_page function on Wordpress

How do I Post to .txt document before form submits

About Contact Privacy policy Terms and conditions