Creating page when form submitted
I have created a module for drupal.
I has 3 files: .install, .info , .module
In .install file I have written the code so that the table creates automatically.
In .module file I have lots of forms so I don't want to paste it here. So user inputs it's name, etc. I click submit and it is saved into my table in the database. Now I have function repman_submissions()
which i use to display data into a table.
My question is this how can I when i click submit (when user inputs data) create a page that shows the data that is inputed and that you can later go to(lets say test.com/user).
It's like when you use add content it takes the title that you write and turnes in into a link ( a page ).
My problem is I don't know how to do that I have the data in database and I can show it like a table but I don't have a page for the specific data like lets say for a user name to be the link.
drupal
add a comment |
I have created a module for drupal.
I has 3 files: .install, .info , .module
In .install file I have written the code so that the table creates automatically.
In .module file I have lots of forms so I don't want to paste it here. So user inputs it's name, etc. I click submit and it is saved into my table in the database. Now I have function repman_submissions()
which i use to display data into a table.
My question is this how can I when i click submit (when user inputs data) create a page that shows the data that is inputed and that you can later go to(lets say test.com/user).
It's like when you use add content it takes the title that you write and turnes in into a link ( a page ).
My problem is I don't know how to do that I have the data in database and I can show it like a table but I don't have a page for the specific data like lets say for a user name to be the link.
drupal
What's the drupal version?!
– Muhammad Reda
Apr 9 '13 at 7:25
I have drupal 7.
– 2thecore
Apr 14 '13 at 6:41
add a comment |
I have created a module for drupal.
I has 3 files: .install, .info , .module
In .install file I have written the code so that the table creates automatically.
In .module file I have lots of forms so I don't want to paste it here. So user inputs it's name, etc. I click submit and it is saved into my table in the database. Now I have function repman_submissions()
which i use to display data into a table.
My question is this how can I when i click submit (when user inputs data) create a page that shows the data that is inputed and that you can later go to(lets say test.com/user).
It's like when you use add content it takes the title that you write and turnes in into a link ( a page ).
My problem is I don't know how to do that I have the data in database and I can show it like a table but I don't have a page for the specific data like lets say for a user name to be the link.
drupal
I have created a module for drupal.
I has 3 files: .install, .info , .module
In .install file I have written the code so that the table creates automatically.
In .module file I have lots of forms so I don't want to paste it here. So user inputs it's name, etc. I click submit and it is saved into my table in the database. Now I have function repman_submissions()
which i use to display data into a table.
My question is this how can I when i click submit (when user inputs data) create a page that shows the data that is inputed and that you can later go to(lets say test.com/user).
It's like when you use add content it takes the title that you write and turnes in into a link ( a page ).
My problem is I don't know how to do that I have the data in database and I can show it like a table but I don't have a page for the specific data like lets say for a user name to be the link.
drupal
drupal
edited Nov 13 '18 at 2:43
Cœur
17.6k9104145
17.6k9104145
asked Apr 8 '13 at 18:33
2thecore2thecore
398
398
What's the drupal version?!
– Muhammad Reda
Apr 9 '13 at 7:25
I have drupal 7.
– 2thecore
Apr 14 '13 at 6:41
add a comment |
What's the drupal version?!
– Muhammad Reda
Apr 9 '13 at 7:25
I have drupal 7.
– 2thecore
Apr 14 '13 at 6:41
What's the drupal version?!
– Muhammad Reda
Apr 9 '13 at 7:25
What's the drupal version?!
– Muhammad Reda
Apr 9 '13 at 7:25
I have drupal 7.
– 2thecore
Apr 14 '13 at 6:41
I have drupal 7.
– 2thecore
Apr 14 '13 at 6:41
add a comment |
1 Answer
1
active
oldest
votes
Implement the hook_menu and call the page callback function to display your data.
function mymodule_menu() {
$items['abc/def'] = array(
'page callback' => 'repman_submissions',
);
return $items;
}
function repman_submissions()($ghi = 0, $jkl = '') {
// code to display your data
}
Yeah i have that all ready. I have a menu and a link to my table of inputed content from the form. But i want let's say the subject to be the link. Lets say that the subject is green apple i want to link to be example.com/green_apple. So every time you inputed data into a form it will create a site whit the link that is taken from the subject.
– 2thecore
Apr 14 '13 at 7:04
You can use path_save function to generate path alias in D7, For D6 use path_set_alias.
– nit3ch
Apr 14 '13 at 7:41
add a comment |
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
});
}
});
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%2f15886387%2fcreating-page-when-form-submitted%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Implement the hook_menu and call the page callback function to display your data.
function mymodule_menu() {
$items['abc/def'] = array(
'page callback' => 'repman_submissions',
);
return $items;
}
function repman_submissions()($ghi = 0, $jkl = '') {
// code to display your data
}
Yeah i have that all ready. I have a menu and a link to my table of inputed content from the form. But i want let's say the subject to be the link. Lets say that the subject is green apple i want to link to be example.com/green_apple. So every time you inputed data into a form it will create a site whit the link that is taken from the subject.
– 2thecore
Apr 14 '13 at 7:04
You can use path_save function to generate path alias in D7, For D6 use path_set_alias.
– nit3ch
Apr 14 '13 at 7:41
add a comment |
Implement the hook_menu and call the page callback function to display your data.
function mymodule_menu() {
$items['abc/def'] = array(
'page callback' => 'repman_submissions',
);
return $items;
}
function repman_submissions()($ghi = 0, $jkl = '') {
// code to display your data
}
Yeah i have that all ready. I have a menu and a link to my table of inputed content from the form. But i want let's say the subject to be the link. Lets say that the subject is green apple i want to link to be example.com/green_apple. So every time you inputed data into a form it will create a site whit the link that is taken from the subject.
– 2thecore
Apr 14 '13 at 7:04
You can use path_save function to generate path alias in D7, For D6 use path_set_alias.
– nit3ch
Apr 14 '13 at 7:41
add a comment |
Implement the hook_menu and call the page callback function to display your data.
function mymodule_menu() {
$items['abc/def'] = array(
'page callback' => 'repman_submissions',
);
return $items;
}
function repman_submissions()($ghi = 0, $jkl = '') {
// code to display your data
}
Implement the hook_menu and call the page callback function to display your data.
function mymodule_menu() {
$items['abc/def'] = array(
'page callback' => 'repman_submissions',
);
return $items;
}
function repman_submissions()($ghi = 0, $jkl = '') {
// code to display your data
}
answered Apr 10 '13 at 6:54
nit3chnit3ch
16511
16511
Yeah i have that all ready. I have a menu and a link to my table of inputed content from the form. But i want let's say the subject to be the link. Lets say that the subject is green apple i want to link to be example.com/green_apple. So every time you inputed data into a form it will create a site whit the link that is taken from the subject.
– 2thecore
Apr 14 '13 at 7:04
You can use path_save function to generate path alias in D7, For D6 use path_set_alias.
– nit3ch
Apr 14 '13 at 7:41
add a comment |
Yeah i have that all ready. I have a menu and a link to my table of inputed content from the form. But i want let's say the subject to be the link. Lets say that the subject is green apple i want to link to be example.com/green_apple. So every time you inputed data into a form it will create a site whit the link that is taken from the subject.
– 2thecore
Apr 14 '13 at 7:04
You can use path_save function to generate path alias in D7, For D6 use path_set_alias.
– nit3ch
Apr 14 '13 at 7:41
Yeah i have that all ready. I have a menu and a link to my table of inputed content from the form. But i want let's say the subject to be the link. Lets say that the subject is green apple i want to link to be example.com/green_apple. So every time you inputed data into a form it will create a site whit the link that is taken from the subject.
– 2thecore
Apr 14 '13 at 7:04
Yeah i have that all ready. I have a menu and a link to my table of inputed content from the form. But i want let's say the subject to be the link. Lets say that the subject is green apple i want to link to be example.com/green_apple. So every time you inputed data into a form it will create a site whit the link that is taken from the subject.
– 2thecore
Apr 14 '13 at 7:04
You can use path_save function to generate path alias in D7, For D6 use path_set_alias.
– nit3ch
Apr 14 '13 at 7:41
You can use path_save function to generate path alias in D7, For D6 use path_set_alias.
– nit3ch
Apr 14 '13 at 7:41
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%2f15886387%2fcreating-page-when-form-submitted%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
What's the drupal version?!
– Muhammad Reda
Apr 9 '13 at 7:25
I have drupal 7.
– 2thecore
Apr 14 '13 at 6:41