Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Posts posted by ginerjm

  1. You're talking about taking some (printed?) data and trying to read it from whatever media it is in and writing it out to a text file?  Sounds simple except for the input format.  That (to me) seems to be the difficult part.

    So - to simplify this:

    1 - determine how to read the input source

    2 - how to recognize the individual pieces of data

    3 - compose a text string of those pieces

    4 - write

    5 - repeat 

  2. Something that nobody has mentioned.  If you want to do this work inside of a function you probably want to make it usable in multiple situations.  Why then do you make it not portable by referencing an outside value that is not part of the function's header?  That is just not good programming.  Get rid of the $_GET reference and pass this 2nd value in using the parms in the function header.

    function removeItemFromQuote($itemId, $other_id)

     

  3. Look at this code and run it.  The string exists in both tests but the answer that your code produces is incorrect.

    //Test 1
    echo "Test 1:<br>";
    $str = 'And click';
    $a = strpos($str,'And click');
    echo "str is '$str'<br> ";
    echo "Search result is $a<br>";
    if ($a==true)
    	echo "$a returns true<br>";
    else
    	echo "$a did not return true<br>";
    
    //Test 2
    echo "<br><br>Test 2:<br>";
    $str = 'xAnd click';
    echo "str is '$str'<br> ";
    $a = strpos($str,'And click');
    echo "Search result is $a<br>";
    if ($a==true)
    	echo "$a returns true<br>";
    else
    	echo "$a did not return true<br>";

     

  4. I cannot move past that line of code since it will give you a wrong result in certain situations.  Why would you not listen and think about how you need to change it?

    And as for the rest of the topic I have no idea what your title even means.  "2 if statements for one hide echo"?  What the heck does that mean??

  5. I don't know why my post looks like that.  I didn't add any spaces.  Your line of code is not doing a proper test, as I explained.

     

    OOPS my previous post has a typo.  I meant to say  "strpos function returns an integer result OR a boolean of false.".  (It never returns a boolean of true.)

  6. First thing I would change is this:

    if (strpos($row["message"], 'And Click') == true) {

    if (strpos($row["message"], 'And Click') == true) {

    The strpos function returns an integer result of a boolean of false.  It does not return a true value.  Sure - any non-zero integer could be interpreted as true but what if your string begins with the target value?  The return will be 0 which would not be true.

  7. Still have no idea what you are doing.  And the fact that you don't know what is wrong says you need to re-think what you are doing so that you can do some debugging.  Start with adding some echoes to tell you if things are actually happening as you think they are. Show some values.  Echo out the line numbers that you are getting to.  Follow the process by showing the process, step by step.

  8. I (we?) am not going to look at ALL THIS CODE!  If you want help, then show us the piece of code that has the error and point it out to us and let us tell you what need to change.

    OTOH - if you are looking for help to convert an html page to a pdf I think you should think of it as "converting output to pdf in place of html" and learn how to code using php and something like FPDF to accomplish that.  And if that is not doable then I don't know what you've gotten yourself into.

  9. All of this code does not help to understand your issues.  The main thing though is your switch to an apparently newer and more up-to-date host is that you can no longer use an 'outside' email as the 'from' address for mail.  I do believe that most hosts now insist that you use a domain hosted by that host to use as your sending email.  Consequently you cannot use gmail from your domain.  Your new hosting account must be providing for you a mail service using your new associated domain name and you will have to use that.  And why wouldn't you?  You do have a new domain with this host, don't you?  And you have moved your domain to this new host?  Unless the old domain was being handled by your old host and not technically 'yours'.  In that case you do have an issue.

    I realize that you are not a developer but you are in PHP waters when you are dealing with what appears to be WordPress app that needs to be adjusted to use a new email account.  First thing to know is that there is no 'sendmail' function in PHP.  That may be a WP function in which case you won't get help here unless it's from a member who does WP himself.  Since you've been posted here for 24 hours and you have no response other than from me, perhaps you need to start a new clearer and simpler question on how to 'change my WP mail for a new host' or something like that. Could get you some quicker follow-up.

    Hope this helps

×
×
  • 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.