Jump to content

dwest100

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

1,367 profile views

dwest100's Achievements

Member

Member (2/5)

0

Reputation

2

Community Answers

  1. Hi, I have this curl string required by an email verification vendor I use. Inside my php file I wish to run it. Apparently there is a problem with the syntax as I’m getting the following error in the browser: ”Parse error: syntax error, unexpected '--' (T_DEC) in /var/www/html/wp-content/plugins/dw_functionality_plugin/dw_functionality_plugin.phpon line 398 Here is the code string: < curl --request POST\ --url 'https://api.neverbounce.com/v4/single/check?key={' . api_key . '}&email={' . email . '}; > any help much appreciated!
  2. I have this function which works except it throws a Notice regarding the 3rd line of the function. The Notice reads "Only variables should be passed by reference..." What am I doing wrong in that 3rd line—$caller = next(debug_backtrace()) [‘function’]; ? Thanks for any assistance! //EMAIL_ADMIN //Sends email to site admin if email testing services fail. //Only occurs if both primary and secondary services have failed. //Calls no other function. //Called by test_email function. //*************************************************************** function email_admin($email){ global $full_site_url;//used in links. global $site_title;//used in confirmation messages. $caller = next(debug_backtrace())['function']; //assigns calling function name to $caller. if ($caller == 'alt_test_email'){ //used in email message to provide links for checking services. $primary_service = 'http://www.quickemailverification.com';//used in email message. $secondary_service = 'http://www.neverbounce.com';//used in email message. $to = get_bloginfo('admin_email'); $subject = 'EMAIL TESTING SERVICES HAVE FAILED!'; $message = 'Both email testing services have failed. Go to ' . $primary_service . ' and ' . $secondary_service . '.'; dw_send_email($to, $subject, $message);//call email sending function. } if ($caller == 'unsubscribe'){ $to = get_bloginfo('admin_email'); $subject = $site_title . " unsubscribe"; $message = $email . " has unsubscribed."; dw_send_email($to, $subject, $message);//call email sending function. } if ($caller == 'subscribe_form_display'){ $to = get_bloginfo('admin_email'); $subject = "New " . $site_title . " subscriber"; $message = $email . " has subscribed to " . $site_title . "."; dw_send_email($to, $subject, $message);//call email sending function. } }
  3. Good answer! After much searching and sifting on Google this works very simply: `curl "MY_WEBSITE.com/process_emails.php?url={$full_site_url}&domain={$domain}&site={$site_title}&title={$title}&permalink={$permalink}"`; Enclose entire php command string in backticks —same as typing shell_exec(command string)— Enclose entire argument to curl command in double quotes so the shell interprets the ENTIRE command. Enclose variables in {} instead of concatenating. Simpler and easier to read. The shell was halting the command after the first & because that's what the & does in the linux shell.With the entire string interpreted, it works properly and all 5000 emails are processed outside of my Wordpress site through Amazon SES all nice and tidy and properly authorized with DKIM, SPF and encryption.
  4. Obviously, I have reasons or I would not have bothered posting here. The two isolated strings are within my php code. To make a long story short, I am running the curl command to execute a separate php emailing process outside of my Wordpress site whenever there is a new post. There are 5000+ subscribers each getting an email notification. This technique will let them process in the background...safely. It's no more unsafe than Wordpress site itself. So can you simply answer the question? Which is about syntax I believe?
  5. When this code runs in my php file... `curl https://inklines.art/process_emails.php?url={$full_site_url}&domain={$domain}&site={$site_title}&title={$title}&permalink={$permalink}`; This is all that is sent to the shell: https://MYSITE.COM/process_emails.php?url={$full_site_url} What am I doing wrong in building the command??
  6. I have the following object returned as a response to an external service request: QuickEmailVerification\HttpClient\Response Object ( [body] => Array ( [result] => invalid [reason] => rejected_email [disposable] => false [accept_all] => false [role] => false [free] => false => *********** [user] => ****** [domain] => ******* [safe_to_send] => false [did_you_mean] => [success] => true [message] => ) => 200 [headers] => Array ( [server] => Array ( .....etc. etc. / I can access the [body] node by using var_dump($request->body); And the Array will display on the browser screen as expected. But how do I var_dump any specific value in the Array? Thanks for all assistance!
  7. Suffering from code blindness and sleep dep...help pls. Hi, This itty bitty function is driving me nuts with concatenation! PHP Code: function set_auction_visit_at_job($postid, $auction_end_delayed, $permalink){ `curl https://www.jamewswestpaintings.com/west-fork-river/ | at 23:50`; //curl $permalink | at $auction_end_delayed; add_post_meta( $postid, 'post_auction_visit_set', '1', true ); } As it is now, it does precisely what is expected. It executes the uncommented commands. I can see the at job on the server using atq on the command line. What I NEED it to do is execute the line that is commented out. However, no matter what I do to concatenate it together, it executes the at job repeatedly on the server. I go check if it worked each time and atq reveals multiple at jobs created. I remove them. I try a different concatenation use exec() instead of backticks...same result. Now my brain is fried lol! I have tried every way but the correct way :/ I assigned the concatenated string to a variable and tried executing that...same problem. I know this is simple concatenation but I am not seeing it. Any input would be GREATLY appreciated !
  8. Code: function set_server_jobs() { $permalink = 'https://www.jameswestpaintings.net/about/'; $auction_end_delayed = '23:40'; $curl_command = 'curl ' . $permalink . ' | at ' . $auction_end_delayed; shell_exec("'" . $curl_command . "'"); //echo $curl_command; } add_shortcode('test_curl', 'set_server_jobs'); Question: (Using Wordpress, thus the shortcode) I'm trying to get $curl_command to execute on the server but it isn't working. I echoed the command for testing and it is concatenated correctly. When I run atq on the bash shell no job is listed...meaning none was created by the exec sent to the server. What am I doing wrong? Thanks!
×
×
  • 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.