Is there a more elegant way to do this?
Posted: Thu Jan 16, 2003 7:30 am
Hi
I have a simple guestbook script that I've written that works from mySQL. When a user follows a link to the guestbook (gbook.php) it displays an "Add a New Entry" section which is a form and in the code below that is the request to mySQL for all the entries so the user can read previous entries. The 2 sections (add new entry and view previous entries) are all on one script, i.e. no includes. The form is just before the <?php section starts.
But my problem is this...
When a user adds a new entry, my form submits the form entries to another php script (gbookadd.php) that opens in a new window. That script makes the addition and tells the user to close the newly opened window and refresh the previous one to see their new entry.
This isn't very elegant, is there a more elegant way to do this that doesn't require either a)a new window opening or b)the user having to refresh the previous page to see their submission.
This is written for integration into a PHP-nuke site so I'm a bit wary of using includes because to load the site properly you have to use http://your-site-address/folder/modules.php?name=G-book or whatever.
Thanks in advance for any help
I have a simple guestbook script that I've written that works from mySQL. When a user follows a link to the guestbook (gbook.php) it displays an "Add a New Entry" section which is a form and in the code below that is the request to mySQL for all the entries so the user can read previous entries. The 2 sections (add new entry and view previous entries) are all on one script, i.e. no includes. The form is just before the <?php section starts.
But my problem is this...
When a user adds a new entry, my form submits the form entries to another php script (gbookadd.php) that opens in a new window. That script makes the addition and tells the user to close the newly opened window and refresh the previous one to see their new entry.
This isn't very elegant, is there a more elegant way to do this that doesn't require either a)a new window opening or b)the user having to refresh the previous page to see their submission.
This is written for integration into a PHP-nuke site so I'm a bit wary of using includes because to load the site properly you have to use http://your-site-address/folder/modules.php?name=G-book or whatever.
Thanks in advance for any help