Help: Referencing Articles in Form Action=" " to run PHP

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
cacard
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Nov 09, 2009 4:12 pm

Help: Referencing Articles in Form Action=" " to run PHP

Post by cacard » Mon Nov 09, 2009 4:52 pm

Good morning,

I am having a bit of a problem creating a team record page for my swim team.

On the page I have a form which will allow users to input a sex (male, female) and an age group. The form action is supposed to reference the page it's on in order to run the embedded PHP script and report the team records for that particular age group.

I can get the script to work outside of Joomla however I am having trouble setting up the form action in Joomla to reference the article it is on and thus pass the user entered variables to the script. Right now the action references /index.php?sex=XXX&age=XXX instead of the article itself. Nothing I try is working.

I've done a bunch of searching and cant find an answer on the forms. I apologize if some of you have answered this question many times before but I'm really stuck.

the website is at http://www.wellesley-masters.com

Thank you,
Chris

User avatar
nailson_imgn
Joomla! Guru
Joomla! Guru
Posts: 729
Joined: Wed Apr 15, 2009 5:33 pm
Location: Fortaleza, CE - Brasil

Re: Help: Referencing Articles in Form Action=" " to run PHP

Post by nailson_imgn » Mon Nov 09, 2009 5:13 pm

Set a form action to something like this: index.php?option=com_content&view=article&id=2 where 2 should be replaced by your article id. Then the article can get the variables via get or post or whatever. Hope it helps...
.
Nailson Oliveira
Técnico de Tecnologia da Informação - Desenvolvedor Joomla!
-----------------------------------------------------------------------------------------

cacard
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Nov 09, 2009 4:12 pm

Re: Help: Referencing Articles in Form Action=" " to run PHP

Post by cacard » Mon Nov 09, 2009 7:45 pm

Thank you very much. The fix ended up being exactly what I was doing with the exception of installing DirectPHP to allow php in articles. Things are running smoothly now, thanks for verifying!

patllakja2011
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Dec 21, 2011 12:34 pm

Re: Help: Referencing Articles in Form Action=" " to run PHP

Post by patllakja2011 » Wed Dec 21, 2011 3:23 pm

hello, i have done the same thing, exept i have installed sourcerer and it gives me an error like
Illegal variable _files or _env or _get or _post or _cookie
what can i do to fix this

sheerkoshan
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Apr 24, 2012 10:56 am

Re: Help: Referencing Articles in Form Action=" " to run PHP

Post by sheerkoshan » Mon Jul 15, 2013 9:26 pm

hi there

when I put content of a php file into a joomla content page , the php embeded codes between html code , don't work and they are shown in the page .

what should i do to get all codes run correctly ?

much thanks in advance


Locked

Return to “Joomla! 1.5 Coding”