how to use $_GET a html href=?asd

Wednesday, November 4, 2015

I have a html view what contains an input text and textarea. I've made a SQL query that gives back a link <a href="?asd">$row['title']</a>.



I'd like make a method where if I click the link, I load to in the html view.



if(isset($_GET['asd'])){//load to view}


I don't know how can I do this.



Here is the view:



public function note($title,$text){
?>
<html>
<head><title></title>
<link rel="stylesheet" href="view/style.css">
</head>
<body>


'>
'>






</body>
</html>

<?php

}


The link:



echo "<u><a href='?editnote'>".$title."</a></u>";


Load to view:



if(isset($_GET['editnote'])){
$id = $_SESSION['loggedInUser'];
$title = $model->getNameToSession("note","user_id",$id, 'title');
$text = $model->getNameToSession("note","user_id",$id, 'text');


$view->note($title,$text);


But I don't know how to load the sql result to view. I think my link is wrong, I read about href ans $_GET and I saw this: <a href="something.php?id=$row['id']">, but I don't know how I'd use it.



Can anyone help me figure this out?

0 comments:

Post a Comment