How can I send parameters like
radios=oneway&asal=CGK&tujuan=DPS&pergi=2013-12-31&pulang=&dewasa=1&anak=0&bayi=0
into an joomla article which injected by my custom php script with "sourcerer"?
In my case, I want to create an custom php article like search engine for example, and pass its parameter to other joomla article which customed by my custom php. Can anyone help me?
Why you are trying to pass parameters in url,
You already mentioned your first article is Custom PHP it send to another article that is also custom PHP.
So just use First custom PHP have some forms and second have some variables that recieves from first one.
you can simply access any article like below,
something like
index.php?option=com_content&view=article&id=69&catid=14&Itemid=471
set this as form action with second article Id and catId the submitting first one send data to the second article.
If you have any doubt in Include HTML or PHP codes into Joomla article ,
Hope this makes clear.
Related
How to add AJAX code inside a Joomla article by using a third party module like Flexi Custom Code?
I have a form inside my article and want to make a submit for this form without refreshing the page.
I read some pages talking about this, but I did not understand how to.
We have written an exhaustive and easy to use guide on how to use Ajax in Joomla. You can find it here.
In short, you will need to create a function ending by "Ajax" in the module in question that will check for the submitted information and that will return an output according to the submitted information. A valid function name can be funcAjax. Just make sure you pass "func" as the "method" in the ajax URL call.
You can use free extension like sourcerer Using this plugin, you can very easily insert html and javascript codes inside article.
here is a video tutorial on how to use it. https://www.youtube.com/watch?v=LiFa1Jq8igQ
Can someone explain to me the exact steps on how to use the post function in Smarty PHP? I have to be leaving something out somewhere, and I'm not sure what. I'm workingin CMSMadeSimple and I want to post a variable from one form to another, except the variable doesn't exist in the first form. What are the steps I need to take to do this?
Clarification: I am using a module in CMSMS called FormBuilder. This module is accessing info from Products, another module. Now, these fields are what I'm trying to access. For instance, I am trying to pass info from the first form to a field in the second form which should be selected, where the name is "cntnt01" and the value is "205".
To assign the variable where it will be available to the first form, you need to call $smarty->assign() in the PHP script that produces the first form:
// Assuming your Smarty object is $smarty
$smarty->assign('variablename', $variablename);
I am trying to do something really basic but can not seem to find a tutorial for it.
I have created a simple web form using HTML what I need todo is create a php file that will read the web form, open a new browser window (or display in same page) the contents of the web form, do toy guys have any tutorials on this?
Many thanks
Chris
I'm sure many will post different links to tutorials that they like, but I thought I would just give you the basic. The key parts to the form are the method and action. The Method attribute tells ths browser how to submit the data, either through GET or POST. The action attribute tells the browser where to submit the form. (In your case it will be, somepage.php) If you ever need the form to submit back to itself, you can here use explicitly type the page name or you can use use PHP to dynamically insert the page name. Finally, make sure that all your form fields use the name attribute, as this is how php will access the elements.
On the php side of things, your form variables will be stored in either $_GET or $_POST depending on how on method you used to submit your form. For example, assume you have a input element of type text with the name 'FirstName'. Within php you can access this by doing
<?php
var firstName = $_GET['FirstName'];
?>
This should be enough to get you started. Be sure to check out the php docs and the other tutorials listed on this page for a more details.
Please look at this tutorial: http://www.learnphp-tutorial.com/HtmlForms.cfm
And you can find many more tutorials if you search it on Google.
This should help : http://www.php-mysql-tutorial.com/wikis/php-tutorial/php-forms.aspx
I know this is not a drupal forum but, as I’m not getting any response there, I decided to give it a shot here.
I’m creating a web site that accepts custom content from users. So, for that matter, this site has a form and a custom module. Instead of using admin theme, this form is placed inside custom template which is created to have a uniform look with the rest of the pages. As a result, creating form elements through hook_form is out of question. Here’s where my problems lie. As this form uses custom theme, I’m not sure as to what can I do to make drupal know that user is submitting new content data when the form is submitted?
Would I need to use same query string that of content submission page of admin page like - ?q=node/add/page for action attribute of the html form?
(OR)
the only way is to map the url to my custom function and invoke some sort of hook inside of it?
Thanks
You can literally create any markup you want for your form, all you need to do is use the #theme attribute when you define the form. With it you can set theme functions for the form itself and any of the elements.
It is a very bad idea, not to use Drupal's FAPI. It solves so many problems for you, and not using it would be the first step to take if you want to open up a security hole in your site. A development framework like Drupal is not of much worth, if you don't use it's APIs.
Edit:
First thing to do, is to go to Drupal's FAPI reference. You can learn almost everything about the FAPI there.
You could use a template if you want, is just basic Drupal theming, but I would advise against it. It would be a lot more maintainable if you created theming functions for all the elements and used that instead, you could just loop through all the elements and render them like Drupal does, instead of having to edit a template file each you need to change the form. It might be a but more work now, but there's a reward to that work: cleaner and more maintainable code.
In code it looks something like this:
$form['item'] = array(
...
'#theme' => 'theme_function',
);
Doing this, the element will be rendered using the "theme_function". You can see an example of such a theme function for textfields.
I'm building a website using Wordpress. The WP-Events plugin is being used to display a list of upcoming events. What I need is for people to be able to confirm their attendance at any particular event.
WP-Events is a bit awkward in that it's customised using a template that is only able to be edited with the Wordpress admin. I used this template in combination with the Wordpress 'Loop' to generate a form for each event that could be filled in and submitted. I then was going to use jquery to toggle the display of each form as to not make the page massive. This plan collapsed when I wasn't able to implement any form validation.
What I have now is a list of events on one page, and a confirmation form on another. What I now need is to pull the event name, date and location from the selected event, and pass them across for use in the form. The problem is that wordpress' permalink structure doesn't seem to allow me to add a variable (ie. example.php?variable=1 ).
It it possible to do this?
thanks in advance,
Greg.
Unless you modified something, out of the box Wordpress will allow you to use GET variables, because it uses them too (for previewing posts).
If you installed something that removed all of the GET parameters, you might want to uninstall that. But out of the box Wordpress will let you use GET parameters.
I have tried both GET and POST with no effect. If you have PHP processing a GET variable on a WP Page, the URL is:
/page/?variable=something
And PHP is not recognizing this at all.
Use add_query_arg function. Codex.