Re: Saving css state in javascript and passing to php via form submit
| From: | Tijnema ! | Date: | Mon, 16 Apr 2007 19:21:11 +0000 |
| Subject: | Re: Saving css state in javascript and passing to php via form submit | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-253050@lists.php.net to get a copy of this message | ||
On 4/16/07, Tim <user@internet46.fr> wrote:
... You could use AJAX to get things from/to PHP, but why should you? You can use session within javascript too i believe.I would use an iframe for this.Didn't test following code, but shoudl work though. <iframe name="imgupload"></iframe> <form action="upload.php" method="post" target="imgupload" enctype="multipart/form-data"> <input type="file"><input type="submit" value="upload"></form> and now just make sure that your upload.php script doesn't return anything, or it will be displayed inside the iframe :) If you want to know when upload is done, you should check that through AJAX. you could give the upload an unique number, and store the results of the upload in a database for example, then request that id once in 10 seconds lets say, and when it's done it will return something useful :) Tijnema... Really, it's not that hard to use AJAX. You might want to look at www.tizag.com, there it is really easy explained. It's nothing more then making new request to scripts inside javascript. Was a great idea and also works great until the moment i needed to upload images :P You have a suggestion for that by any chance Tijnema? Regards, TimTijnema ps. Maybe you could also use AJAX instead of submitting forms the whole time.