Jump to content

sweeb

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by sweeb

  1. I took over a project and I have a need for hour interval data, but the application was coded to store it in 'h' (standard 12h time with no AM or PM delegation). I have an idea of how to adjust the rows but I'm not sure how to structure the update query. This is what I have to work with: Unique ascending ID 12h Time mm/dd/yyyy date I was thinking I could run a query that looks for values less than 12:00 in the time column and then add 12:00 to it if that Unique ID is > the biggest ID for an existing item with 12:00 - 12:59 for that specific day. Is this feasible and if so does anyone have any ideas on how to structure the update query?
  2. It sounds like you're asking how to tell whether an array is associative or not. There are plenty of examples on the php.net is_array page in the comments on how to do this http://php.net/manual/en/function.is-array.php
  3. This has no relevance to the OP at all...
  4. You can use _SERVER["QUERY_STRING"] for just the get vars and values, or _SERVER["REQUEST_URI"] to get the filename with vars and values attached
  5. Looks good to me
  6. for what it's worth, you really shouldn't be using file_get_contents over cURL even if it was enabled on your server. cURL is 10x more efficient, and has tons more options.
  7. http://dev.mysql.com/doc/refman/5.0/en/union.html
  8. $temp_name = $_FILES['Filedata']['tmp_name']; $file_name = basename($_FILES['Filedata']['name']); $file_name = str_replace("\\","",$file_name); $file_name = str_replace("'","",$file_name); $file_path = $upload_dir.$file_name; $result = move_uploaded_file($temp_name, $file_path); chmod($file_path, 777); }else{ if(!backUpFiles(file_get_contents('../events.xml'), '.')){ echo BACKUP_ERROR ; exit; } $filename = '../events.xml';
  9. Try this. On the line that says: $message = isset($_POST['message']) ? trim($_POST['message']) : ''; change that to $message = 0; foreach ($_POST as $key=>$val){ $message .= trim($key).": ".trim($val)"\n"; } This reads in all POST variables and displays them in the email body.. The simplest fix but it may not look pretty
  10. All you have to do is add the line chmod($filePath, 777); $filePath being the final path of your file after it has been uploaded.
  11. Along with upload_max_filesize, make sure you also increased post_max_size otherwise it doesn't really do any good
  12. Yeah, you can put it in a script that's used once a day-- or if a page gets used 100 times a day have a function that does it 1% of the time
  13. The reason it's not working for your other form is because your PHP form parsing file is only reading the form fields: email, message, and name. If you wanted to include other form fields you would have to grab the POST variables individually for the form-- or if you wanted it to be dynamic for whatever form you submit to it you could do a foreach loop for your $_POST array.
  14. PHP only has the capability to get the time local to the server. The only time you can get a User's time is if they specifically set what timezone they are in on your website and you do the calculation that way, by analyzing their IP address for timezone information, or by using JavaScript to get the time and passing that to a PHP file.
  15. You should check out this link: http://stackoverflow.com/questions/543926/is-it-possible-to-ajax-a-file-upload/543927#543927 Basically you can't set the enctype with AJAX so you have to do a workaround either with an iframe or flash
  16. Did you want the time local to your server or the person using the website?
  17. Also, in conjunction with load times from 'uptime' (which somewhat CPU usage) you can use system("free -m") to get mem usage
  18. sweeb

    isset()

    It would be better off being made into a relational database where you had one table for team declaration with any other info about that team, such as Table Teams ID - TeamName 1 - Team1 2 - Team2 3 - Team3 Table ContainsInfo Team ID - Data - Month - ProjName 1 - YES - 2 - Alpha 2 - NO - 3 - Beta 3 - YES - 4 - Beta This way you only have to query one column for data results, and you can easily filter by Month or Team if needed and return Team info by using joined queries.
  19. No, when you use exec the only thing that is needed is PHP with safe mode turned off.
  20. Hidden values in form buttons is pretty ghetto. Since your users are signing up and logging in you would need to store session variables to determine if that user is signed in as they click through pages (Very easy). So one of the session variables could be the user's username, and when they access the My Listings page you can run a query based on that session variable to pull all the corresponding listings.
  21. That line of code that was given to you negates the need for those PHP form parsing files. It pretty much sends your form results to the Yahoo form parsing script and granted you fill in your email address in that string, it would send you the results. If they told you to do it that way, they may not support mail spooling on their server from customer's scripts. I'm not familiar with Yahoo's hosting, so I can't give a definite on that one.
  22. sweeb

    isset()

    Yeah, that code should do it. What is it returning?
  23. You can use the exec php function, then run the shell command 'uptime'. Then dump these results into a text file or database at whatever intervals with cron. If you really want to get fancy you can write a log parsing file to display them nicely for you.
  24. sweeb

    isset()

    Since you are only returning one row in your query mysql_fetch_assoc isn't necessary--- if you were using that the syntax would require a while loop after the if statement, however this would work if you're just looking for the counted records: $sql = "SELECT COUNT(*) AS cnt WHERE 'YES' IN(rowBa, rowBb, rowBc, rowBd, rowBe)"; if ($result = mysql_query($sql)) { $row = mysql_fetch_row($result); echo $row['cnt']; }
×
×
  • 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.