add var to a href in file where this var is loaded from database
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
add a comment |
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
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
add a comment |
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
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
php html mysql session
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
"<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;
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
add a comment |
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;
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
"<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;
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
add a comment |
"<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;
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
add a comment |
"<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;
"<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;
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
add a comment |
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
add a comment |
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;
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
add a comment |
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;
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
add a comment |
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;
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;
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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