Jump to content

eddcaton

Members
  • Content Count

    28
  • Joined

  • Last visited

Community Reputation

0 Neutral

About eddcaton

  • Rank
    Member

Recent Profile Visitors

383 profile views
  1. global $wpdb; //// Look at custom current plugin to change below//////// global $wp_query; if (isset($wp_query->query_vars['page_no'])) { print $wp_query->query_vars['page_no']; } ///////////////////////////////////////////////////////// ///////////////////// DO API REQUEST ///////////////////// $per_page = 10; $page = $wp_query->query_vars['page_no']; $url = 'https://api.com/api/v1/products?page='.$page.'&per_page='.$per_page.'q[allowed_stock_type_eq]=1'; $ch = curl_init($url); $customHeaders = array( 'X-SUBDOMAIN:domain', 'X-AUTH-TOKEN:Token' ); curl_setopt($ch, CURLOPT
  2. Yes, i have the code working, but am unsure as to how i loop through the API request pages?
  3. Brilliant, Thanks for the advice. But how do i go about turning my script that works with meta refresh, to one that will work with cronjobs?
  4. I would think that we can have automated updates weekly. Then if i do any large changes i can run the code manually.
  5. To be honest it could loop through every week or so. Basically i use a web based rental system to keep track of hires and inventory which i am using to update a wordpress website with the hire products details so that customers can see it from the website. The hire products can have their details updated every few weeks, by multiple users who inherently don't tell me if they update things, hence an automatic update. I have the update process working through a wordpress template which i am just manually accessing at the moment.
  6. Hey All, I am using a Curl script to call item details from an API and then updating mysql with the results. But the API is limited to 100 requests per 60 seconds. So I am currently just using: $page = $_GET["page"]; $next_page = ++$page; echo "<meta http-equiv='refresh' content='60;url=?page=".$next_page."'>"; This runs until the results from the API runs out, then resets the page number to 1 and loops through again. My question is, will this would the same with a CRON job?
  7. Thanks for the reply, do you know if i can send this custom data with the PayPal SDK?
  8. Hey All, I have setup a Paypal API to handle the recurring payments on my website, once the payment is completed I get a token id and ba_token id return. I am storing this in a database, but wondered how people link this with a user table? I could use a cookie to store the user's id before payment and then get it once the payment is complete, but this would not work with the subsequent recurring payments. How do you go about sending the user id when a recurring payment happens? Any advise would be appreciated. Edd
  9. I have managed to get a little further with this. Could anyone advise how to get the filenames back to my form.php file: This is my upload.php file that my form.php sends the drop zone upload request. <?php /** * Dropzone PHP file upload/delete */ // Check if the request is for deleting or uploading $delete_file = 0; if(isset($_POST['delete_file'])){ $delete_file = $_POST['delete_file']; } $targetPath = dirname( __FILE__ ) . '/user_uploads/item/'; // Check if it's an upload or delete and if there is a file in the form if ( !empty($_FILES) && $delete_file ==
  10. I am after some guideance / best practices for dropzone.js inside a text form. I have a form that is used to create listings on a website and it has text fields and a dropzone.js file uploader in it. But on submit of the completed form, i would like it to upload the files and submit the text fields to mysql. The upload files part is working and also the mysql part working but I cannot work out how to make the relationship between the listing and the images that are attributed to the listing, which are stored in different tables. At the point of submission the user is not logg
  11. Thanks for all the help and assistance on this really annoying issue. I have now found the error in the code. When coding in Sublime everything looks fine and no issues. When i took a look at the file directly from Cpanel there was a single . before <?php which threw the whole lot off. I have removed the dot from the cpanel view and it works perfectly now.
  12. Thanks for the info. 1. Shows up an error on the working and not working file Warning: Cannot modify header information - headers already sent by (output started at /homepages/41/d553935649/htdocs/edd/login.php:1) in /homepages/41/d553935649/htdocs/edd/login.php on line 47 Warning: Cannot modify header information - headers already sent by (output started at /homepages/41/d553935649/htdocs/edd/login.php:1) in /homepages/41/d553935649/htdocs/edd/login.php on line 48 line 1: <?php line 47: setcookie("login_id", $randomNumber, time()+86400); line 48: header("location:
  13. Thanks. I will take a look at changing the PHP settings. Do you think this might influence the cookie setting?
  14. Hey, error_reporting is set to 22517 and display_errors is set to on
  15. if(password_verify($_POST["user_password"], $row["user_password"])) //// Check PHP HASH ///////////// { $randomNumber = rand(); $user_id = "$row[user_id]"; setcookie("login_id", $randomNumber, time()+86400); $sql2 = "UPDATE user_details SET login_id=$randomNumber WHERE user_id='$user_id'"; if ($mysqli->query($sql2) === TRUE) { } header("location:index.php"); exit(); MYSQL submits fine and the table is updated fine when the login form is completed. Wha
×
×
  • 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.