Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Community Answers

  1. ginerjm's post in SQLSTATE[HY093]: Invalid parameter number: parameter was not defined was marked as the answer   
    The message says you have a discrepancy in the parameters you setup for your query. Take a look at it again. It's pretty simple.
  2. ginerjm's post in IMAP functions was marked as the answer   
    Problem solved. Found some new material and after a bit more experimenting got it all working.
     
    For those interested:
     
    To make an ssl connection using IMAP with no 'real' certificate use this:

    $host = "{domain.net:993/ssl/novalidate-cert}INBOX"; $mailbox = imap_open($host, $emailaddr, $emlaccess);
     
    I was using this in a script that was handling forwarded emails on STDIN so the following got me the current message #

    $imap_obj = imap_check($mailbox); $msg_cnt = $imap_obj->Nmsgs; // get last msg no. that we just processed
     
    With the messge number I could then move the message out of the inbox to a specific destination folder that
    I wanted to archive these emails in:

    imap_mail_move($mailbox,$msg_cnt,$dest);
     
    Note that my dest folder had to be named as follows:
     
    INBOX.subfolder.subfolder
     
    rather than how some parts of the manual said it had to be formatted.
     
    Last but not least and as the manual did tell me, when you do a move like this the original message still sits in the inbox. You have to turn on the flag in the imap_close function to cause this message to be removed once the inbox is closed
     

    imap_close($mailbox,CL_EXPUNGE);
     
    Note the value is a Constant and needs no quotes.
     
    This all had to be done as IMAP since one cannot do folder moves using POP3 apparently.
  3. ginerjm's post in Undefined index error where it should not be was marked as the answer   
    You apparently have produced this variable (a query result perhaps?) before trying to create the new object. But like so many people who are new to PHP (and/or programming) you fail to check the result of that query(?) to see if you have something in that array. Do that and you won't run into this situation. Or you could add some more code to the constructor to allow for an empty argument if that actually makes sense to do, ie, creating the object when you don't have the input for it.
  4. ginerjm's post in i have a problem: "Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output... was marked as the answer   
    It is telling you exactly the problem. Look at line 3. You can't send a header once you have sent ANYTHING at all to the client. Wherever you are trying to send after a header(line 3?) needs to be moved up above whatever you have already output.
  5. ginerjm's post in PHP IF NOT VARIABLE THEN DO was marked as the answer   
    Is the ID a number or a string? Be sure you are comparing correctly.
  6. ginerjm's post in new to mysqli and putting it into a Function was marked as the answer   
    Does $column contain any spaces?
     
    One should really wrap associative indices in quotes to ensure there is no problem in determining the correct element of the array it is used on.
     
    $row["$column"] would be correct.
     
    BTW - you are doing a query that selects all rows but only returning the first row's value. Is that what you want?
  7. ginerjm's post in Edge not recognizing my accesskey settings was marked as the answer   
    Well, I solved my accesskey problem. I simply installed IE10 on my W10 laptop and ran my website on it and no problem. So it's not W10 giving me the problem and it's not my appl since that works on the same laptop that has Edge on it. It's simply Edge not recognizing an accesskey attribute inside an anchor tag.
     
    I hope somebody else has already reported this failure to M$.
  8. ginerjm's post in preventDefault handling? was marked as the answer   
    Ok - solved my own problem. Instead of my html calling a routine to validate the input with an onchange call and then handling an Enter key as a Tab with an onkeypress event I consolidate my activities.
     
    With an onkeydown I call my edit routine. In there I check for a tab or enter key. If it's not one I simply ignore it and return. IF the key is an Enter or Tab I perform my editing and if that fails I manage to do either a preventDefault or stopPropagaion and return false. If it passes the tests, I call my routine to handle an Enter as a Tab and then return true.
     
    So now - user can do d/e and hit enter or tab when done. The screen will edit my entry and either keep me on the field or move to the next tabstopped field. Just what I need.
  9. ginerjm's post in Confused Need Help Please was marked as the answer   
    Not a good solution to do a query inside a loop, let alone two of them! Why aren't you writing an all-inclusive query to avoid all that? That said - please define 'broke'. Programmers need precise information to help solve problems.
  10. ginerjm's post in Cancelling an event? was marked as the answer   
    Ok - never mind. Made a change to use onBlur instead of onChange and it works better than expected!
  11. ginerjm's post in Need help to create dynamic php next content page. was marked as the answer   
    Glad we could get you on the right track. Learning how to program is not just copying someone else's hard work. It's about learning which involves reading and understanding and practice. Kind of like everything in this world.
  12. ginerjm's post in Help with navigation site was marked as the answer   
    You've lost me. I have no idea what you want. Good luck.
  13. ginerjm's post in Email not sending with PHP was marked as the answer   
    What doesn't work? The mail never arrives or never gets sent? Do you get a response from your script? Is error checking turned on?
  14. ginerjm's post in MySQL update subtracting 2 instead of 1 was marked as the answer   
    You probably don't realize that your first call to query() runs the query and so does your second.  The if statement is a wise thing to do to evaluate if your query runs, but don't run it the first time because the if is going to run it again.  Dump the first call.
     
    And of course, as Mac_gyver says, one doesn't maintain a total in a database.  One designs it to record the details and than obtains a count/total/sum when on needs it by doing a quick summary query.  Does your system register the occupants of the seats in each class?  If so, then you already have your answer for total seats used.
  15. ginerjm's post in PHP Listing Non Existent Error was marked as the answer   
    Highlight the entire script and look for colored areas with no visible chars in them
  16. ginerjm's post in bold font in php email was marked as the answer   
    You have formatted the email properly as an html one, correct?  Have you altered your to address to send the email to yourself to see what you actually get?
  17. ginerjm's post in PHP Scripts layout was marked as the answer   
    So you have a little module that defines paths
     
    /*  paths.php
    $php_path = "/home/domain/php/";
    $lib_path = "/home/domain/public_html/libs/";
    ...
    ...
     
     
    Then in your code you include the above file and in your other includes you use the appropriate path var:
     
    include($php_path . "connect.php");
    include($lib_path . "functions.php");
    ...
    ...
  18. ginerjm's post in Display SQL Query results but skip first row was marked as the answer   
    $first = true; while($row = mysqli_fetch_assoc($result)) {    if ($first)    {       $first = false;        continue;    } ... ... ...
  19. ginerjm's post in PHP $_GET? At least I think that is the function I need to get working was marked as the answer   
    The url that would be used is:
     
    domain.com/mypage.php?quitdate=x
     
    To receive that value in your script you need:
     
    if (isset($_GET['quitdate']))
         $quit_date = $_GET['quitdate'];
    else
         (handle a missing argument however you wish)
     
    Of course you then need to validate that value to be sure it is something you expect
×
×
  • 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.