Jump to content


Photo

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


  • Please log in to reply
4 replies to this topic

#1 westm003

westm003
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 09 June 2006 - 09:57 AM

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)

#2 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 09 June 2006 - 10:32 AM

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

#3 westm003

westm003
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 09 June 2006 - 10:41 AM

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

#4 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 09 June 2006 - 11:04 AM

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();
z..z..z..z..z..z..z..z..

#5 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 09 June 2006 - 04:33 PM

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.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users