Re: credit card issue

From: Date: Mon, 04 Dec 2000 12:10:38 +0000
Subject: Re: credit card issue
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-28558@lists.php.net to get a copy of this message
> I did use > <script language="javascript"> > self.location.replace( "/path/to/url/url_to_use.php" ); > </script> > by putting it between the head tag and the page keep refreshing itself like > a non stop looping. I figure this part of javascript would need to be put > elsewhere in the form but not know where should it be? Of course, you're right try changing your form tab to something like <form onSubmit='self.location.replace( "/path/to/url/url_to_use.php" );'> although this won't necessarily transfer your POST variables and therefore may be of limited value. > And alternatively I did try > <script language="javascript"> > request.reset; > </script> > and "request" is the name of the form. It return error says "request is > undefined". Any suggest? You'll have to consult the DOM (Document Object Model) on this one, the name of the form could be deeply buried. The following should get you started; <html> <head> <title>Untitled</title> </head> <body> <form name="foo"> <input name="the_text" type="text" value="bar"> </form> <input type="button" value="reset form" onClick="foo.reset();"> <input type="button" value="change text" onClick="foo.the_text.value = 'Hi';"> </body> </html> a reasonable knowledge of javascript is invaluable for a PHP programmer. Server side is only half the answer. Cheers, Brad P.S. I'm very surprised that Dave's solution was not appropriate (this is probably the best solution). Perhaps the solution is to rename your file whatever.php or whatever.phtml as the server should instruct any client not to cache a file of type "application/x-httpd-php" anyway I believe. Hmmm..... strange days. P.P.S. Thanks for the code BTW Dave, saves typing it in, as I have done on many occasions 'cause I'm too lazy to write a class that will save me many keystrokes. Go figure huh? On the whole a very elegant solution.

« previous php.general (#28558) next »