• 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

Appending data to an anchor tag

phphtml


PHP Snippet 1:

<a href="?ref=login_detail&id=<?php echo $car_id ?>">Hello</a>

PHP Snippet 2:

var_dump($_GET['id']);

PHP Snippet 3:

class Obj
{
    public function login_detail($id)
    {
        //do something with passed $id
        echo $id;
    }
}

(...)
$obj = new Obj();
$obj->login_detail($_GET['id']);

PHP Snippet 4:

class Obj
{
    public function login_detail($id)
    {
        echo $_GET['id'];
    }
}
$obj = new Obj();
$obj->login_detail();

Related Snippets

Laravel SQL query midnight time not showing

PHP header location absolute URL

How to submit the custom form data in database in WordPress without plugin using ajax?

Two buttons one form

I want to display default profile image if user do not have profile image

php mysql + create a friend request system

Make Shipping Method fields Mandatory on Woocommerce checkout page

How can I remove the "Advanced" panel of all blocks in WordPress block editor?

Laravel 8: Array to string conversion while calling route:list

PHPExcel export HTML table to xlsx

How can I make this nested location configuration use the correct path to call a php program?

Php - Sum up the numbers in an array one by one

PHP DOTENV unable to load env vars

How to check user Permissions using Custom Middleware in Laravel

how to check version of codeigniter framework?

About Contact Privacy policy Terms and conditions