Jump to content

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


westm003

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

Tnx!

(a popop is also good but after the file transfer it needs to be closed..... i dont know either how to do that)
Link to comment
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
Link to comment
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

else

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.