Page 1 of 1
Opening php forms in main window from HTML code (Solved)
Posted: Wed 15. Mar 2006, 13:24
by Erubyr
Hi all,
I have written a HTML form to display a table containing records from a MySql DB in the main part of the PHPWCMS site, which works perfectly. Now I added next and previous (submit) buttons and try to use form method = post to open the same form again but show different records. The table currently contains just over 6000 records so I want to split them up in groups of 20.
When a submit button (next) is pressed and the form is calling itself a second time it does not open in the main part of the site but full screen and not using the template.
Can anyone tell me how I can open a form in the main part of the site properly?
Thanks,
Chris
[edit] typo
Posted: Thu 16. Mar 2006, 08:38
by Erubyr
OK, I have been going through the phpwcms-docu site and the source code of phpwcms and starting to understand. PHPWMCS is a pretty neat program, especially considering it is free of charge, compliments to Oliver. Also good to hear the news that a new version is about to be released.
The phpwcms website is just a table, so it is not possible to load your page in a part of it. As far as I understand now, the form is build in the index.php file by including the content.func.inc.php file where the table is build.
What I have been unable to find thusfar is how the screen is updated when a link in the navigation menu to the left or the breadcrumbs item on top of the main screen is clicked.
It seems to have something to do with cached items in the database but since this is only my second week programming in PHP I am unable to find the right part. I have been programming Visual Basic for a couple of years in the past, but PHP is something completely different.
Can anyone tell me how I could call the index.php or content.func.inc.php in such a way that the screen is refreshed and new data is shown in the content part shown from within my own php script?
Thanks in advance,
Chris
Solved
Posted: Tue 21. Mar 2006, 09:31
by Erubyr
OK, problem solved, I clearly still need to learn a lot about PHP.
Posted: Fri 28. Apr 2006, 18:00
by Lee H
I would love to know what you found out. I've been scouring the boards trying to find out how to do this myself.
Thanks
Posted: Fri 28. Apr 2006, 19:50
by Oliver Georgi
best practice is to use the external form using phpwcms' PHP includes. Then prepare your form to handel the target page - this always should be the same as where the form is displayed. Pagination can realized by sending POST values which is processed inside your custom form script. Or you can build the target phpwcms article URL with some additional GET values.
Oliver
Posted: Fri 28. Apr 2006, 20:36
by Lee H
Oliver, Thanks so much for personally responding to me. I know you're time is very valuable.
My eyes hurt from all the searching and reading, but I just came back to this post to say I have a answer. I found a post you did a 2 1/2 years ago. I tried the example you posted and it worked. Now I understand what I need to do. It was basically what you just now said, but there was a example posted. I am the kind of person that has to "do it" to understand.
Here's the post if it may help someone else.
http://www.phpwcms.de/forum/viewtopic.php?p=921#921
Respectfully,
Lee