add var to a href in file where this var is loaded from database





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







-1















I want the var fam_id in the a href as a session var



$sql = "SELECT * FROM kinderen WHERE fam_id between $fammin and $fammax order by fam_id"; 
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<tr>
<td><a href='kindtwee.php'>". $row["fam_id"] ." </a></td>
<td>". $row["naam"] ."</td><td>". $row ["vnaam"] ."</td>
<td>". $row ["pnaam"] ." </td>
<td>". $row ["pvnaam"] ."</td>
</tr>";
}
}









share|improve this question

























  • Unclear! Do you want to put $row["fam_id"] into a session var? Or do you want to use a session var instead of $row["fam_id"]

    – RiggsFolly
    Nov 23 '18 at 11:07


















-1















I want the var fam_id in the a href as a session var



$sql = "SELECT * FROM kinderen WHERE fam_id between $fammin and $fammax order by fam_id"; 
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<tr>
<td><a href='kindtwee.php'>". $row["fam_id"] ." </a></td>
<td>". $row["naam"] ."</td><td>". $row ["vnaam"] ."</td>
<td>". $row ["pnaam"] ." </td>
<td>". $row ["pvnaam"] ."</td>
</tr>";
}
}









share|improve this question

























  • Unclear! Do you want to put $row["fam_id"] into a session var? Or do you want to use a session var instead of $row["fam_id"]

    – RiggsFolly
    Nov 23 '18 at 11:07














-1












-1








-1








I want the var fam_id in the a href as a session var



$sql = "SELECT * FROM kinderen WHERE fam_id between $fammin and $fammax order by fam_id"; 
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<tr>
<td><a href='kindtwee.php'>". $row["fam_id"] ." </a></td>
<td>". $row["naam"] ."</td><td>". $row ["vnaam"] ."</td>
<td>". $row ["pnaam"] ." </td>
<td>". $row ["pvnaam"] ."</td>
</tr>";
}
}









share|improve this question
















I want the var fam_id in the a href as a session var



$sql = "SELECT * FROM kinderen WHERE fam_id between $fammin and $fammax order by fam_id"; 
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<tr>
<td><a href='kindtwee.php'>". $row["fam_id"] ." </a></td>
<td>". $row["naam"] ."</td><td>". $row ["vnaam"] ."</td>
<td>". $row ["pnaam"] ." </td>
<td>". $row ["pvnaam"] ."</td>
</tr>";
}
}






php html mysql session






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 13:38









Funk Forty Niner

1




1










asked Nov 23 '18 at 11:00









mademamadema

11




11













  • Unclear! Do you want to put $row["fam_id"] into a session var? Or do you want to use a session var instead of $row["fam_id"]

    – RiggsFolly
    Nov 23 '18 at 11:07



















  • Unclear! Do you want to put $row["fam_id"] into a session var? Or do you want to use a session var instead of $row["fam_id"]

    – RiggsFolly
    Nov 23 '18 at 11:07

















Unclear! Do you want to put $row["fam_id"] into a session var? Or do you want to use a session var instead of $row["fam_id"]

– RiggsFolly
Nov 23 '18 at 11:07





Unclear! Do you want to put $row["fam_id"] into a session var? Or do you want to use a session var instead of $row["fam_id"]

– RiggsFolly
Nov 23 '18 at 11:07












2 Answers
2






active

oldest

votes


















0














"<tr><td><a href='kindtwee.php?session=$row[fam_id]'>". $row["fam_id"] ." </a></td>


You can access it with $_REQUEST variable. Although if you want it as sessionID why not store it in session variable which can be accessed on your website everywhere:



 $_SESSION['id'] = $fam_id;





share|improve this answer


























  • what is the $fam_id here?

    – Brindha Baskaran
    Nov 23 '18 at 11:11













  • typo, just change it to one you want to be assigned to that session variable.

    – WKoppel
    Nov 23 '18 at 12:25



















0














this will solve you issue



"<tr><td><a href='kindtwee.php?session=$row[fam_id]'>". $row["fam_id"] ." </a></td>";


kindtwee.php:



 $fam_id="";
if(isset($_REQUEST['session'])){
$fam_id=$_REQUEST['session'];
}

$_SESSION['id'] = $fam_id;





share|improve this answer
























  • Thank you very much, It works wonderfull. 1 week I've lost chearching.

    – madema
    Nov 25 '18 at 14:47











  • Welcome. Please accept the answer

    – Brindha Baskaran
    Nov 26 '18 at 11:47












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53445432%2fadd-var-to-a-href-in-file-where-this-var-is-loaded-from-database%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














"<tr><td><a href='kindtwee.php?session=$row[fam_id]'>". $row["fam_id"] ." </a></td>


You can access it with $_REQUEST variable. Although if you want it as sessionID why not store it in session variable which can be accessed on your website everywhere:



 $_SESSION['id'] = $fam_id;





share|improve this answer


























  • what is the $fam_id here?

    – Brindha Baskaran
    Nov 23 '18 at 11:11













  • typo, just change it to one you want to be assigned to that session variable.

    – WKoppel
    Nov 23 '18 at 12:25
















0














