Jump to content

dontknowphp

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by dontknowphp

  1. im developing an admin dashboard and some of the actions (button clicks, search, etc.) require that the page reloads so the new data from user input are submitted. I was using xajax to handle such cases. e.g user clicks button, with xajax i manipulate the DOM and show a loading animation, do some php execution, when done, remove the loading animation and show something else it may be a new form, success message, or anything
  2. What is the best alternative to xajax to manipulate HTML easily? I found a more modern solution called Jaxon, are there any other better alternatives?
  3. The subject may change in the ticketing, so mapping it with the subject may not be reliable I am confused with this bit, when i am replying through the ticket system do i need to construct the "message id" or is that automatically done?
  4. Hello @gizmola @kicken Thank you for your help, i ended up using the library from barbushin. However, i have one more question. How can I "detect" which reply is associated with the original email? Steps 1) User sends email to example@example.com 2) cron job runs checks for new emails and creates new "tickets" (save to db) 3) Admin replies from the webapp 4) User replies to the admin's response 5) cron job runs detects new email -> i need somehow to map it with the existing ticket so the system won't create a new ticket again. I suspect that the "messageid" has something to do with this but i haven't found any way to take advantage of it.
  5. thank you for the example, ive managed to make it work. However, since i want to save attachments as well, isn't there any "known" library that has all these functions so i don't lose time to develop all these functionality? some sort of "Plug and play" library?
  6. can you share an example of an imap connection? i've tried a few example ive found online but i cant make it to work. <?php $db->query("SELECT * FROM st_settings"); while($db->movenext()) { $st_settings[$db->col["name"]] = $db->col["value"]; } $inbox = imap_open("{".$st_settings["SMTP_HOST"].":".$st_settings["SMTP_PORT"]."/pop3/novalidate-cert}", $st_settings["SMTP_USERNAME"], $st_settings["SMTP_PASSWORD"]); $num = imap_num_msg($inbox); echo $num; // close the connection imap_expunge($inbox); imap_close($inbox); ?>
  7. thanks for the info, is it possible to connect to a mailbox with imap so the emails won't get deleted like they do with pop3?
  8. Hi, I was wondering if there is any simple library that could read/fetch emails from an smtp email account that I could use to save the details on my database. Use Case: Execute a cron job every X minutes to check if any new emails have arrived in the inbox and save them to the database (just like most of the support ticketing systems work) Looking to create a simple support ticketing system.
  9. thank you, full path worked thank you. Yes, i will make a "task manager" class later. Is there any way to pass parameters in the cronjob? I want to execute the following code as a cron but idk how to pass the parameters for the processProducts function ($vendor_box, $selected_language, etc.) The value of the parameters do not contain simple string values, but arrays instead. <?php require_once("content/classes/class.feed_import.php"); $feed_import_helper = new FeedImport(); $feed_import_helper->processProducts($vendor_box, $selected_language, $selected_options, $selected_cid, $parsed_data, $selected_products); ?>
  10. Hi, I am using this library to manage crons. https://github.com/TiBeN/CrontabManager I am successfully creating cron jobs in the crontab however (i can see them), the crontab seems never to be running. The admin_task.php is not being executed <?php require_once("content/classes/class.crontab.php"); require_once("content/classes/class.crontabcli.php"); require_once("content/classes/class.cronjob.php"); $crontabRepository = new CrontabRepository(new CrontabAdapter("user", false)); $ar = $crontabRepository->getJobs(); print_r($ar, true); $crontabJob = new CrontabJob(false, true); $crontabJob ->setMinutes(1) ->setHours('*') ->setDayOfMonth('*') ->setMonths('*') ->setDayOfWeek('*') ->setTaskCommandLine('php -f content/admin/admin_task.php') ->setComments('Logging disk usage'); // Comments are persisted in the crontab $crontabRepository->addJob($crontabJob); $crontabRepository->persist(); ?>
  11. Hi, im using a dedicated ubuntu server running the latest Plesk web host edition. i can change the php configuration directly from the plesk panel. the SEO friendly URLs are configured on the .htaccess file (i manually edit the htacess and use RewriteEngine rules)
  12. Hello, I am experiencing this weird issue, if i select the php to run as php fpm served by apache, there is a specific case where my application downloads an HTML file instead of executing (redirecting) to the page. PS: If i enable seo friendly urls it downloads a php file, without SEO urls it downloads an HTML file (not sure if that helps) If i change the above option to FastCGI the application runs fine without downloading any files Are there any common solutions for such cases? I would have posted a code sample for you to check, but I am not sure which part of my code could interfere with this. Maybe it server fault and not php?
  13. hello, thank you for the replies, the task that is taking long enough is not due to the code but its the amount of data that is processing. Use Case: process a product feed from an ecommerce platform and import them to another platform. If the products are >10000 it will obviously start to get slow, especially if the images are downloaded as well. I will check gearman and get back if i have any questions. is the cron job a good approach tho? do cron jobs still get limited by server limits (max execution time etc?)
  14. Hello, I am trying to find the best possible way to run php functions/files in the background without affecting the browser/user experience. Problem: Some tasks take 10-20 seconds to execute, when the php code is being executed and it has to process a lot of data, the browser hangs and I can not use the admin dashboard (even if i open a new tab and open a different page - it does not load unless the previous tab has completed executing) Maybe if I run the php functions as a cron job (and show a progress bar to the user) will solve that issue? e.g Plesk Hosting Panel, when you execute a cron job it runs on the background and you can use their admin dashboard without issues.
×
×
  • 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.