Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Images - Remove

images php coding issues or problems here.

Moderators: macek, egami, gesf

Images - Remove

Postby Alikan » Tue Jul 26, 2011 11:50 pm

:help:
Hi, I'm new to PHP, but I am familiar with another progaming laungage, so dont get to complex unless your good at explaining plz :D

I am trying to create a log in, and I want it to look fancy when you click the submit button, so I made a loading gif appear. I want it to wait 1 second, before removing itself. Im stuck on the removing part, as I dont know how to call the image, this is my PHP code:

Code: Select all
<?php
$Enter = $_POST['enter'];
$User = $_POST['user'];
$Pass = $_POST['pass'];

if (isset($_POST['enter'])) {
   echo "<img src='images/load.gif' name='img' width='220' height='19'>";
   sleep(3);
   imagedestroy(???);
}
?>


I will soon replace the sleep(3); with a database connection.

You can see that where I put the ??? is where im stuck on. If anyone could help, that would be great :D
Alikan
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Jul 26, 2011 11:20 pm

Re: Images - Remove

Postby NigelRen » Fri Aug 05, 2011 10:09 am

The problem is that the loading gif will only be displayed once the form is displayed. As your including the login code on the form - by the time the form is sent to the user, the login is already complete.
The time it takes to login should be tiny ( hopefully less than the 3 second sleep ), add in network delays and to be honest - I wouldn't bother with it.
A case of nice idea - but not really practical.
NigelRen
php-forum Active User
php-forum Active User
 
Posts: 450
Joined: Fri Aug 05, 2011 9:53 am


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.