Jump to content

per1os

Newly Registered
  • Posts

    3,095
  • Joined

  • Last visited

Everything posted by per1os

  1. TLG, SQL all the way. PHP's flat file system is not really meant for storing Relational Data, which SQL and other stuff are built to handle that extremely well. So Maq's statement holds true in that sense. If you are doing stuff that stores fine in a flat file, then yea, a flat file would be better. But 9 times out of 10 you want a relational database. So the answer, SQL is way better for handling data that you are constantly accessing and can potentially have multiple users accessing it and changing it constantly, not to mention it is much easier to make changes to and add audit trails etc.
  2. Wow Maq, you are such a jerk. He asked a legitimate question and just posted it in a spot where it would be answered. I mean come on, it is not like he was acting against the Terms of Service or the Rules of the site. For fucks sake man!
  3. Yes you do. Since the parameter is not in the [ ] it means it is a required parameter.
  4. I am unsure if this will work, but maybe just removing the "-" would make it work? $time = 'September 12, 2001 - 05:00 pm'; $time = str_replace("- ", "", $time); $timestamp = strtotime($time); echo date('Y-m-d h:i:s', $timestamp); Again I do not know if it will work or not, but give it a try.
  5. Your missing the point of an earlier post by premiso. $isAdmin = ($result['access'] == "admin")?true:false; That uses what is called a ternary operator. the ? and : which is basically a shortened if/else. I suggest you change: $isAdmin = ($result['access'] == "admin"); TO $isAdmin = ($result['access'] == "admin")?true:false; and give it a try.
  6. www.php.net/date Take the timestamp and plug it into the date function with the filter you want. If the MySQL Timestamp is setup not in all numbers use www.php.net/strtotime to convert it to a UNIX timestamp, which the date function accepts.
  7. $result = mysql_query("SELECT * FROM uregister WHERE uusername = '$uusername' AND upassword = '$upassword'"); $countrows = mysql_num_rows($result); $row = mysql_fetch_array($result); if ($countrows > 0 && $row['uusername'] != $uusername) { //print "Sorry, check your username/password."; include("index.php"); exit(); } PHP is case sensitive, mysql is case insensitive.
  8. Ummm....php is case sensitive. <?php $user = "MyName"; $input = "myname"; if ($input == $user) { echo 'Hello'; }else { echo 'Bad'; } $input = "MyName"; if ($input == $user) { echo 'Hello'; }else { echo 'Bad'; } ?> Should echo "BadHello"
  9. Are you sure they are "only" using PHP and not using a third-party application to feed them data?
  10. Well yea. You need to use sessions.
  11. AHH! I didn't know but it all makes sense now!! that's why the query worked fine in phpmyadmin AND on the script, I ahd no idea updating 0 rows would be considered OK.. I guess I can see why, but at the same time, sorta not.. using mysql_affected_rows works perfect Think of it this way. If you have an if/else condition and you check if I is equal to one. But I is equal to 2, just because I does not equal 1 does not mean there is an error. Basically MySQL will only report an error if there is an error. That SQL Update statement is valid, but since none of the conditions were met no updating was done. No errors were encountered is the key here.
  12. Post in HTML forum or Flash forum not PHP bud.
  13. I honestly do not know. I think either will work. EDIT: You learn something new every day =)
  14. If you are using shared hosting, alot of times you are only allowed a certain number of database, and they usually block the create database command. Chances are, that is the problem, unless you say differently.
  15. OK Let's think here. $month = date("F"); $date = date("d"); $year = date("Y"); $Timestamp_today = strtotime ("$month $date $year"); $query ="UPDATE site_stats_bots SET clicks = clicks+1 WHERE Timestamp='$Timestamp_today' AND User_ID='$User_ID'"; $result = mysql_query($query)or print ("Can't update<br />" . mysql_error()); if (mysql_affected_rows($result) < 1) { $query = "insert into site_stats_bots (User_ID, clicks, Timestamp) values ('$User_ID', '1', '$Timestamp_today' )"; mysql_query($query); } Checking if $result is false does not work. Reason being, an update statement can update 0 rows and it is still a valid SQL query. Use www.php.net/mysql_num_rows to check if the query actually did any work/updating. Sometimes it is always the smallest things. EDIT: Changed to ww.php.net/mysql_affected_rows since it is an update statement.
  16. http://www.tiffanybbrown.com/2005/12/22/dynamic-rss-feeds-using-php-mysql-and-apache Should be what you need. (The above was found with google keywords mysql php rss) As for tieing it into categories etc, just create a separate page or a switch/case statement
  17. Maybe the page isn't UTF-8 Encoded ???
  18. http://www.developer.be/index.cfm/fuseaction/faqDetail/FaqId/187.htm
  19. Chances are the data returned is returned as some type of .NET object to be used in that framework. Micro$oft would not want their stats displayed or gathered via PHP. I doubt you can. Now you might be able to setup a .NET application to retrieve the data and then format it into XML and pass it to a PHP page.
  20. You could make it goto your own .php page with javascript for resizing etc and then have it redirect to the link. IE: <a href="your_window.php?link=http://www.google.com" target="_blank">Here</a> Then in the your_window.php code simply run javascript code to resize and do what you need to do and then do a redirect or if the file is on your server an include.
  21. Yea you could always use C++ to make a command line version for a file permissions changer, that is an option.
  22. Does chown work in windows?
  23. You can only see the contents of the file if it is downloaded via FTP or via SSH. As for the size of the script, it does matter little. What does matter is the output. However if you have a lot of processes going on like string manipulation and loops inside that 500KB file that will slow it down because php does have to process etc. Optimization is always good. But yea as long as your php 500KB page does not due insane amounts of logic with loops etc, you should be fine.
  24. <?php if($a = "1" or $a = "2" or $a="3") {} else {} ?> That will always return true. Use == for comparison not a single = Like wise you could do this: <?php if(ereg("1|2|3", $a)) {} else {} ?> or <?php if(ereg("([1-3])", $a)) {} else {} ?> Should work too.
  25. Sure, but a better thing to do would 301 the bots to the new page.
×
×
  • 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.