Forum Moderators: mack

Message Too Old, No Replies

How does one do a partial page refresh?

Reloading a GD-generated image with a verification code

         

aragornking

9:29 pm on Nov 7, 2003 (gmt 0)

10+ Year Member



Hi. I am requiring visitors to a guestbook to first enter a code embedded in a GD-library created image order to submit their guestbook entries. Occasionally the fonts in the code may not very readable (for enhanced security), and I would like the visitor to be able to selectively refresh the image (to get a more legible code) without refreshing the entire page (and having to retype their name and comment entires).

May I ask which would be the best way to go about accomplishing this? I could either refresh the whole page while somehow turning off deletion of the visitor's entries. Or, I could place the image+code in a separate frame, with its own refresh capability.

I should add that this is a PHP-based (+ HTML) effort.

Thanks for reading this,
Eugene

hakre

11:16 pm on Nov 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi aragornking,

if you don't wont to be bound to javascript or similar, just put a second submit button with the name "refresh" into that form.

if the user clicks that 'refresh' submit button, then in you php script the variable $refresh will be set. so you can check with isset if the refresh button has been pressed and you can re-display the form with the values the user already put in (because these were submitted either).

so this is a solution which is php based.

aragornking

7:17 am on Nov 9, 2003 (gmt 0)

10+ Year Member



Thanks Hakre. I must be misunderstang you, or perhaps you may have missed the point of my request. I need to "simply" refresh the verification code in the image. A second submit button does generate a new code while retaining the unsubmitted form entries. The problem is I want to avoid the warnings that one must necessarily generate for each incomplete required entry. I know this sounds like nitpicking, but I would like to do the job right.