| | |
Customer Service Module
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Sep 2007
Posts: 36
Reputation:
Solved Threads: 0
I'm looking for a php/mysql customer service module that will do two things:
I've been searching sourceforge but I haven't found anything yet. Any tips from this supportive community would be greatly appreciated.
- manage user login/session without self registration
- allow customer to download document packages in pdf
I've been searching sourceforge but I haven't found anything yet. Any tips from this supportive community would be greatly appreciated.
•
•
Join Date: Aug 2005
Posts: 150
Reputation:
Solved Threads: 13
I wouldn't do any fuss to look in the net. It takes about two days to programme yourself.
1. Write a cookie/session-login. Write the functions in a smooth lib so that you can be sure that they are working correctly - and if not rewrite them eith ease.
2. Create a DB with all information you need for you (your company) and your customer. Write an output for these data (for the customer) and an input (for you company to edit and add new stuff).
3. Write a download. Store the files in in a folder that is restricted with .htaccess and output the data via a PHP-Script.
4. Show someone that stuff and let that person try to demolish your code (if he/she doesn't get it, than you won). During that time work on the layout and the design. Add some images and icons and make the website look cool.
5. Lay back and drink a strong coffee, 'cause you did it.
1. Write a cookie/session-login. Write the functions in a smooth lib so that you can be sure that they are working correctly - and if not rewrite them eith ease.
2. Create a DB with all information you need for you (your company) and your customer. Write an output for these data (for the customer) and an input (for you company to edit and add new stuff).
3. Write a download. Store the files in in a folder that is restricted with .htaccess and output the data via a PHP-Script.
4. Show someone that stuff and let that person try to demolish your code (if he/she doesn't get it, than you won). During that time work on the layout and the design. Add some images and icons and make the website look cool.
5. Lay back and drink a strong coffee, 'cause you did it.
•
•
Join Date: Sep 2007
Posts: 36
Reputation:
Solved Threads: 0
•
•
•
•
1. Write a cookie/session-login. Write the functions in a smooth lib so that you can be sure that they are working correctly - and if not rewrite them eith ease.
•
•
•
•
2. Create a DB with all information you need for you (your company) and your customer. Write an output for these data (for the customer) and an input (for you company to edit and add new stuff).
For some reason, my brain isn't grasping how to connect to the db and display the documents of a particular user while leaving the documents of another user unavailable...
I'm thinking each user's docs must be stored in separate folders on the server, but that's as far as I can get. I'm missing a php function in my concept.
Also, is an index.php redirect sufficient to keep a folder containing said documents reasonably secure?
Join me!
•
•
Join Date: Aug 2005
Posts: 150
Reputation:
Solved Threads: 13
When accessing a database in PHP you first don't have to bother of whom the data might belong to. You can access all of them and sort out which of them is available for the user and which of them not.
Example
The database for the user looks like this:
Now you need a connection to your files. This looks something this that:
Thirdly you need a folder to save your files in. Create one and set a .htacces to it, so that noone can access it via HTTP. Save the files with the fileid only, eg "100" for coffee.pdf.
Now write a PHP-code that does the following:
- user logs in and you find the ID (you=1)
- access the db and just fetch just the columns where the `user` is 1 (you)
- print all these files.
Now you hav a very simple but working fronted.
Secondly, write an output for the files, because you want to restrict it with PHP:
- again check the SESSION/COOKIE for the userid
- check if the file the user wants to download has the permission.
- if yes:
Where $file is the path to the file that is saved ("./yourdir/1").
The user now get's the usual promt ("Do you really want to save this file?").
Basically, that's all. The files cannot be accessed by simpy typing the complete address in the browser (Authorization required). But the PHP-runtime can read and output them. You'll have a bit fuss the download (I just finished a similar project). For example you have to set the content-disposition and you can force the browser to use the name of your original file (the user sees "coffee.pdf"). But there a dozens of information on the net.
I hope that helps. If you still have problems, I can have a look in my old codes (I hate reading old codes because they are always very untidy) and send you some pieces of them.
Regards
Simon
Example
The database for the user looks like this:
PHP Syntax (Toggle Plain Text)
ID Name 1 gpdrums 2 sDJh
Now you need a connection to your files. This looks something this that:
PHP Syntax (Toggle Plain Text)
ID Name User 100 coffee.pdf 1 ;which is for you 101 tea.odt 2 ;which is for me (I prefer tea =))
Thirdly you need a folder to save your files in. Create one and set a .htacces to it, so that noone can access it via HTTP. Save the files with the fileid only, eg "100" for coffee.pdf.
Now write a PHP-code that does the following:
- user logs in and you find the ID (you=1)
- access the db and just fetch just the columns where the `user` is 1 (you)
- print all these files.
Now you hav a very simple but working fronted.
Secondly, write an output for the files, because you want to restrict it with PHP:
- again check the SESSION/COOKIE for the userid
- check if the file the user wants to download has the permission.
- if yes:
PHP Syntax (Toggle Plain Text)
header("Content-Type: mime"); //<- modifies the header so that the browser believes it is a file header("Content-Length: ".filesize($file)); @readfile($file); //<- outputs the complete content of the file.
Where $file is the path to the file that is saved ("./yourdir/1").
The user now get's the usual promt ("Do you really want to save this file?").
Basically, that's all. The files cannot be accessed by simpy typing the complete address in the browser (Authorization required). But the PHP-runtime can read and output them. You'll have a bit fuss the download (I just finished a similar project). For example you have to set the content-disposition and you can force the browser to use the name of your original file (the user sees "coffee.pdf"). But there a dozens of information on the net.
I hope that helps. If you still have problems, I can have a look in my old codes (I hate reading old codes because they are always very untidy) and send you some pieces of them.
Regards
Simon
•
•
Join Date: Sep 2007
Posts: 36
Reputation:
Solved Threads: 0
Thank you for taking the time to explain this further. I need to absorb it over the next few days. I just might take you up on digging up some code, but I'll not pester you if at all possible.
I'll go ahead and close this one as solved, but you might get an im from me.
By the way, I was in Asia last week and I drank quite a bit of tea.
I'll go ahead and close this one as solved, but you might get an im from me.
By the way, I was in Asia last week and I drank quite a bit of tea.
![]() |
Similar Threads
- For idontno: Window Xp IE 6 (DNS ERROR) page not found! (Viruses, Spyware and other Nasties)
- Trojan virus - need help please. (Viruses, Spyware and other Nasties)
- My Progress with DollarBuddy (Advertising Sales Strategies)
- Home search asistent, shopping wizard (Viruses, Spyware and other Nasties)
- When a host says "included scripts" (Networking Hardware Configuration)
Other Threads in the PHP Forum
- Previous Thread: What does this do?
- Next Thread: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
| Thread Tools | Search this Thread |
# 5.2.10 access alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory insert ip javascript joomla legislation limit link local login mail memberships menu mlm multiple multipletables mysql mysqlquery newsletters oop open paypal pdf persist php problem provider query radio random recursion remote rss script search server sessions sms sockets source space spam sql syntax system table tutorial update upload url validator variable video web youtube





