May 19, 2007 at 10:08 am
I am tring to write a PHP login script for mssql that a member would be able to sign-in and download a zip file automic and then sign off automatic. This is what I have so far and I am not sure that part is correct:
<?php
$myServer = "localhost";
$myUser = "your_name";
$myPass = "your_password";
$myDB = "examples";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB");
Not sure what to write here to download a zip file from a certain directory.
//close the connection
mssql_close($dbhandle);
?>
May 21, 2007 at 5:19 am
I am not sure what do you want to do. Your code connect to the database as you want to make a query. In this case you can display the result in the browser. Downloading a zip file is something else. You should locate the file on the file system and then make a download through an object.
Or you have the zip file stored in the DB ?
May 21, 2007 at 7:07 am
What I am trying to do is only let a members be able to download the zip file.
So I want them to login in and have it verify they are a member and once they are verified I want it to automatically download the zip file that that I have setup in a directory and then automatically log off.
I want this to be a seperate login from the normal login that they use for the entry into the database.
May 22, 2007 at 12:01 am
Still don't know if a get you right. You can make for instance a table with members and authenticate them and then redirect to the download.
May 22, 2007 at 6:37 am
I guess I don't know to make it any plainer,
I Just want a PHP script that will sign a person in and if they are a member it will download this zip file.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy