Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. As akitchin said, store the file, regardless of name, on the file system, then store a reference (the location) to it in the database. Then you can store other metadata, like the owner, in the database and access it easily.
  2. I'm assuming that you are trying to email the user their password...like a "Forgot your password" thing... md5 is a one way hash. In other words, you can't reverse it and get the original string back. The easiest thing to do is to reset the user's password for them and email it to them.
  3. http://www.phpfreaks.com/tutorials/33/0.php
  4. They are going to use disk space if they are in the database or on the file system... Generally speaking, if you have a shared hosting solution, they limit you to a very small amount of MySQL space...you may want to check on that.
  5. Membership system tutorial: http://www.phpfreaks.com/tutorial_cat/7/Membership-Systems.php
  6. If you are using odbc, then just set up a new odbc connection to the mysql server and change your scripts to use that. You'll need the mysql odbc driver from http://dev.mysql.com.
  7. You are wanting pagination... http://www.phpfreaks.com/tutorial_cat/25/Page-Number--Pagination.php
  8. if ($email1 == $email2 == $email3) { //do something }
  9. I found this to be helpful... http://www.stroz.us/php/index.php?option=com_smf&Itemid=40&topic=97.0
  10. try it and find out... http://www.php.net/mysql_data_seek
  11. Use a join statement... Equipment Table: id type (laptop, monitor, etc) serial ...other identification as needed, e.g. barcode... short description Employees Table: id Name Work Phone Contact Phone (Cell, etc) Work Location (desk position) Loaned out equipment table: id employee_id equipment_id start_date return_date Then use something like... SELECT emp.name, equip.type, equip.serial, l.start_date, l.end_date FROM employees emp LEFT JOIN loaned l ON emp.id = l.employee_id LEFT JOIN equipment equip ON equip.id = l.equipment_id WHERE NOW() < return_date Which would get all currently loaned out equipment.
  12. Nope. Check to see how long it's been since they visited a page, if it exceeds a period of time (15 minutes is a good interval), consider them logged out.
  13. Your code is very inefficient...there's no reason to do so many sql queries... <?php session_start(); include("database.php"); $user = $_POST['username']; $pass = $_POST['password']; $query = "UPDATE phpbb2_users SET user_online = 1 WHERE username = '$user' AND user_password = '" . md5($pass); mysql_query($query) or die(mysql_error()); if (mysql_affected_rows() == 1) { $_SESSION['userid'] = $user_info['user_id']; $_SESSION['username'] = $user_info['username']; $_SESSION['password'] = $user_info['user_password']; $_SESSION['email'] = $user_info['user_email']; $_SESSION['website'] = $user_info['user_website']; $_SESSION['spheres'] = $user_info['user_cashspheres']; $_SESSION['avatar'] = $user_info['user_avatar']; $_SESSION['timezone'] = $user_info['user_timezone']; $_SESSION['forumposts'] = $user_info['user_posts']; } else { echo "Unable to verify username and password"; } include("index.php"); ?>
  14. Why are you writing the data to a file to begin with if they are only going to download it and then the file is removed? <?php if ($_POST['submit']) { $query = "select * from info"; $result=mysql_query($query); $csv = username.','.First.' '.Name.','.Last.' '.Name.','.Spouse.','.Address.','.City.','.State.','.Zip.','.Home.' '.Phone.','.Cell.' '.Phone.','.Email."\n"; while ( list($user, $first, $last, $spouse, $address, $city, $state, $zip, $homePhone, $cellPhone, $email) = mysql_fetch_row($result) ) { $csv .= $user.','.$first.','.$last.','.$spouse.','.$address.','.$city.','.$zip.','.$homePhone.','.$cellPhone.','.$email."\n"; } header("Content-length: " . strlen($csv)); header("Content-type: text/csv"); header("Content-Disposition: attachment; filename=data.csv"); echo $csv; } ?> <form method="post"><input type="submit" name="submit" value="Get Data" />
  15. http://www.phpfreaks.com/tutorial_cat/25/Page-Number--Pagination.php
  16. If the cookies are deleted when the browser is closed, and no other time, I find it very hard to believe it's anything but a setting in the browser. Perhaps, if you are on an AD domain, it's a profile setting that is clearing the cookies folder at logout.
  17. all of those variables, and their values, are available in the $_GET superglobal array.
  18. [code]$file=fopen("posts.php","are+"); WFT is "are+"? change it to: [cdoe]$file=fopen("posts.php","a+");[/code]
  19. what editor are you using? It may be inserting them when you are editing your code.
  20. You are most likely exceeding php's assigned memory limit. You have a couple of choices...increase the memory limit in php.ini, which isn't recommended...especially not for a 250 MB file cause each time your script is called it would load all 250mb into memory...imagine having 1000 concurrent visitors, each using 250 MB of memory. The other choice would be to split the file up. You may be able to use fread to read the file in and process it in smaller pieces, but I'm not sure since it's XML, which may be finicky.
  21. what $sign? You must be concatenating a "z" with our variable at some point. Can you post your code?
  22. You created an infinite loop with your while statement. change $comments = mysql_fetch_array($sql); while($list = $comments) { echo " <tr> <td>From:<br> {$list['user']} </td> <td></td> {$list['comment']} </tr>"; } to while($list = mysql_fetch_array($sql)) { echo " <tr> <td>From:<br> {$list['user']} </td> <td></td> {$list['comment']} </tr>"; }
  23. Oracle runs about $80,000 per processor, per server...it's not exactly affordable....... As far as performance, as with any program, better hardware will equate to better performance. Generally speaking, MySQL will perform better for "web" applications than Oracle. MySQL will perform better on older hardware. Oracle is an enterprise class, data warehouse capable, extremely redundant and failsafe RDBMS. MySQL is designed for smaller datasets (< 20M rows and 20-30 GB) in my experience. Oracle, I've yet to hit a limit, aside from physical storage.
  24. Export a small table with each method and look at the differences.... http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.