1) When using paypal standard, the order needs to be stored in the database when the cehckout page posts to the confirm page since the confirm page sends the user to the paypal site.
in the orders table, you should have a column to store the order status. In the database set the default value for this column to pending, this way when an order is saved, it will be marked as pending.
One of the dificulties with paypal standard (And why i never recommend it as a gateway option) is that it does not process transactions in real time. When the user is returned from the paypal site to your site, there is no way to know whether the transaction has been processed successfully or not.
you would need to use the paypal IPN System which send the results of the transaction to a page you set up on your site to update the status of the order from pending to success or failure based on the results of the ipn post.
see the following for more details on IPN:
2) When testing checkout, you should test on the remote server, the local server may not have all of the needed libraries enabled.
3) This one is a big question. double check that the users ID is being stored in the order User ID column of the orders table.
your login page will store the user id value in a session variable, the tutorial examples use a session variable named UserID, double check the name of the session being created by the login page and make sure that you are using the correct session name in the recordsets.