Q: How to assign $_GET value via 'a href' This is what I've done so far, but the $_GET['c_id'] is not assigned (URL looks like this http://localhost/srs_stuff.php?c_id=
Results are surely stored in $r variable since c_name is normally displayed as clickable link with the name I want.
foreach ($results as $r) {
    echo "<a href='srs_stuff.php?c_id='" . $r['c_id'] . ">" . $r['c_name'] . "</a></br>";
}   

Even better solution would be, that the c_id would be set in SESSION variable, before redirection to new page. Is this possible?

A: 
 <a href='srs_stuff.php?c_id='" . $r['c_id'] 


HTML attribute values can be delimited by " or '. You are using '.
Your href value starts with srs_ and goes on until the next '.
The next ' is here id=': before the $r['c_id'] value.
Put your attribute delimiters in the right place (and use an HTML validator, which would pick up errors like this).

Better yet, don't generate URLs by mashing strings together and then generating HTML by mashing more strings together.
<?php
    $query_string = http_build_query(c_id => $r['c_id']);
    $url = "srs_stuff.php?" . $query_string;
    $html_safe_url = htmlspecialchars($url);
    $html_safe_name = htmlspecialchars($r['c_name']);
?>
    <a href="<?php echo $html_safe_url; ?>">
        <?php echo $html_safe_name; ?>
    </a>
    <br>


A: You are closing href attribute before assigning the value.
Corrected code:
<?php
$r['c_id'] = 234;
$r['c_name'] = 'Developer';
echo "<a href='srs_stuff.php?c_id=" . $r['c_id'] . "'>" . $r['c_name'] . "</a></br>";
?>

HTML output produced (source code):
<a href='srs_stuff.php?c_id=234'>Developer</a></br>

