Jump to content

mark107

Members
  • Content Count

    80
  • Joined

  • Last visited

Community Reputation

0 Neutral

About mark107

  • Rank
    Regular Member

Recent Profile Visitors

1,239 profile views
  1. Thank you very much for this as it is working great. Problem are now resolved.
  2. I dont store these strings seperate. I stored altogether. See this for yourself !
  3. It doesn't make sense. I have asked how to remove the string and get the filename. I have tried this and it doesn't work. foreach ($attached_files_name as $filename) { if(strpos($filename, 'attid: ' . $attach_id) !== false) { $filename = str_replace('attid: ' . $attach_id, '', $filename); } if(strpos($filename, ' attid: ' . $attach_id . ' ') !== false) { $filename = str_replace(' attid: ' . $attach_id . ' ', '', $filename); } echo $filename; echo "<Br>"; }
  4. Why do I need to do that as I have already fetching the data and store in the array? I want to split the string for value like "0 filename: ", "1 filename: ", "2 filename: ", "3 filename: " or whatever it is to replace with empty string.
  5. Hi all, I am working on the PHP to fetch the data from the database. I would like to fetch the filename only following by: email1.png email2.png email3.png my_inbox.png When I try this: $mailbox_sql = 'SELECT * FROM ' . $mailfolder . ' WHERE email_id = ? AND message_id = ?'; $mailbox = $link->prepare($mailbox_sql); $mailbox->execute([$id,$message_id]); // set the resulting array to associative $row = $mailbox->fetch(PDO::FETCH_ASSOC); if (is_array($row)) { $attached = $row['attached_files']; $attached_files_name = explode('attid: ', $attached); } I am getting this: 0 filename: email1.png 1 filename: email2.png 2 filename: email3.png 3 filename: my_inbox.png Here is what I have stored in the database: attid: 0 filename: email1.png attid: 1 filename: email2.png attid: 2 filename: email3.png attid: 3 filename: my_inbox.png Here is what I want to achieve: email1.png email2.png email3.png my_inbox.png Can you please show me example how I could get the filename when I am fetching the data from the database? Thanks in advance.
  6. I cant remove the "185.220.101.46" because it come with it when i'm getting access to the site which i am not allowed to post it. So what I have to do then? Create a foreach loop to fetch the values and store in the array?
  7. I have tried this: echo $data->data['185.220.101.46']->appears; it doesn't work. Any idea? It would be easier if you could post the code of what i should use.
  8. T Thanks for your advice, I have removed it but I cant get the value of `appears` from the array as I am getting the same error. Any idea?
  9. Hi all, I need some help with my code as I have a hard time with fetching the value from the stdclass. I am using json data to convert it to PHP so I would like to fetch the "appears" data from the stdclass object. When I try this: echo $data->appears; I'm getting this: Notice: Trying to get property of non-object in /home/username/public_html/foldername/script.php on line 22 I have also tried this: echo $data[0]->appears->value; And this: echo $data->appears[0]->value; I am still get the same error so I dont know what to do to resolve it. Full code: <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $json = '{"data":{"185.220.101.46":{"domains_count":0,"domains_list":null,"updated":"2019-12-02 22:04:25","spam_rate":1,"frequency":6827,"frequency_time_24h":106,"frequency_time_1h":2,"network_type":"hosting","in_antispam":1,"in_security":0,"appears":1,"country":"DE","submitted":"2018-01-11 20:34:37","frequency_time_10m":2,"sha256":"e39d4a9be2f210d1a75ba2b5ece08a4b35e99002b03aeb6ceaad1d98de87c248"}}}'; // Converts it into a PHP object $data = json_decode($json, true); //print_r($data); echo $data["appears"]->value ."<br/>"; //var_dump($data[1]->{'updated'}); //echo $data->updated[1]->value; ?> STDClass object: Array ( [data] => Array ( [185.220.101.46] => Array ( [domains_count] => 0 [domains_list] => [updated] => 2019-12-02 22:04:25 [spam_rate] => 1 [frequency] => 6827 [frequency_time_24h] => 106 [frequency_time_1h] => 2 [network_type] => hosting [in_antispam] => 1 [in_security] => 0 [appears] => 1 [country] => DE [submitted] => 2018-01-11 20:34:37 [frequency_time_10m] => 2 [sha256] => e39d4a9be2f210d1a75ba2b5ece08a4b35e99002b03aeb6ceaad1d98de87c248 ) ) ) Var_dump: array(1) { ["data"]=> array(1) { ["185.220.101.46"]=> array(15) { ["domains_count"]=> int(0) ["domains_list"]=> NULL ["updated"]=> string(19) "2019-12-02 22:04:25" ["spam_rate"]=> int(1) ["frequency"]=> int(6827) ["frequency_time_24h"]=> int(106) ["frequency_time_1h"]=> int(2) ["network_type"]=> string(7) "hosting" ["in_antispam"]=> int(1) ["in_security"]=> int(0) ["appears"]=> int(1) ["country"]=> string(2) "DE" ["submitted"]=> string(19) "2018-01-11 20:34:37" ["frequency_time_10m"]=> int(2) ["sha256"]=> string(64) "e39d4a9be2f210d1a75ba2b5ece08a4b35e99002b03aeb6ceaad1d98de87c248" } } } Can you please show me an example how I can fetch the `appears` from the stdclass object? Any advice would be much appreciated.
  10. Thank you, I can see it is working great thanks.
  11. Thank you very much for this, but when I try this: if(strtotime($get_time) < strtotime("now")) { $autoresponder_date = strtotime($get_time. "+ 1 day"); } echo $autoresponder_date; I am getting this: 1575042480 Any idea how i can convert it to date with the time?
  12. Yes this is what I am trying to do. I want to see if the hour has gone past and increment the date. How I can do that? Do I have to use something like this? if (date('H') > $get_time) { //let do something }
  13. Hi all, I am working on my PHP script to set up the date with the time for the autoresponder so I can send out the emails at the specific time. I need some help with set up the correct day date with the time, because on my code when I have two different times `06:00` and `20:00`, as both of them will show the time with the current day date, e.g: 28-11-2019. I find that my code have set up the date as incorrect because the time I have `06:00` which it should have set up with the next day date, e.g 29-11-2019 instead of 28-11-2019 and the time `20:00` should set up with the current day date as my current time is `15:26pm` right now. Output for `$autoresponder_date`: 2019-11-25 06:00 2019-11-25 20:00 Output for `$get_time`: 06:00 20:00 Here is the code: $auto_responders = $link->prepare('SELECT * FROM autoresponder WHERE campaign = ? ORDER BY id ASC'); $auto_responders->execute([$campaign]); $auto_responders->setFetchMode(PDO::FETCH_ASSOC); $auto_responders = $auto_responders->fetch(PDO::FETCH_ASSOC); $get_time = $auto_responders['send_time']; if ($get_time >= strtotime('00:00')) { $autoresponder_date = date('Y-m-d', strtotime($get_time . ' +1 day')); } else { $autoresponder_date = date('Y-m-d', strtotime($get_time)); } $send_time = $autoresponder_date . ' '. date('H:i ', strtotime($get_time)); Can you please show me an example how I can set up the day date for the time `06:00` and `20:00` as if I have the time is `06:00` then check if the time have passed before I could do anything to send the email and it is the same for the time `20:00:00`? Thank you.
  14. Yes. Can you also answer my questions regards to db that if it is a good idea to encode the HTML to store the hash in a db?
×
×
  • 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.