Jump to content

dwest100

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

1,642 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. 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 !
  4. 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!
  5. What is the proper way to write this statement? (It is part of a larger function) <?php echo '<a href=the_post_thumbnail( 'medium' );><img src=the_post_thumbnail( 'thumbnail' );/></a>' ?> the_post_thumbnail() returns the thumbnail for the post in the size specified by the argument. Thanks!
  6. Disregard! I figured it out. seems all one has to do is enlist the help of others on a forum and the Great Aha comes on it's own :-) Thanks for reading! I was calling th wrong function duh! Sorry!
  7. Hi, I have this snippet in my page: <?php echo $EM_Booking->get_price(true) * $EM_Booking->get_spaces(); ?> The page executes with no hitches except the price is not multiplied by the spaces. I get and echo of "0". I'm new to this. Any help would be greatly appreciated and 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.