Jump to content

akitchin

Staff Alumni
  • Posts

    2,515
  • Joined

  • Last visited

    Never

Everything posted by akitchin

  1. what code are you using to populate the <td> element?
  2. if you still have the echo $result; line in there, remove that and leave the header() function in to see if that fixes anything.
  3. you will want to use document.getElementById("test1") to reference the table cell, and use one of the appropriate properties for that object to access its value. it'll most likely be innerHTML that you're looking to use.
  4. are you testing by accessing the script directly, or by using the page that points to it for its img src?
  5. what do you mean by you don't know how to reference it if it's above the web root? do you mean you don't know the disk path to the file?
  6. for the record (and future form design), it would have been far more straightforward to process these values the way you wanted if you used an array key in the name, rather than an iterative variable tacked onto the end of your name: <td align="right">Name:</td> <td align="left"><input type="text" name="name[1]" value="" size="25" /></td> <td align="right">Email:</td> <td align="left"><input type="text" name="email[1]" value="" size="25" /></td> what this allows you to do is iterate through one of the $_POST arrays, and use the key to identify its partner: $paired_data = array(); foreach ($_POST['name'] AS $key => $this_name) { $this_email = $_POST['email'][$key]; $paired_data[$key] = array('name' => $this_name, 'email' => $this_email); } print_r($paired_data); the php manual has some pretty good information on arrays here, if you're still quite new to them.
  7. my point was that perhaps the script doesn't have the appropriate permissions to create the folder at that level. it might be worth creating that directory with the appropriate permissions manually and trying the script again.
  8. getimagesize just gives you the dimensions of the image, not the filesize. the filesize is actually already present in the $_FILES[] array for the given file. have a look at the manual for handling file uploads: PHP Manual: POST method uploads
  9. have you created the "/whatever" folder where it should be, and properly set permissions for it? if so, i would guess that it has something to do with the user that the FTP script is operating as not having appropriate permissions to access directories above the web root.
  10. i'm afraid you're either going to have to name the fields uniquely for the given form, or you'll have to check for the hidden variable as well when repopulating. there's no way for the server to know intuitively which fields to populate.
  11. precisely - otherwise, anything left unspecified simply assumes the browser's default values.
  12. if you've got all the report IDs in the $_POST['reports'] array, you can collect them into one string and SELECT all of the report info from the db: $rid_list = implode(',', $_POST['reports']); $query = "SELECT * FROM reports WHERE ID IN ($rid_list) ORDER BY whatever"; to get the total price, you can simply add each individual report price to a total as you display them.
  13. i'm not sure if you need the header() in there; in fact, that could throw your script for an error every time if output has already been displayed.
  14. you must add the content type to your e-mail header, so that the e-mail client recognizes your text as HTML. here is an explanation of how to do that.
  15. ... is there a question to go along with your code?
  16. you'll want to do two things (if you want to use that function). the first is to modify your query to use a function that will convert your timestamp column into a UNIX timestamp: SELECT date_part('epoch', timestamp_column_name) AS UNIX_timestamp FROM table second, you'll need to adjust the function so that you can pass it a timestamp, rather than it assuming you want the current date/time. this involves putting a parameter in the function which has a default value when not specified: function FullDateAndTimePortuguese($timestamp = time()) { setlocale(LC_ALL, NULL); setlocale(LC_ALL, 'pt_PT'); $DayOfWeek = ucfirst(gmstrftime("%A %d %b %Y %H:%M", $timestamp)); return $DayOfWeek; } then you can use the function to format your date and time: $formatted_date = FullDateAndTimePortuguese($timestamp_from_query);
  17. it's impossible to know for sure, since this function is user-defined (ie. not a native PHP function) and therefore we don't know how it's supposed to work. however, i'm going to take a stab and say that the parameter after date("Y")-18 is the upper boundary. try changing that one to date("Y")-15 and see what you get: selectList( "field_4_YYYY", $_POST["field_4_YYYY"], date("Y")-18, date("Y")-15, "YYYY", $style ) ;
  18. what is the timestamp's format in PostgreSQL? is it a UNIX timestamp, or is it in a format like YYYY-MM-DD HH:MM:SS?
  19. the row's timestamp should still be LESS THAN the timestamp from 7 days ago in order to be older.
  20. you need to put parentheses around the subtraction expression. otherwise, php concatenates the current timestamp onto the string, and then attempts to subtract 7*24*60*60 from the string itself. when in doubt, always echo the query to see if it contains what you think it should.
  21. have you run this to see what you get?
  22. you're using all double-quotes. on the first line, when the echo statement reaches the second ", it think it's done echoing. so it wonders just what exactly you're trying to do after the echo. to fix it, either escape the double quotes within the echo statement, or convert the double quote delimiters to single quotes. have a look in the PHP manual about strings and variables.
  23. i suppose whoever wrote that line never saw the function time. anyhow, a UNIX timestamp is measured in seconds. in order to get the UNIX timestamp that was exactly 7 days ago, you simply need to subtract the number of seconds in 7 days: echo 'timestamp now is: '.time().'<br />'; echo 'timestamp 7 days ago was: '.(time() - 7*24*60*60); // 7 days * 24 hours * 60 minutes * 60 seconds
×
×
  • 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.