Jump to content

Calver

Members
  • Posts

    37
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    UK

Calver's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It works for me! Are you getting an error? Can you post your 'testAjax.html' code?
  2. Are you triggering the Ajax function before the document has been fully rendered, to include the 'abottomPart' element?
  3. Just a couple of closing parantheses missing, I think ... ".mysql_real_escape_string($_POST['qty_adult']).", ".mysql_real_escape_string($_POST['qty_child']).",
  4. I think you need a closing ')' for the VALUES section in redarrow's code.
  5. Thdere's a single quote missing from near the end of the SQL - '$_POST[p_num] ...
  6. Did you want to sort by City - 'ORDER BY City' instead of 'GROUP BY City' ?
  7. Sorry, I also took the '/' out of this line... $dir = 'image'; I didn't use a database for testing, just a local image.
  8. I can get this to work if I change this line... echo "<td width=15%>"."<img width=100% src='$dir/$image /'></td>"; ... to this... echo "<td width=15%>"."<img width=100% src='$dir/$image' /></td>";
  9. You'll need to remove the first ' OR ' from the string... $selEmp = substr($selEmp, 4, strlen($selEmp) - 4); There's probably a better way of doing that! Then the WHERE clause... WHERE (tc.Clockin BETWEEN '".$Date1."' AND '".$Date2."') AND ( " . $selEmp . " ) ORDER BY e.LastName ASC";
  10. I think you just need to add some parantheses and arrange for the WHERE clause to look like this... WHERE (tc.Clockin BETWEEN '2009-10-14' AND '2009-10-21') AND (e.Id=30 OR e.Id=53 OR e.Id=60)
  11. I recently started with a text editor, then moved to NetBeans IDE (free) and I've never looked back. It organises my projects, will run xdebug as a plug-in, and I can ftp my files directly to my web host.
  12. Fantastic! It's working! I'm very happy because I spent all weekend working out how to do the Ajax part Thank you very much for all the help.
  13. OK, I'll have a go at that and report back. I may be some time
  14. Thank you both very much for the quick replies, which have given me hope Here's my calculator (hyperfocal.php) ... <?php $f = $_GET['focalLength']; $N = $_GET['aperture']; $c = $_GET['sensor']; $unit = $_GET['unit']; // Set the Cookie here ? $H = hyperfocal_distance($f, $N, $c, $unit); $unitstr = "Meters"; if (strtoupper($unit) == "F") $unitstr="Feet"; // Send the result back echo $H . " " . $unitstr ; function hyperfocal_distance($f, $N, $c, $unit) { $div = 1000; if (strtoupper($unit) == "F") $div = 304.8; return round(((pow($f, 2) / ($N * $c)) + $f)/$div, 1, PHP_ROUND_HALF_UP); } ?> Are you saying that I can set the Cookie as soon as I've retrieved the options from the querystring?
  15. I think this is more of a PHP question than an Ajax one, as I suspect I will have to dump the latter I've written a small custom calculator which involves selecting options from four dropdowns. When any of the options are changed, the result is retrieved via Ajax and displayed on the page - no page refreshes - brilliant! Then I wanted to remember the latest selections for when the visitor next returns to the page - Cookies! After reading some tutorials on Cookies, it soon became apparent that they need to be set at the top of the page, before any html is ouput. As I'm not refreshing the page after the selections are made, this didn't seem possible. So, do I have to dump the Ajax, add a Submit button, and refresh the page in the normal way to set the Cookies?
×
×
  • 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.