Jump to content

Crono

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by Crono

  1. I was making a little comment system whereby navigating to index.php?view=4, where 4 is the comment id, shows you that comment only (basically a permalink), but it didn't seem to work when the comment id was 0. Your code seems to have fixed that -- thanks for your help.
  2. Hi, When I run the following code... <?php if ($_GET['view']) { echo 'test'; } .. and then navigate to index.php?view=1 the above code outputs 'test', as intended. The same goes for any non-zero value after the ?view= However, navigating to index.php?view=0 does not work as intended because it assumes that the 0 is FALSE. So if I modify the code, like this: <?php if ($_GET['view'] || $_GET['view'] == 0) { echo 'test'; } ... it outputs 'test' even when view is not set, i.e. when I navigate to index.php without the ?view=. Is there an easy way to force the value to behave as an integer instead of boolean? I have tried putting (int) before, as well as the intval() function, but neither seem to work. Thanks.
  3. Look into sessions. You can store data like this in the $_SESSION superglobal.
  4. You might want to take a look at this: http://www.w3schools.com/Css/pr_pos_overflow.asp
  5. Find: if (isset($_POST['merk']) && $_POST['merk'] != 0) { $qry .= " AND merk='" . mysql_real_escape_string($_POST['merk']). "'"; } if (isset($_POST['cpu']) && $_POST['cpu'] != 0) { $qry .= " AND cpu='" . mysql_real_escape_string($_POST['cpu']). "'"; } if (isset($_POST['hdd']) && $_POST['hdd'] != 0) { $qry .= " AND hdd='" . mysql_real_escape_string($_POST['hdd']). "'"; } Replace with: if (!(isset($_POST['merk']) && $_POST['merk'] == 0)) { $qry .= " AND merk='" . mysql_real_escape_string($_POST['merk']). "'"; } if (!(isset($_POST['cpu']) && $_POST['cpu'] == 0)) { $qry .= " AND cpu='" . mysql_real_escape_string($_POST['cpu']). "'"; } if (!(isset($_POST['hdd']) && $_POST['hdd'] == 0)) { $qry .= " AND hdd='" . mysql_real_escape_string($_POST['hdd']). "'"; } Using the != operator with 0 can cause some problems so the solution above should fix it.
  6. There is a package out there could 'xpdf', which I understand will let you convert pdf to html, though I haven't tried it personally. An alternative is an implementation class called 'html_to_pdf.inc.php' which you can get (I think) from phpclasses.dknss.com. Let me know how you go. I recall seeing something about it
  7. Clicking the banner works fine for me - it takes me where it should. Do you get any sort of error when you try to click it on a different computer? What happens when you click it, does it even show up at all?
×
×
  • 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.