• 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

Hi, I am making a contact form thingy, and my php isn't working any reason why?

Laravel implode array items to new lines

Can't call javascript alert alertify library from PHP

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

Laravel after login Two factor not working

Upgrade PHP on AWS Linux

Add rows to Single product Additional information table in WooCommerce 3.6

how to see if database exists with PDO [duplicate]

Symfony redirect if already loggedin from login page

Can't exclude directories from .htaccess mobile redirect?

How to override header set in Apache config with more specific header in a virtual host

Facebook SDK error: Cross-site request forgery validation failed. Required param "state" missing from persistent data

Modify microseconds of a PHP DateTime object

How to loop a tree array with unknown depth and get array blocks?

Laravel: HTML in notification

About Contact Privacy policy Terms and conditions