Images - Remove

images php coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Tue Jul 26, 2011 11:20 pm

Images - Remove

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

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

$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'>";

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

php-forum Fan User
php-forum Fan User
Posts: 577
Joined: Fri Aug 05, 2011 9:53 am

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.

Return to “PHP coding => Images”

Who is online

Users browsing this forum: Georgezx9 and 4 guests