Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. The user's session (which one belongs to them) is tracked via a cookie, unless you explicitly turn that action off in php.ini.
  2. Unless you are on the same network, like Thorpe said, you will have to upload the file, however, you don't have to store it (i.e. use move_uploaded_file to move it to the uploads directory). Use use file_get_contents on the tmpname... echo file_get_contents($_FILES['Filedata']['tmpname']); The file will be destroyed once the script finishes execution.
  3. If they just navigate away, you can't do anything...you can set the expire time for the session to something rather low, but then if they are reading an article or something, and they're a slow reader, they could get logged out. If they close the browser, it will destroy the cookie, and consequentially the session.
  4. What is the max upload file size set to in php.ini? Additionally, I think that if it takes longer than php's max execution time to upload the file it will error.
  5. echo $_SERVER['PHP_SELF']; http://www.php.net/reserved.variables#reserved.variables.server
  6. http://www.php.net/session_destroy
  7. More like strings, rather than individual words or characters.... //english lanugage file $page_title = "This site's name"; $welcome = "Welcome to our site!!"; $goodbye = "Thanks for visiting!!"; //gibberish language file $page_title = "alksdjffweiu laksjfd a"; $welcome = "alksjdf oiweurn ba"; $goodbye = "lawieurw ksnwopiu"; Your php file: <?php include("./languages/english.lang.php"); //or gibberish.lang.php, etc ?> <html> <head> <title><?php echo $page_title; ?><?title> </head> <body> <?php echo $welcome; ?> Blah <?php echo $goodbye; ?> </body> </html>
  8. That is correct. You would use a many-to-many relationship.
  9. $query = "SELECT * FROM productid WHERE invoice_num IN('" . implode("', '", $arrayelements) . "')"
  10. You can't translate from one language to another directly. The way that other sites have multiple languages is by providing a "language file" that contains variables for each text display, then depending on which language file is included, it sets those variables to the language, which is then displayed.
  11. <?php $lastTime = "2007-05-18 07:43:22"; $currentTime = "2007-05-18 08:43:22"; echo date("Y-m-d H:i:s", strtotime($lastTime) + (floor( (strtotime($currentTime) - strtotime($lastTime)) / 2) ) ); ?>
  12. <form action="upload_file.php" method="post" encypte="multipart/form-data"> enctype is spelled incorrectly
  13. http://www.google.com/search?source=ig&hl=en&q=php+blog&btnG=Google+Search
  14. http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  15. See the unescaped single quote in the middle there? Use mysql_real_escape_string on each of your variables before putting it into the final query string. http://www.php.net/mysql_real_escape_string
  16. What's the full text of the query that's failing?
  17. MySQL. The file will be faster at first, but as it grows in size it will get more cumbersome to use. Every time it gets written to the OS has to open the whole file, then append to it, then close it. If that file is several MB in size, then that can eat system resources. Additionally, you will encounter a problem with file access...what happens when PHP, which is multi threaded, tries to access that file with 2 or more of it's threads at the same time? Additionally, using the file makes it much much slower and more difficult to do the associations when you want to look at the history for a particular piece of content or user. You are already going to have to use a join in your user table to get the user name when you are doing a "history", so, rather than having to read your file, then pull the relevant information, you can do a single query with a join.
  18. You have a primary key (or unique index) on that column...which prevents it from inserting further records. Change your PK to a different column, or eliminate the unique index (a PK is a type of unique index)
  19. Did you try google? http://www.google.com/search?source=ig&hl=en&q=xbox+live+api&btnG=Google+Search
  20. I'm assuming you are using a socket to read the data...look for "\r\n\r\n", then separate it there.
  21. When you say "stops inserting data into the server" do you mean, the queries fail, or it stops processing data? Change $results = mysql_query($sql); to $results = mysql_query($sql) or die(mysql_error());
  22. There isn't a specific function to find what you want, you'll have to loop through the array... <?php $arr[342]=34; $arr[235]=55; $arr[164]=64; $arr[766]=4; $key_to_find = 164; $cnt = 1; while ($values = each($arr)) { if ($values['key'] == $key_to_find) { $place = $cnt; break; } $cnt++; } echo $place; ?>
×
×
  • 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.