Jump to content

Dathremar

Members
  • Posts

    169
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Macedonia

Dathremar's Achievements

Member

Member (2/5)

2

Reputation

  1. I am sorry, but I don't see where you pull anything from the db. Could you explain a bit better where/what is the problem?
  2. To get a "cleaner" code I would recommend something like: $location = "MainPageindexAsbuiltsDisplayYr.php?Dept=" . $_GET['Dept'] . "&Yr=" . $_GET['Yr']; header("Location: $location");
  3. You are missing semicolons ( ; ) at the end of those lines. Try: function choosejob($frmfunction) { if ($frmfunction === 2) { create_zip($file_path,$files,$zipname); } else { smtpmailer($to, $from, $from_name, $subject, $body, $file_path,$files); } } choosejob($frmfunction);
  4. You can stick to your query and just add this in the where clause, when you are searching for letter 't': AND ((SUBSTRING(title,1,3) <> 'the')
  5. I don't know if this question deserves an answer, but just googling what you wrote here, got me this as a first response: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/ So please don't be that lazy and try using google from time to time.
  6. You can do something like: Select table1.*, table2.field as t2field, table3.field as t3field .. Use the * for the table where you need all of the columns and from the other tables specify which fields you need and add "as" where needed (fields that have same name in more tables). Avoid using the "*" when doing a select. Its not a good practice. Always fetch only the fields you need. Fetching more data then needed is never a good idea.
  7. Yes, but that should throw a query error that you have ambiguous field name. But that can be solved by adding in the query something like: SELECT table1.field1 as t1field1, table2.field1 as t2field1, table3.field1 as t3field1 ..... So then you can pull out the field you need with $row['t1filed1'], $row['t2field1'] and so on.
  8. First of all - never use the $_POST values directly in the query!!! Clean the values and validate them before using. Now for your problem. Like Barand pointed out, your update query will affect all the rows that are equal to what ever you have in the $_POST['hidden'] or if you removed that it will be every row that has product = ''. Figure out a uniqe key for the row that you want to update and put that in you where clause.
  9. I agree, but You will need a fallback for olderbrowsers (if you support them, iex. IE7).
  10. I see. $_SESSION['share_category'] is set, but it is empty (has not value). Change your if condition to: $selectedCategories = (isset($_SESSION['share_category']) AND !empty($_SESSION['share_category'])) ? $_SESSION['share_category'] : array();
  11. I am sorry if I don't understand your problem right, but my opinion is that you would like to use cookies. If it is some info that you need to preserve for a user, put that value in a cookie and check for that cookie on page load and ofcourse if you find the needed value do whatever you need to do with that.
  12. I was going to GUESS what you mean and try to help you, but after reading this, my will is gone.
  13. The $_POST['code'] can be your id field from the db, so add that to the query instead of the hardcoded id = 1. Also don't forget to clean and validate the $_POST param before using it inside a query.
  14. Yes you can, but not with php, You will need javascript for doing that. To set an event on that link and do what you want to do.
×
×
  • 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.