Hi,
I am using Joomla 1.0
If I have link to a chronoengine form in one of my articles, how can I get the article title to passed to a text field to the chronoengine form.
Example.
Article Title = "How to make great forms"
In the above article I have a link that says "Contact me for more details", when the user clicks on this link, the "How to make great forms" get passed to a text (html) field.
I can code the html I just want to know how to get the "Article Title".
Again, I am using Joomla 1.0
I am using Joomla 1.0
If I have link to a chronoengine form in one of my articles, how can I get the article title to passed to a text field to the chronoengine form.
Example.
Article Title = "How to make great forms"
In the above article I have a link that says "Contact me for more details", when the user clicks on this link, the "How to make great forms" get passed to a text (html) field.
I can code the html I just want to know how to get the "Article Title".
Again, I am using Joomla 1.0
Hi narswa,
Please search the forums; this has been posted and solved in the last week.
Bob
Please search the forums; this has been posted and solved in the last week.
Bob
here:
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=11976#p21234
you will need to remove the $database line and replace it with : global $database;
Cheers
Max
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=11976#p21234
you will need to remove the $database line and replace it with : global $database;
Cheers
Max
Thanks for the link. However, I am getting an error (see below). Here is what my php looks like.
Again I am using Joomla 1.0, not sure if the JRequest is for 1.5 only.
ERROR:
Again I am using Joomla 1.0, not sure if the JRequest is for 1.5 only.
<?php
global $database;
$query = "SELECT * FROM #__content WHERE id='".JRequest::getVar('id')."'";
$database->setQuery( $query );
$article = $database->loadObject();
echo $article->title;
?> ERROR:
Fatal error: Class 'JRequest' not found in /home/idahoea2/public_html/components/com_chronocontact/chronocontact.html.php(76) : eval()'d code on line 3
Hi narsaw,
Yes, JRequest is Joomla 1.5 only. For 1.0 use WHERE id='".$_POST['id']."'";
Bob
Yes, JRequest is Joomla 1.5 only. For 1.0 use WHERE id='".$_POST['id']."'";
Bob
Please pardon my inexperience here.
Here is the code I have:
This code is in my chrono form. Obviuosly this code expects the $_POST[id] to contain some "id" to use in querying the database to get the article title.
My question is, where is this id coming from, in other words how does it get into the $_POST array for processing?
I thought about setting up a link like:
When I click on this link my query looks like:
So what I need is a way to sending a chronoForm an article title or article id. The article title or id would come from the current article that the user is viewing.
Here is the code I have:
<?php
global $database;
$query = "SELECT title from jos_content WHERE id='".$_POST['id']."'";
echo query;
$database->setQuery($query);
$title = $database->loadResult();
echo "Loading Title...";
echo $title;
?>
This code is in my chrono form. Obviuosly this code expects the $_POST[id] to contain some "id" to use in querying the database to get the article title.
My question is, where is this id coming from, in other words how does it get into the $_POST array for processing?
I thought about setting up a link like:
http://www.example.com/someForm.php?id=341When I click on this link my query looks like:
SELECT title from jos_content WHERE id=, notice id is left empty.So what I need is a way to sending a chronoForm an article title or article id. The article title or id would come from the current article that the user is viewing.
hi, try to replace $_POST with $_REQUEST ?
Max
Max
This topic is locked and no more replies can be posted.
