Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. if (!$result=mysqli_query($dbc,$query)) Where's $dbc declared?
  2. When you say 'adds a 1' do you mean increment the value by 1, or literally add a '1' onto the end of the string?
  3. Actually he's using mysqli_query() right.
  4. Sounds like you may be declaring the function within a loop.
  5. Well just from looking at the top few lines I think your problem is that you're trying to store the $security_code before you've called the function that generates the security code.. //Set the session to store the security code $_SESSION["security_code"] = $security_code; //Send a generated image to the browser create_image();
  6. Why would you want to do this? This doesn't exactly make sense, could you explain it a little more? What do you mean by "position info"?
  7. Adam

    Education

    And the price of beer is ridiculous! It was when I went to Copenhagen anyway. You're from the UK aren't you? You don't think it's ridiculously over-priced here too? Not to mention price of smokes these days..
  8. Well yeah I guess, wherever your form points at. You'll need to modify it obviously; add the correct table name, add the rest of the fields, execute and process the query, etc.
  9. You could use in_array() .. if (!in_array($memType, array('Regular', 'Student', 'Retired'))) {
  10. LONG read: http://www.phpfreaks.com/forums/index.php/topic,254277.0.html
  11. You'll need to manually replace every relative URL, I'd suggest using the DOM extension as opposed to regexp or something like that. Have a play around, load the HTML with the loadHTML method, navigate through the child nodes and see what you can do. When you get stuck come back and I'll gladly help you, but you'll learn a lot more if you attempt this yourself.
  12. Could you point out, or post the code just for this part?
  13. Holy crap, what's that? You're not explaining the problem very well at all. Do you want to update the data you've taken from a form or a query?
  14. Well to start with variables cannot have a leading digit in their name. Take a look into arrays.
  15. I'm afraid I - and more than likely most people here - are unfamiliar with the class you're using to generate and handle the form. How are we supposed to tell you how it's done?
  16. Adam

    Regex help

    No probs
  17. Adam

    Regex help

    Actually you may want to use: /^(\d[ -]?){7,12}[^ -]$/ This will prevent the last digit being a space or hyphen.
  18. Adam

    Regex help

    function ReformatPhoneNumber($number) { if (preg_match('/^(\d[ -]?){7,12}$/', $number, $matches)) { return preg_replace('/[ -]/', '', $number); } throw new Exception('Invalid phone number'); }
  19. How are you requesting the content?
  20. You'll need to progressively build up the query after checking if a value has been selected from each of the drop downs: $sql = "select * from your_table_name where "; $conditions = array(); if (!empty($_POST['name_select'])) { $conditions[] = "name = '" . mysql_real_escape_string($_POST['name_select']) . "'"; } if (!empty($_POST['type_select'])) { $conditions[] = "type = '" . mysql_real_escape_string($_POST['type_select']) . "'"; } // etc. $sql .= implode(' and ', $conditions); Edit: updated the code.
  21. Ha, no problem. Thanks..
  22. No, think about CSS. "#" means an ID, although you'll want to use something a little more meaningful than "hidden_input_id". Edit: But yeah, you need to add it to the unique ID hidden field in your form.
  23. Sorry, not thinking about jQuery. You'll need to use the attr() method to set the value: $('#hidden_input_id').attr('value', the_id);
  24. Well I assume the pop-up box HTML already exists in the document, judging by the code? You just need to select the hidden input you wish to store the ID in using jQuery's selector and set the value property: $('#hidden_input_id').value = the_id;
×
×
  • 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.