Jump to content

concatenation diving me nuts!


dwest100

Recommended Posts

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 !

Link to comment
Share on other sites

This is an awful hack even for WordPress standards. Dumping variables straight into a shell and accepting arbitrary commands from a remote(?) server is a sure way to get compromised.

 

Tell us what you want to do, not how you think it should be done. What's the matter with those shell commands you want to execute?

Edited by Jacques1
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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