[PHP] Secure redirection?

2008-11-05 Thread Zoran Bogdanov
Hi,

I'm building a login system with AJAX/PHP/MySQL.

I have worked everything out... AJAX is sending request to a php login 
script (login.php) who if authentication passes initializes the session and 
sends the header using header(Location : registered_user_area.php);

The whole system works great without AJAX, but when I put AJAX in the story 
I ahve one problem:

1.When the user is successfully authenticated the login.php sends the 
header, but the AJAX XMLHttpRequest call is still in progress waiting for a 
PHP response. So when PHP using the header function redirects to another 
page that page is outputed to the login form...

My PHP login snippet is:
if ($res_hash == $u_pass) {

$logged_user = $sql_execution-last_query_result-user;

$sql_execution-exec_query(DELETE FROM seeds,false);

$sql_execution-db_disconnect();

session_start();

$_SESSION['user'] = $logged_user;

$host = $_SERVER['HTTP_HOST'];

$url = rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/mpls/index.php';

header(Location: http://$host$url;);//--That page 
($host$url) is outputed in the login form...

exit();

}

else {

$sql_execution-exec_query(DELETE FROM seeds WHERE id=$row-id,false);

$sql_execution-db_disconnect();

echo 'BLS';//--This is sent when the password/username is 
wrong

exit();

}

???

Any help greatly appreciated

Thank you!



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



[PHP] PHP 24 hour processes?

2008-02-24 Thread Zoran Bogdanov
Hi,

How can you perform a timed event in PHP; for example:

Count 24 hours and then delete all rows in a database...

Thank you! 

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



[PHP] Deleting all rows in a database every 24 hours?

2008-02-21 Thread Zoran Bogdanov
The title says it all, how do I perform an action every 24 hours?

Thank you. 

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



[PHP] PHP Source code protection

2008-02-06 Thread Zoran Bogdanov
Hi,

I'm building a C# application that connects to a server that has PHP scripts 
on it.

We need to deliver the complete solution to a firm, the C# is no problem 
because it is compiled...

But PHP is a problem bacause it is interpreted and we will have to deliver 
pure, unprotected script...

Is htere a way to secoure my code so when they put it on the server, they 
can't see it!

Thank You! 

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



[PHP] PHP and VB.NET communication

2007-12-19 Thread Zoran Bogdanov
Hi,

I know this isn't purely php question but  if you know please reply.

I have a server with a PHP script on it. I need to write an app(VB.NET) that 
will connect to a server and request a script to process some info, and the 
php script will return  XML data, in which I need to process that data with 
VB.net

I'm currently using httpWebRequestMethod but no luck...

Thanks!

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



[PHP] Tracking visitor times

2007-12-18 Thread Zoran Bogdanov
Hi,

Is it possible to track how long has a single visitor been on my site?

example: I go to www.somesite.com at 5.am and I exit the page (close my 
browser or just go to another site) at 6.am. How do i track that 1 hour 
period using PHP?

Thanks alot! 

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