Jump to content

allworknoplay

Members
  • Posts

    385
  • Joined

  • Last visited

    Never

Everything posted by allworknoplay

  1. You're using POST, just use GET. $_GET['zipcode']
  2. It sounds like getName is your "get" method, which allows you to access private properties in a class I beleive. I could be wrong... I don't think you can directly access those properties like so: $data->members(); But if your getName() is getting the data and then outputting it, that's probably why you're seeing the data??
  3. Depends on what you want to do with your application. LIMIT 10 will only show you the first 10 results. But if you want to then show the next 10 results, you have to provide it like so. LIMIT 1,10 = first 10 LIMIT 11,20 = next 10 Or you can looking into pagination to provide the full user experience...
  4. You don't want to be using POST arrays to populate the form fields, you want to use the results from the SQL query.. <input type="text" name="hire_date" id="hire_date" value="<?php echo $rows['hire_date']; ?>" size="34" maxlength="50" />
  5. LOL!!! Yes...that is sure much EASIER to read... LOL!!!
  6. What about checking for NULL? $_POST['value'] == NULL
  7. Basically, take the image buttons out. Do it the regular way with buttons. See if that works. If it doesn't it's something else with the script and not the image button. If it works, then you have to read up on the nuances of image buttons between FF and IE.....
  8. Put an exit after it in order to make sure that nothing gets loaded. header("Location: http://www.example.com"); exit;
  9. It just seems that there's a problem with the incrementing. That's why you are only getting one result into the DB, whether it's the 1st entry, 0 entry, etc.... I would step back a little and forget about updating the DB, and outputting the results so that you can see what is EXPECTED to go into the DB....
  10. I think because your $i=0 is within your WHILE loop...I think you have to put that above the loop....like this: $result = mysql_query("SELECT * FROM $what WHERE belong_to_year = ".$year.""); $i=0; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { foreach ($line as $col_value) { if ((mysql_field_name($result, $i) != "belong_to_year")&& (mysql_field_name($result, $i) != "pay_mgmt_chk") ) { $field=realWords(mysql_field_name($result, $i)); if (mysql_field_name($result, $i) == "date") { $array[$field] = date("d/m Y", strtotime($col_value)); $i++; } elseif (mysql_field_name($result, $i) == "amount_num") { $array[$field] = showMoney($col_value); $i++; } else { $array[$field] = $col_value; $i++; } } } } $out = array($array); print_r($out);
  11. if($ipsclass->input['act'] == "Arcade") { $ipsclass->input['autocom'] = "arcade"; } $ipsclass is your object. So somewhere up above you instantiated it like so: $ipsclass = new yourclass(); You access your entire class through $ipsclass....any methods or properties is accessed through this....
  12. By the way, $_POST is *always* set. Unless someone unsets it. Is that right? You learn something new everyday.. I normally don't use POST as a way to check, I normally check for a SESSION to exist. But for POST, if he wants to double double make sure, he can include a hidden type say: myform and set the value to true when they hit submit. Then on the confirm page, he can check to see if $_POST['myform'] == true But that's kind of a hack way to do things... He should really invest in sessions....
  13. if (isset($_POST)) { header("Location:index.html"); } else
  14. Probably because your PHP isn't in your server variable environment. So you can either edit your BASH and include it or you have to include the full path of your PHP. So ex: /usr/local/php/bin/php -q /home/tcrush/public_html/cron/cron.php That should work for you.
  15. Yeah, old issue. Just go to your PHP.ini and add this. session.bug_compat_42 = 0; session.bug_compat_warn = 0;
  16. use arguments... $argv[0], $argv[1] etc....
  17. That's right, I'm assuming that he has his web server parsing HTML as PHP.....
  18. Yeah that should work but you have index.php and index.html. That's very confusing...at least for me...you should make one of them your main index file.... If you're not sure of your input, GET or POST you can always do REQUEST, it will cover you both ways, BUT it's not good practice so make sure you do know what type of input you are getting, but for testing purposes you can use REQUEST. $campaign = $_REQUEST['whatever_input'];
  19. I'm not aware of any "SQL" tricks that allows you to get one value without doing what we just did...so I am very much open to any new ideas....I know I could use it, there have been many times I only wanted one value....I'm sure you can do something fancy with sub-queries though.... I don't see any issue with your approach.....
  20. Well as Gingeroot said, you are returning an array so you have to access the element in the array. Eventhough you know you are only returning 1 value, you still have to access it the same way whether it's 1 or 100 values...
  21. That's not right, you're using a resource ($row) as your license? Try this below: <?php //Grabbing first available trial license $result = pg_query("SELECT license FROM triallics WHERE inuse = '2000-01-01 00:00:00' limit 1"); $row = pg_fetch_assoc($result); $license = $row['license']; //Grabbing date and time; $today1 = date("Y-m-d H:i:s"); echo "".$today1."<br><br>"; //Updating table with today's date $modresult = pg_query("UPDATE triallics SET inuse = '$today1' WHERE license = '$license' "); if (!$modresult) { echo "Your pg update query isn't right.\n"; exit; } echo "should be updated now"; exit; ?>
×
×
  • 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.