Custom php file

Locked
sherwinaval
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Aug 21, 2007 6:37 am

Custom php file

Post by sherwinaval » Wed Dec 05, 2007 8:44 am

Hello po...

I have a php file basically a form for users to enter their details and when submitted, details will be saved in a database.

To be able to make the design the same as joomla, I've copied the html code generated in IE and pasted it in my php file. And so it was successful.

Now my prob is I want this php form to internally integrate it to joomla manageable from the admin module. This php form connects to a different database.

I've tried jumi but was having some problems with it. I've tried mod_php and it worked, but I want the php form to be displayed like as an article.

here's a link to the php form pageand here's a link using jumi.

Sana po may makatulong... thanks in advance

User avatar
Arpee
Joomla! Intern
Joomla! Intern
Posts: 86
Joined: Fri Apr 28, 2006 7:56 am
Location: /var/www/html/mambo_5.0
Contact:

Re: Custom php file

Post by Arpee » Wed Dec 05, 2007 11:24 am

you have three options as i see it.

1.Simple - Use a wrapper to display the php form

2.Intermediate - Create a new Link, Create a Copy of your Template which display the module position where the php form module is published in place of the mainbody.

3.Complicated - Create a dummy component by creating /administrator/components/com_dummy/dummy.xml and /components/com_dummy/dummy.php and paste your code to the dummy.php file..
Core Developer, MiaCMS - http://miacms.org/
Expertise: plunging outside my comfort zones and chewing a lot of pressure

sherwinaval
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Aug 21, 2007 6:37 am

Re: Custom php file

Post by sherwinaval » Wed Dec 05, 2007 2:50 pm

Hi Arpee.. thanks for the reply...

1) A wrapper won't be a good solution as I want to secure the page.

2) I've already created a link in joomla pointing to the Copy of the Template which is named as passprofdata.php. I'm not really sure if this is the one you were referring to.

3) If a create a dummy component, will this allow me to display the page as if it looks like an article? Coz as I understand it, the display locations of the components differ from how the article is displayed. If you could at least further explain what you mean. (And I think mod_php can do this already, the only thing is that mod_php cannot be displayed like an article.)

To further explain what I'm planning to do.

I want only registered users to view this page, and if the public tries to view the page directly, they will be redirected to the login page or just notify them that the page can only be viewed by registered members.

But if it's gonna make it difficult for me to integrate the entire php form with joomla I'm planning to at least put the code of joomla authentication inside the application. Anyhow, I still hope that there will still be an easy way to do this.

Thanks again.

hacksider
Joomla! Explorer
Joomla! Explorer
Posts: 283
Joined: Thu Feb 15, 2007 12:44 pm

Re: Custom php file

Post by hacksider » Thu Dec 06, 2007 7:04 am

If it is a custom form, I would suggest you using this
http://extensions.joomla.org/component/ ... Itemid,35/

or you can also see
http://extensions.joomla.org/component/ ... /cat_id,0/

hope that helps, and thanks for sending me a pm on TPC!
http://phoutsource.com/index.php/meet-o ... -team.html Kenneth Estanislao
Signature rules - Literal URL's Only.

User avatar
Arpee
Joomla! Intern
Joomla! Intern
Posts: 86
Joined: Fri Apr 28, 2006 7:56 am
Location: /var/www/html/mambo_5.0
Contact:

Re: Custom php file

Post by Arpee » Fri Dec 07, 2007 10:50 pm

sherwinaval wrote: Hi Arpee.. thanks for the reply...

1) A wrapper won't be a good solution as I want to secure the page.

2) I've already created a link in joomla pointing to the Copy of the Template which is named as passprofdata.php. I'm not really sure if this is the one you were referring to.

3) If a create a dummy component, will this allow me to display the page as if it looks like an article? Coz as I understand it, the display locations of the components differ from how the article is displayed. If you could at least further explain what you mean. (And I think mod_php can do this already, the only thing is that mod_php cannot be displayed like an article.)

To further explain what I'm planning to do.

I want only registered users to view this page, and if the public tries to view the page directly, they will be redirected to the login page or just notify them that the page can only be viewed by registered members.

But if it's gonna make it difficult for me to integrate the entire php form with joomla I'm planning to at least put the code of joomla authentication inside the application. Anyhow, I still hope that there will still be an easy way to do this.

Thanks again.
2.) Sorry i didnt explain that clearly.

