Where to insert a phrase in the right place

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm making this site that was static and now has some dynamic features,
so it's a little bit patched :)

If you care to visit
http://www.telbit.pt/2/login.php

you'll notice that the word "Welcome" is already present, and only
should be after the download.

Also, the error "You didn't fill all fields, please try again." is being
displayed on page load.

This is my problem and to which i ask you for your help.

How can i make the word "Welcome" appear only after the login ?

My code follows my signature.

Any help would be appreciated.

Warm Regards
-- 
:wq! Mário Gamito
--

<p><a href="recover-password.php">Forgot your password ?</a>

<?php
if ($_GET['error']) {
// SESSION
$field1 = $_SESSION['field1'];
$field2 = $_SESSION['field2'];

// GET
$field1 = urldecode($_GET['field1']);
$field2 = urldecode($_GET['field2']);
}

$email = mysql_escape_string($_REQUEST['email']);
$pass  = mysql_escape_string($_REQUEST['pass']);

include('config.php');
include('adodb/adodb.inc.php');

// connect to MySQL
$conn->debug=1;
$conn = &ADONewConnection('mysql');
$conn->PConnect($host,$user,$password,$database);

// get password from db
$rsSel = "SELECT name, password FROM subscribers WHERE email = '$email'
AND valid = '1'";
$rs = $conn->Execute($rsSel);

$name        = $rs->fields[0];
$password_db = $rs->fields[1];

if ($pass != $password_db) {

"&field1=".urlencode($_POST['field1'])."&field2=".urlencode($_POST['field2']);
                  echo "<div class=\"blocoApresentacao\">
<p>Wrong password, please try again.</p>
</div>";
exit;
}

print('Welcome ' . $name);

unset ($_SESSION['error']);

$conn->Close();

?>


                        <!-- end .titulo -->
                        </div>
                <!-- end #secContent -->
                </div>

                <!-- end #Content e #picContent-->
         </div>
        </div>

        <div id="footer">
                <p id="copyright">Copyright&copy;2006 Telbit -
Tecnologias de Informa&ccedil;&atilde;o, Lda.</p>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux