westm003 Posted June 9, 2006 Share Posted June 9, 2006 I have a form in php if the form is submitted a scrolling gif is displayed and a the text "uploading"...How do i do such a thing...so as soon as the form is entered, unhide the text and gif file....Tnx!(a popop is also good but after the file transfer it needs to be closed..... i dont know either how to do that) Quote Link to comment https://forums.phpfreaks.com/topic/11567-noob-q-how-do-i-dynamically-hide-an-image-andor-text/ Share on other sites More sharing options...
joquius Posted June 9, 2006 Share Posted June 9, 2006 I'm assuming the page reloads to submit the upload data to upload the file. In this case just add the hidden section inif (isset ($_POST['submit'])) { }or which ever method you are using.If you want a popup you'd need to go java and open a new window to a specific upload script (redirect would have to include the data in the http_get_vars data, which would close the window (again with java) once the upload is done.Depends what you want Quote Link to comment https://forums.phpfreaks.com/topic/11567-noob-q-how-do-i-dynamically-hide-an-image-andor-text/#findComment-43575 Share on other sites More sharing options...
westm003 Posted June 9, 2006 Author Share Posted June 9, 2006 Thanks for the quick answer..indeed thus is whats happening...i now have the code if (!isset ($_POST['submit'])){form fieldselseinclude ("visitekaartjesbestellen/uploadsign.php");rest of code.... upload the files etc...The display never shows the uploadsign.php with the simpel gif and text it seems to only upload...I need to display this php file with the indicator and text as soon as they hit upload... (the else statement is executed)I guess include is wrong ha?Echo? popop?Tnx a 1.000.000 Quote Link to comment https://forums.phpfreaks.com/topic/11567-noob-q-how-do-i-dynamically-hide-an-image-andor-text/#findComment-43577 Share on other sites More sharing options...
joquius Posted June 9, 2006 Share Posted June 9, 2006 This is because the $_POST is taken at the top of the page. You would need to added the php upload code after the html is sent, and use a javascript header to avoid issues with a header(); Quote Link to comment https://forums.phpfreaks.com/topic/11567-noob-q-how-do-i-dynamically-hide-an-image-andor-text/#findComment-43580 Share on other sites More sharing options...
.josh Posted June 9, 2006 Share Posted June 9, 2006 when you click on the submit button, whatever is in your uploadsign.php will not be displayed until after all of the code is parsed in the whole file, which includes uploading all the files FIRST. Php is parsed on the server. the final result is sent to your browser. You cannot do an upload script soley with php. You will have to look into ajax for that, which is a mixture of php and javascript.p.s. - joquius, you can include a file anywhere in the script, as long as the included file does not contain any header functions. but even then, you can, if you use ob_start/flush. Quote Link to comment https://forums.phpfreaks.com/topic/11567-noob-q-how-do-i-dynamically-hide-an-image-andor-text/#findComment-43712 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.