Jump to content

bwochinski

Members
  • Posts

    116
  • Joined

  • Last visited

Everything posted by bwochinski

  1. First of all, yes that user has "ALL PRIVILEGES" only for the database specified. Also, I believe most hosts that use cPanel or their own control panel for their mySQL management do not allow a "CREATE DATABASE" query at all. Whatever their reasons, they don't want databases created by scripts on the fly.
  2. ahh there ya go So here when you're using move_uploaded_file() that's where you're actually renaming the temporary file to (in your case) the filename in $target. You do not by any means have to use the name from $_FILES['uploaded']['name'].
  3. Really it's always counting down by the nature of the passing of time (assuming $countup is "static" per session, not per pageload) and that fact will be reflected when the page is refreshed, but I'm betting that isn't what you're looking for. In which case you need to turn to client side scripting, probably javascript, in order to dynamically update the page.
  4. I don't see any uploading happening... looks like that just displays a random image from the "image/upload" directory.
  5. If you have floated divs that's going to cause some issues with centering...
  6. Post the HTML / CSS of what you're trying if you're still having problems.
  7. First of all, you should assign your questions an ID as primary key, so you don't have to match against text fields. Assuming you do that then something like this for checking the answer: <?php if ( isset($_POST['answer']) AND is_numeric($_POST['q_id']) ) { $answer = mysql_result(mysql_query("SELECT answer FROM table_questions WHERE question_id=".$_POST['q_id']." LIMIT 1"),0,0); if ( strtolower($answer) == strtolower($_POST['answer']) ) { // Correct answer! Do processing here } else { // Incorrect answer. Display message. } } else { // No answer or invalid submission. } ?>
  8. Yep it all works just fine. And give the credit to Interpim, he spotted it right off.
  9. I know he said he tried it... But I downloaded his form, pointed it to his formmail.php script, and changed only those 2 things to be value="", and it worked.
  10. I don't think that those field names need to be added to the array, as they're added to the "required" element from the hidden field on the form. EDIT: I just double checked, it's definately the values you have set for your default dropdown selections. Make sure both of those are value="" I tried it and it returned a list of the missing values, including location and favorite_entree.
  11. No you are correct, I didn't look at the HTML at first (as a side note, unless I am missing something that is an extremely insecure form). But looking at the HTML there are still values for the default options: <option selected value="Pick one...">Choose One</option> That will cause the fields to pass any checking done, since as far as the script is concerned, there is a value sent for those fields.
  12. You probably need to take a look at the CheckRequired() function, to see what it takes for arguments. By looking I would guess that it takes an array of fieldnames and an array of the posted data, but I can't be sure. Anyways, you'd need to get your fieldnames added to that array. EDIT: Ok I actually decided to *look* at the code... The first parameter is a comma separated list of field names. It looks like this is where the variable starts being set:: <?php // // SPECIAL_FIELDS is the list of fields that formmail.php looks for to // control its operation // $SPECIAL_FIELDS = array( "email", // email address of the person who filled in the form "realname", // the real name of the person who filled in the form "recipients", // comma-separated list of email addresses to which we'll send the results "cc", // comma-separated list of email addresses to which we'll CC the results "bcc", // comma-separated list of email addresses to which we'll BCC the results "required", // comma-separated list of fields that must be found in the input "conditions", // complex condition tests "mail_options", // comma-separated list of options "good_url", // URL to go to on success "good_template",// template file to display on success "bad_url", // URL to go to on error "bad_template", // template file to display on error "template_list_sep", // separator when expanding lists in templates "this_form", // the URL of the form (can be used by bad_url) "subject", // subject for the email "env_report", // comma-separated list of environment variables to report "filter", // a support filter to use "logfile", // log file to write to "csvfile", // file to write CSV records to "csvcolumns", // columns to save in the csvfile "crm_url", // URL for sending data to the CRM; note that the // value must have a valid prefix specified in TARGET_URLS "crm_spec", // CRM specification (field mapping) "crm_options", // comma-separated list of options to control CRM processing "derive_fields", // a list of fields to derive from other fields "autorespond", // specification for auto-responding "arverify", // verification field to allow auto-responding "alert_to"); // email address to send alerts (errors) to ?>
  13. <?php $datestr = date("n.j.Y",strtotime('20070401')); ?> $datestr = "4.1.2007";
  14. The issue is that <j> is not a real tag, so IE ignores it. Using <p> or <div> doesn't give the behavior you want because those are both block elements and so by default want to take up as much width as they are allowed by their parent element. You can use the <span> tag, which is an inline element, or add "display: inline;" to the CSS. EDIT: Also, if you want a very thin border, use "border: 1px solid black;"
  15. <?php $number = '555-123-9876'; if ( preg_match('/^\d{3}-\d{3}-\d{4}$/',$number) ) { valid! } else { Invalid! } ?>
  16. Better would be to make use of fulltext indexing. After creating the index: SELECT * FROM table WHERE MATCH(column1,column2) AGAINST ('search terms')
  17. Using the "first-child" pseudo class would be perfect for this... if only it was supported by IE. (I believe IE 7 does, but not previous). I'd probably assign the styles to the table cell and just add a class to it, like so <td class="leftcol">
  18. add "margin-right: auto;" to #content add " #footer ul { margin: 0px; padding 0px; }"
  19. Use explode() to separate the parts of the string. Then you can use them wherever you like.
  20. You need to be sure the file which defines the class (search on "class fckeditor") is included in this file, before the class instantiation.
  21. Handling image uploads is really a lot easier than you'd think. If you haven't, of course read the php docs on it (http://us2.php.net/manual/en/features.file-upload.php). They have several demo chunks to get you started there. Of course, as noted on that page, much of the data about the presumably uploaded image is not checked, so be sure to check things out before saving the uploaded file. One function for that kind of thing is getimagesize(), and browse around the related functions for some more info. I too would probably put all of the images in one folder, and reference the filenames from the database. Of course you're going to need to be able to guarantee unique filenames to avoid problems, for that I'd probably do something of the format: "timestamp-filenamehash.gif" and then just save the original filename in the database.
  22. UPDATE your_table SET photo_id=((SELECT MAX(photo_id) FROM your_table) - photo_id + 1)
  23. Make sure the field name in the html is "reasons[]" <?php $reasons = implode(', ',$_POST['Reasons']); ?> And as for the radio buttons, a group of radio buttons all should have the same name, and only the value of the selected on e is returned. So anything with a single group of radio buttons should work fine.
  24. Maybe try renaming your formatted dates in the SELECT to something besides the same field names.
  25. Put it all in one file, with the PHP above the HTML form. Have the form like: <form method="POST">. Around your PHP add a check for $_POST['submit'] being set, so you know if the form has been submitted, and then do your checking. If the password is wrong, then just set an error message and let the page display again. If it's right, then redirect to a "success" page.
×
×
  • 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.