Jump to content

Jwest100

Members
  • Posts

    13
  • Joined

  • Last visited

Jwest100's Achievements

Member

Member (2/5)

0

Reputation

  1. Okay... here's the process: The page runs for 24 hours. All of that is already taken care of so no reason to discuss that here. I just need to have the server visit the page URL one time after the $auction_end time of that page. This will trigger an email function which needs to run AFTER $auction_end. I can't depend on a random user to visit the site for me to trigger the email function. So, to make it automatic: -When the page is loaded the first time, create a cron job programmatically using php exec() to visit the page at whatever time is assigned to $auction_end. -After the visit takes place, delete the cron job. Later, perhaps a week later, I may run the page again for 24 hours with different time criteria. Thus the need to make the cron creation/ deletion self contained within the page code. In summary: I just need to run the php exec() function, with the proper command between the (), to create the cron job to visit http://my URL at precisely $auction_end. Then run another exec() to delete the cron job AFTER that has happened. In both cases I'll put a piece of data in the db indicating they took place. I'll check that data on subsequent page visits by random visitors to prevent it from happening more than once. Make sense?
  2. In my php script... I display a form for a specific interval. I have a variable: $auction_end, which is formatted as a unix time stamp, as the end time for that interval. In the script, the first time it is loaded in the browser, I want to create a cron job that visits the URL for the form at the time which is $auction_end. That will trigger an email function within my script. I can take care of making sure the cron job is only created one time with conditional statements. So no worries there. Likewise for not triggering the email function more than once after the end time. The problem then is how do I create the cron job using php code? I'm thinking exec( shell script code); But I don't know the shell commands at all, nor how to use the variable in the shell command. Any and all help would be greatly appreciated!
  3. Thank you for that Destramic! Sanitizing is the next thing I'll be digging in on
  4. Many, many thanks to you both! Seeing it done correctly and getting some rules to simplify the thinking is EXACTLY what I needed to help me understand the logic Thanks so much!
  5. I've been struggling with this for hours and can't seem to understand how the quote syntax works. Can someone tell me what is wrong and explain please? Much appreciated! $form_output .= '<p><label for="email">Notification email (IMPORTANT!) <span>*</span><br><input type="text" name="email" value=" . 'echo $_POST' . "></label></p>';
  6. Brilliant answer! You win a cigar Barand! The help is much appreciated and explicitly reminds me how arrogant and absurdly self-righteous coders are. Apparently unable to intuitively interpret a question in any other way than literal. Congrats! You are a huge contributor to everyone you meet I bet. It would be best to not answer my friend if that is all you can contribute.
  7. Hi, Without trying to analyze what I'm doing or why, and to keep the question as simple as possible, can anyone tell me if there is any problem with the way I have written these statements? The code will be controlling the HTML display in a page. some HTML content... <?php if(!get_post_meta(get_the_ID()),'buy_status', true); echo "<h5 style="text-align: center;display: block;">"; echo "Sorry, this piece is sold."; else echo "<h5 style="text-align: center;display: none;">"; endif; ?> </h5> More HTML content...
  8. And yes it has a php extension. The php statement is inside a Wordpress post.
  9. Oh yes. No problems there. Site is php Wordpress and ha been running fine for months. Just adding a customization and I'm clueless on how this statement should be configured in order to work
  10. I have this html with a php statement embedded: <div style="text-align:center;<?php if(!get_post_meta(get_the_ID(), 'buy_status', true)): ?>display: block;<?php else: ?>display: none;<?php endif; ?>> content </div> However the php isn't getting evaluated. It is simply showing as text in the source code. 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.