Create a new Link, Create a Copy of your Template which display the module position WHERE the php form module is published in place of the mainbody. Then assign that new template to the new Link you just created. The effect is that the Module will display in the mainbody.. i hope that makes sense.

3.) I am not quite sure what you meant but i assume that when you say "look like an article" you mean "published/visible in the same area where articles are". If thats what you actually meant well my answer is yes. Item ID links can be assigned to Component Links and Components *may have their own page(or space in the mainbody) unlike modules which can only be displayed in module positions.
Core Developer, MiaCMS - http://miacms.org/
Expertise: plunging outside my comfort zones and chewing a lot of pressure

User avatar
Arpee
Joomla! Intern
Joomla! Intern
Posts: 86
Joined: Fri Apr 28, 2006 7:56 am
Location: /var/www/html/mambo_5.0
Contact:

Re: Custom php file

Post by Arpee » Fri Dec 07, 2007 10:56 pm

sherwinaval wrote: I want only registered users to view this page, and if the public tries to view the page directly, they will be redirected to the login page or just notify them that the page can only be viewed by registered members.

But if it's gonna make it difficult for me to integrate the entire php form with joomla I'm planning to at least put the code of joomla authentication inside the application. Anyhow, I still hope that there will still be an easy way to do this.

Thanks again.
you can accomplish this by simply putting in a code on top of your module/component for ex:

if(!$my-id){
    header('Location: http://www.example.com/');
}

or

if(!$my-id){
    echo "You need to be logged in to view this page";
    break;
}
Last edited by Arpee on Fri Dec 07, 2007 11:00 pm, edited 1 time in total.
Core Developer, MiaCMS - http://miacms.org/
Expertise: plunging outside my comfort zones and chewing a lot of pressure

sherwinaval
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Aug 21, 2007 6:37 am

Re: Custom php file

Post by sherwinaval » Sat Dec 08, 2007 5:10 am

thanks bossing hacksider and Arpee...

that last suggestion is the easiest  :D but will also try all your suggestions including the links that hacksider has suggested. Thanks for all the help will update this thread once problem solved. thanks again.

sherwinaval
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Aug 21, 2007 6:37 am

Re: Custom php file

Post by sherwinaval » Sat Dec 08, 2007 8:51 am

bossing hacksider, I've tried chrono forms, it is really a good component, but medyo lito pako hehehehe...

sir Arpee I've tried your suggestion in creating a dummy component (which I think will be best for my needs)...

Successfully I was able to apply your suggestion and just doing some modifications on the codes basically in database handling as it won't allow me to connect to a different database otherwise it will result to an error. It's already fixed though... anyways...

I think this solved my problem, though I'm still unsure until I'm finished with the whole thing. Thanks again to both of you bossing hacksider and sir Arpee for helping me out.

cheers :pop

gadgetdad
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Tue Jun 19, 2007 5:12 pm

Re: Custom php file

Post by gadgetdad » Wed Dec 19, 2007 10:36 pm

3.Complicated - Create a dummy component by creating /administrator/components/com_dummy/dummy.xml and /components/com_dummy/dummy.php and paste your code to the dummy.php file..
[/quote]

I have tried this.  I placed a empty file in  '/administrator/components/com_dummy/dummy.xml' and my php file in '/components/com_dummy/dummy.php' .  I dont see it in the admin menu under components.  Nor can I see it on the menu manager for an option to link to.

Any ideas?
Jim
_____
Some people are like a Slinky . . . not really good for anything, but you still can't help but smile when you shove them down the stairs.

sherwinaval
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Aug 21, 2007 6:37 am

Re: Custom php file

Post by sherwinaval » Mon Jan 14, 2008 8:06 am

I've got another problem.

How do i get the tinymce editor to appear in my custom component? without the need of manually including all the needed scripts to load tinymce?
gadgetdad wrote:
3.Complicated - Create a dummy component by creating /administrator/components/com_dummy/dummy.xml and /components/com_dummy/dummy.php and paste your code to the dummy.php file..
I have tried this.  I placed a empty file in  '/administrator/components/com_dummy/dummy.xml' and my php file in '/components/com_dummy/dummy.php' .  I dont see it in the admin menu under components.  Nor can I see it on the menu manager for an option to link to.

Any ideas?
[/quote]boss you won't be able to see it in admin module. You'll have to manually link it.

in my case i was using the seo address so it goes like http://yourdomain.com/component/option, ... rcomponent


Locked

Return to “International Support Center”