"<tr><td><a href='kindtwee.php?session=$row[fam_id]'>". $row["fam_id"] ." </a></td>


You can access it with $_REQUEST variable. Although if you want it as sessionID why not store it in session variable which can be accessed on your website everywhere:



 $_SESSION['id'] = $fam_id;





share|improve this answer


























  • what is the $fam_id here?

    – Brindha Baskaran
    Nov 23 '18 at 11:11













  • typo, just change it to one you want to be assigned to that session variable.

    – WKoppel
    Nov 23 '18 at 12:25














0












0








0







"<tr><td><a href='kindtwee.php?session=$row[fam_id]'>". $row["fam_id"] ." </a></td>


You can access it with $_REQUEST variable. Although if you want it as sessionID why not store it in session variable which can be accessed on your website everywhere:



 $_SESSION['id'] = $fam_id;





share|improve this answer















"<tr><td><a href='kindtwee.php?session=$row[fam_id]'>". $row["fam_id"] ." </a></td>


You can access it with $_REQUEST variable. Although if you want it as sessionID why not store it in session variable which can be accessed on your website everywhere:



 $_SESSION['id'] = $fam_id;






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 23 '18 at 11:10

























answered Nov 23 '18 at 11:03









WKoppelWKoppel

346213




346213













  • what is the $fam_id here?

    – Brindha Baskaran
    Nov 23 '18 at 11:11













  • typo, just change it to one you want to be assigned to that session variable.

    – WKoppel
    Nov 23 '18 at 12:25



















  • what is the $fam_id here?

    – Brindha Baskaran
    Nov 23 '18 at 11:11













  • typo, just change it to one you want to be assigned to that session variable.

    – WKoppel
    Nov 23 '18 at 12:25

















what is the $fam_id here?

– Brindha Baskaran
Nov 23 '18 at 11:11







what is the $fam_id here?

– Brindha Baskaran
Nov 23 '18 at 11:11















typo, just change it to one you want to be assigned to that session variable.

– WKoppel
Nov 23 '18 at 12:25





typo, just change it to one you want to be assigned to that session variable.

– WKoppel
Nov 23 '18 at 12:25













0














this will solve you issue



"<tr><td><a href='kindtwee.php?session=$row[fam_id]'>". $row["fam_id"] ." </a></td>";


kindtwee.php:



 $fam_id="";
if(isset($_REQUEST['session'])){
$fam_id=$_REQUEST['session'];
}

$_SESSION['id'] = $fam_id;





share|improve this answer
























  • Thank you very much, It works wonderfull. 1 week I've lost chearching.

    – madema
    Nov 25 '18 at 14:47











  • Welcome. Please accept the answer

    – Brindha Baskaran
    Nov 26 '18 at 11:47
















0














this will solve you issue



"<tr><td><a href='kindtwee.php?session=$row[fam_id]'>". $row["fam_id"] ." </a></td>";


kindtwee.php:



 $fam_id="";
if(isset($_REQUEST['session'])){
$fam_id=$_REQUEST['session'];
}

$_SESSION['id'] = $fam_id;





share|improve this answer
























  • Thank you very much, It works wonderfull. 1 week I've lost chearching.

    – madema
    Nov 25 '18 at 14:47











  • Welcome. Please accept the answer

    – Brindha Baskaran
    Nov 26 '18 at 11:47














0












0








0







this will solve you issue



"<tr><td><a href='kindtwee.php?session=$row[fam_id]'>". $row["fam_id"] ." </a></td>";


kindtwee.php:



 $fam_id="";
if(isset($_REQUEST['session'])){
$fam_id=$_REQUEST['session'];
}

$_SESSION['id'] = $fam_id;





share|improve this answer













this will solve you issue



"<tr><td><a href='kindtwee.php?session=$row[fam_id]'>". $row["fam_id"] ." </a></td>";


kindtwee.php:



 $fam_id="";
if(isset($_REQUEST['session'])){
$fam_id=$_REQUEST['session'];
}

$_SESSION['id'] = $fam_id;






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 23 '18 at 11:16









Brindha BaskaranBrindha Baskaran

9711




9711













  • Thank you very much, It works wonderfull. 1 week I've lost chearching.

    – madema
    Nov 25 '18 at 14:47











  • Welcome. Please accept the answer

    – Brindha Baskaran
    Nov 26 '18 at 11:47



















  • Thank you very much, It works wonderfull. 1 week I've lost chearching.

    – madema
    Nov 25 '18 at 14:47











  • Welcome. Please accept the answer

    – Brindha Baskaran
    Nov 26 '18 at 11:47

















Thank you very much, It works wonderfull. 1 week I've lost chearching.

– madema
Nov 25 '18 at 14:47





Thank you very much, It works wonderfull. 1 week I've lost chearching.

– madema
Nov 25 '18 at 14:47













Welcome. Please accept the answer

– Brindha Baskaran
Nov 26 '18 at 11:47





Welcome. Please accept the answer

– Brindha Baskaran
Nov 26 '18 at 11:47


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53445432%2fadd-var-to-a-href-in-file-where-this-var-is-loaded-from-database%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

RAC Tourist Trophy