Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Posts posted by CroNiX

  1. Its not going to be easy due to all of the malformed/improper HTML of those pages.

     

    You'd start by using either CURL, or file_get_contents() and retrieve that remote page. The rest gets trickier. Normally you could use some libraries to traverse the DOM tree of the retrieved page, but this page has no document declaration, no html section, no head section, no body section, etc. It's just a straight list of <p> tags. So not sure if any of the dom traversing libraries, such as simple_html_dom, will be able to parse it.

     

    So you might be needing to use regex to get the bits you want out of each line (player name, guid, time and date)

    Then for each line, you'd need to also grab the href from each <a> tag, since that's where the image is located. Again, those pages are not using proper HTML markup:

    <p> <img src=pb001759.png> 

    Once you can decipher the img src, you'd grab the image using, again, file_get_contents or CURL. I'd store all data in the database so it's easily sortable and you can look up things faster, like retrieving all data for a particular username.

  2. You don't seem to have a session_start() at the top of your page, but you are using $_SESSION.

     

    Another thing I see is you don't define $mail_body before you start appending to it using the .= concatenation. That's probably not breaking things but it probably is issuing a 'notice' level error.

    $mail_body .= '<html><body>';

    Try

    $mail_body = '<html><body>';

    Your last $header should have \r\n at the end

    $header .= "Content-Type: text/html;\r\n";

    In addition to turning display errors on and checking the logs, I'd also try outputting your $mail_body HTML to the page and not sending the email to see if your table is displaying correctly as a quick test.

  3. Add a column to managers table to store image name, since each manager will ONLY have one image per manager. Perhaps "image_name".

     

    Since services can have more than one image per service, create a separate table for "service_images".

    -id

    -service_id (fk -> services.id)

    -image_name

    -image_order (if you want to order them in a certain way, like for displaying)

  4. You're looking for an href here (in the timeout):

    document.location.href = link.href;

     

    <inputs> don't have an href attribute.

    Here's the input you're passing to your js function:

    <input type="submit" name="submit" value="Submit" class="submit-button" onClick="trackOutboundLink(this, 'Contact', 'Signup', 'New Signup');" />

  5. Not sure if this is what you want, but you can try:

    $teste = mysqli_query($con, "SELECT * FROM `mensagens` WHERE `id`= '$mensagem' ORDER BY raiz ASC");

    If I'm reading your scenario and data right, using the order by will return all results with "raiz = 0" (original message) being the very first result, and the rest of the results would be "raiz = 1" which are the replies. However I really don't think you DB Schema is set up the best way for this sort of thing. I'd add a parent ID column. Original messages would have parent_id of 0, and replies would have parent_id of the original question. I'd also have a datetime column for when the original message and the reply was posted then you could properly order them.

  6. I agree. However, I do not reuse the top level $xbox360Games again inside the loop.

    I disagree :)

     

    Here, you break out of the 2nd loop ONLY if the condition passes, which returns you to the original first loop where you have already overridden the original array. If the condition never passes in the 2nd loop, it also returns to the first original loop.

    if ($val2['Purpose'] == "BoxArt" && $val2['Height'] == 300) {
      $url = $val2['Url'];
      $htmlxbox .= "<img src=\" $url \" title= Current Game Score:". $val['currentGamerscore'] . ">";
      break;
    }

  7. foreach($xbox360Games['titles'] as $val) {
    // ...
      $xbox360Games = getGameInfo(dechex($val['titleId']));  //Don't create a new $xbox360Games here, you're wiping out the original array that you're looping over above!
    }
  8.  

     

    i put thread to hope someone will help me to do table vertical cell data that from GET and POST, several people answer in comment, so I tried to fix by learn from those comment, then page went into error showing those quote about memory is not allowed

     

    You should post the code that you altered in your above comment then if it was working previous to your modifications

  9. It looks like you have debugging turned on in PHPMailer. None of this should be seen in your "view source" or webpage at all, except for testing...

    OK HERE WE GO<br><br>code is: a9f1e5cf855cffc3ab1807f62dee3ebd2015-06-12 06:34:44    SERVER -> CLIENT: 220 mail-out2.one.com ESMTP Postfix
    2015-06-12 06:34:44    CLIENT -> SERVER: EHLO wisewarrior.co.uk
    2015-06-12 06:34:44    SERVER -> CLIENT: 250-mail-out2.one.com
         250-PIPELINING
         250-SIZE 104857600
         250-ETRN
         250-ENHANCEDSTATUSCODES
         250-8BITMIME
         250 DSN
    2015-06-12 06:34:44    CLIENT -> SERVER: MAIL FROM:<XXXXXXXXXXXXXXXXXXXX>
    2015-06-12 06:34:44    SERVER -> CLIENT: 250 2.1.0 Ok
    2015-06-12 06:34:44    CLIENT -> SERVER: RCPT TO:<XXXXXXXXXXXXXXXXXXXX>
    2015-06-12 06:34:44    SERVER -> CLIENT: 250 2.1.5 Ok
    2015-06-12 06:34:44    CLIENT -> SERVER: DATA
    2015-06-12 06:34:44    SERVER -> CLIENT: 354 End data with <CR><LF>.<CR><LF>
    2015-06-12 06:34:44    CLIENT -> SERVER: Date: Fri, 12 Jun 2015 06:34:44 +0000
    2015-06-12 06:34:44    CLIENT -> SERVER: To: User <XXXXXXXXXXXXXXXXXXXXXX>
    2015-06-12 06:34:44    CLIENT -> SERVER: From: Me <XXXXXXXXXXXXXXXXXXXXXXX>
    2015-06-12 06:34:44    CLIENT -> SERVER: Subject: Here is the subject
    2015-06-12 06:34:44    CLIENT -> SERVER: Message-ID: <bb519cc9520b2b4bd0d0532190b929bc@wisewarrior.co.uk>
    2015-06-12 06:34:44    CLIENT -> SERVER: X-Priority: 3
    2015-06-12 06:34:44    CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.10 (https://github.com/PHPMailer/PHPMailer/)
    2015-06-12 06:34:44    CLIENT -> SERVER: MIME-Version: 1.0
    2015-06-12 06:34:44    CLIENT -> SERVER: Content-Type: multipart/alternative;
    2015-06-12 06:34:44    CLIENT -> SERVER:     boundary="b1_bb519cc9520b2b4bd0d0532190b929bc"
    2015-06-12 06:34:44    CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
    2015-06-12 06:34:44    CLIENT -> SERVER:
    2015-06-12 06:34:44    CLIENT -> SERVER: This is a multi-part message in MIME format.
    2015-06-12 06:34:44    CLIENT -> SERVER:
    2015-06-12 06:34:44    CLIENT -> SERVER: --b1_bb519cc9520b2b4bd0d0532190b929bc
    2015-06-12 06:34:44    CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii
    2015-06-12 06:34:44    CLIENT -> SERVER:
    2015-06-12 06:34:44    CLIENT -> SERVER: This is the body in plain text for non-HTML mail clients
    2015-06-12 06:34:44    CLIENT -> SERVER:
    2015-06-12 06:34:44    CLIENT -> SERVER:
    2015-06-12 06:34:44    CLIENT -> SERVER: --b1_bb519cc9520b2b4bd0d0532190b929bc
    2015-06-12 06:34:44    CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii
    2015-06-12 06:34:44    CLIENT -> SERVER:
    2015-06-12 06:34:44    CLIENT -> SERVER: http://www.somesite.co.uk/login.html?&key=a9f1e5cf855cffc3ab1807f62dee3ebd
    2015-06-12 06:34:44    CLIENT -> SERVER:
    2015-06-12 06:34:44    CLIENT -> SERVER:
    2015-06-12 06:34:44    CLIENT -> SERVER:
    2015-06-12 06:34:44    CLIENT -> SERVER: --b1_bb519cc9520b2b4bd0d0532190b929bc--
    2015-06-12 06:34:44    CLIENT -> SERVER:
    2015-06-12 06:34:44    CLIENT -> SERVER: .
    2015-06-12 06:34:44    SERVER -> CLIENT: 250 2.0.0 Ok: queued as 547EA1452C
    2015-06-12 06:34:44    CLIENT -> SERVER: QUIT
    2015-06-12 06:34:44    SERVER -> CLIENT: 221 2.0.0 Bye

    The only thing that should really be seen is whether the message was sent or not..."Message has been sent"

     

    In PHPMailer config, make sure:

    $config['smtp_debug'] = 0;

  10. Not to do with your problem, but are you saving that in the database somewhere before sending the email off?

     

    I'd change

    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
    print "code is: $activation";

     

    to

    $mail->AltBody = "This is the body in plain text for non-HTML mail clients\n\n" . $message;

    and just send your original message, which is just a link. Even in text, most email clients will convert a link starting with "http" to a clickable link.

  11. A few things.

     

    1) you can't use getElementById() unless there is actually something with the ID. You're not using ANY ID's on any of your form elements so it won't work.

    2) onclick="myF(this.form)" You're sending the ENTIRE form to myF(). That's why you're getting an "object" in the alert()

     

    Try changing these lines:

    //give this form field an ID of 'amount'
    <input type='text' name='amount' value='50.00' id="amount" />
     
    //no need to pass anything to the myF() function
    Change: <input type="checkbox" name="chg" onclick="myF()">
     
    <script type="text/javascript">
    function myF() {
        //get value from the form field that has the id of 'amount'
        var amount = document.getElementById('amount').value;
        alert("You have now changed the amount to pay: " + amount );  //alerts 50.00 unless value changed
    }
    </script>
  12. I'm not understanding what you're after. Your link is syntactically correct assuming $uompScheduleNumber and $PRT_FR are defined somewhere before you output the link.

     

    It sends parameters "sn" and "itm" via GET.

     

    What exactly isn't working for you? What is wrong with what you have? How is it supposed to work?

  13. You shouldn't use php to calculate that. Use mysql's SUM() function.

     

    This might be all you need to change:

    $prepare = $db->prepare("SELECT SUM(post_counts) as total_posts FROM posts_determine WHERE user_id = ?");

    Now you'll just a single row returned with "total_posts" in the result set with a total and don't need to loop over everything as mysql has done that internally for you.

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