Jump to content


This topic is now archived and is closed to further replies.


Noob q "How do i dynamically hide an image and/or text?

Recommended Posts

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....


(a popop is also good but after the file transfer it needs to be closed..... i dont know either how to do that)

Share this post

Link to post
Share on other sites
I'm assuming the page reloads to submit the upload data to upload the file. In this case just add the hidden section in

if (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

Share this post

Link to post
Share on other sites
Thanks for the quick answer..

indeed thus is whats happening...

i now have the code

if (!isset ($_POST['submit'])){

form fields


include ("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

Share this post

Link to post
Share on other sites
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();

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.