• 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

RabbitMQ PRECONDITION_FAILED - unknown delivery tag

Need to display only array value in JSON output

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

Debugging Stripe Webhook Event

Sentry + Laravel: how to log an already catched Exception?

Laravel: Create morphs() relationship nullable

how to make my own auto increment in php?

How to disable only_full_group_by option in Laravel

How do I remove this delivery notification from here?

MySQL upgrade causing unexpected results on simple WHERE clauses

SMTP ERROR: MAIL FROM command failed: 530 5.7.0 Must issue a STARTTLS command first when using PHPMailer

MISSING UPDATES FOR: MEDIA Drupal 9

How to pass data to all views in Laravel 5?

Select option from dropdown menu with PHP and mySql

How to extract price from given url using Xpath?

About Contact Privacy policy Terms and conditions