Jump to content

btherl

Staff Alumni
  • Posts

    3,893
  • Joined

  • Last visited

Everything posted by btherl

  1. Change this line: $result=mysql_query($sql); to $result=mysql_query($sql) or die("Error in $sql: " . mysql_error());
  2. That "configure" line is for if you compile php yourself with postgres support. How did you install php? And the webserver? If you installed them as some kind of pre-packaged thing, then that packaging system should have a way to set up postgres to work with it (I'm being very general here because I'm more of a linux person and you appear to be using windows).
  3. A google search like "PHP pie chart" will show a lot of packages to make pie charts.
  4. You should be able to put the alerts and then the redirect all in the same javascript block. Then it'll run in sequence (I think). Not 100% sure, i'm not that great with javascript. Another option is to have a delay before the redirect.
  5. This forum is for PostgreSQL - http://www.postgresql.org Based on a brief look, I don't think sqsh is designed for making backups. You could potentially make a custom backup script for it though.
  6. The next step is to echo out your sql query so you can see the syntax error. That eregi looks suspicious - you need at least single quotes around any string unless it's a special word for postgres (like "SELECT" or "UPDATE"). For example: $ver_update=("UPDATE `sit_details_tmp` SET `id_verification` = '2' WHERE `email` = '".$_SESSION[email]."' AND eregi($var_code,$htmlString) "); $result = mysql_query($ver_update) or die("Error in $ver_update: " . mysql_error());
  7. Yes, exactly like that. Then it will update only for that email and that url, not for ALL urls. The way to include arrays inside a string is like this: $sql_site = ("SELECT * FROM sit_details_tmp WHERE `email` = '{$_SESSION['EMAIL']}' "); The {} characters "protect" the array and make sure it will be interpreted properly. If you just use $row for example, then it MIGHT work, but it's much safer to use the {} and also to put single quotes around the 'Url' bit inside the []. Good: $row['Url'] Risky: $row
  8. If you are allowing more than one site for one email address then you'll need to store the site in the database as well as the email. Then when you update it, you check the site as well as the email.
  9. You can do it this way: $value = trim($_POST['rand']); $value = preg_replace("|[^0-9]|", "", $value);
  10. This line: if ($lastditch_row <= mysql_fetch_array($lastditch_result)) { will fetch the first result row, and then ignore it. Probably you want: if (mysql_num_rows($lastditch_result) > 0) {
  11. That code is just too difficult to understand. Can you do it without nesting function calls? It'll be more lines but it'll improve readability no end. Then it'll be easier to find the bug.
  12. What if you do something like this: <span class="style1"> <a href="?id=<?php echo $id; ?>&links=attorneyslink" class="nav" >>>Attorneys</a><br /> Then when you click the link id will be preserved, and links will be set. Similarly for links which change the id, you can pass along links as a variable.
  13. I'm not sure he needs a switch - he's using the value of the id argument to include a named file (which is risky from a security viewpoint actually, but that's another issue). For the original issue, I don't see any need to duplicate anything. Both the id and link arguments can be passed through any url and through to any script, and then they can be used to decide what to do. They can also be accessed from inside the included files.
  14. I'm thoroughly confused - why would you need to make multiple copies of anything if you used both id and links in the get string? Can't you just make one script which include a links file and a main file?
  15. Try this: $createdby_arr = explode(" ", $_GET['createdby']); $createdby_sql = "('" . implode("','", $createdby_arr) . "')"; $sql = "SELECT * FROM `test` WHERE event IN('performance') and createdby IN ($createdby_sql)"; I haven't dealt with escaping of the input strings - you should do this for security. You can escape each element of the array before calling implode().
  16. You could add a container before passing the string to simplexml.
  17. Oh yes they are evil. That sample you posted, won't it do nothing at all because the onsubmit returns false?
  18. It's certainly possible. One way would be to use the unix "tail -f" command with popen(). Or if you want to roll your own, you could remember the offset of the end of the csv file last time you read it, and start reading from there the next time you open it. fopen(), fseek(), read until end of file, ftell(), fclose(). As long as your writers are using the append only mode for writing to the file, lines will be written atomically and you don't need to worry about getting partial lines.
  19. Hehe Well if that's not a good enough reason, in my job I process clickstreams involving hundreds of thousands of users and millions of hits daily. User agents pretty much stay the same as far as I can see in those. Plenty of bots masquerade as real browsers, and there's a lot of weird user agents, but I've never noticed a user agent change for the same user session.
  20. Can you create a small example html file that works in IE but fails in Firefox?
  21. It'll generally stay the same. If your target demographic is normal users with normal browsers, you can expect it to stay the same.
  22. Can you add "echo $sql;" and show me the output please? I suspect you need single quotes around the $search_for, otherwise it'll be interpreted as a column name. You won't get the same problem for numbers because column names can't be numbers.
  23. foreach ($prod_ids as $value) is the loop that is only getting the last product? I don't see anything obviously wrong. The debugging technique I would use here is printing out the values of variables at each step along the way. You can use this for arrays: print "<pre>"; var_dump($array); print "</pre>"; Start by printing out $prod_data after it's set. Once you've verified that's correct, try the next step along. Eventually you'll find a step where the input is correct but output is incorrect, and that is where the bug is.
  24. What if you send the abbreviation only, then use it to look up the long form in the original array you used to generate the form?
×
×
  • 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.