Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Abrar's Achievements


Member (2/5)



  1. Hi Friends, Please find the details: 1. Windows 10 2. Its a basic .PHP file program which has been made to trigger on regular basis using Task Scheduler in windows 10. 3. PHP version 8. 4 .I am trying to copy from one server to another server using a third server. 5. Below is the code i am using. <?php $source = 'xxx.xxx.xxx.xxx/sr/'; // source folder or file $destPath = 'xxx.xxx.xxx.xxx/dest/'; // destination folder or file $files = scandir($source); $archiveFiles = array(); foreach ($files as $file) { if (!in_array($file, array(".", ".."))) { $lastModified = date('d/m/y', filemtime($source . '/' . $file)); if ($lastModified == date("d/m/y")) { array_push($archiveFiles, $file); echo $file . '<br>'; if (copy($source . $file, $destPath . $file)) { echo "files copied"; } else { echo "Canot Copy file"; } } } else { echo "Not Copied " . '<br>'; } } ?>
  2. Hi Kicken, Thank you so much for your reply and support! Yes, even i am trying to copy db backup files on regular basis... The destination do support large files since we manually copy those files but trying to automate with PHP and facing this issue... The same program i am using for the backup ARC files and works like charm. Please guide me. Thank you.
  3. Hi Friends, I am trying to write a small program to copy files on regular basis automatically using PHP.. I have written the code and it works well but any file more than 4GB, its only copying up to 4GB, others are ignored. eg. a video file with 8GB, if we try to copy with the below code, It is only coping 4GB as a result the video is corrupt. Please help, Thanks <?php $source = 'd:/'; // source folder or file $destPath = 'C:/'; // destination folder or file $files = scandir($source); $archiveFiles = array(); foreach ($files as $file) { if (!in_array($file, array(".", ".."))) { $lastModified = date('d/m/y', filemtime($source . '/' . $file)); if ($lastModified == date("d/m/y")) { array_push($archiveFiles, $file); echo $file . '<br>'; if (copy($source . $file, $destPath . $file)) { echo "files copied"; } else { echo "Canot Copy file"; } } } else { echo "Not Copied " . '<br>'; } } ?>
  4. Hi Requinix, Thanks for ur reply! here is my code! <table class="table table-hover font" id="user_table"> <tr> <th>PRODUCT</th> <th>DESCRIPTION</th> <th>REMARKS</th> <th>RESULT DESCRIPTION</th> <th>ACTION</th> </th> </tr> <?php $sql_fin_update = "SELECT A.Department_Code || '/' ||A.Product_Code as Product,B.Description_Arb as Description,A.Remarks as Remarks,D.Result_Description as Result_Description, C.Showroom_Code as showroom_Code,C.Invoice_No as Invoice_No,A.Entered_On as Entered_On,A.User_Id as User_Id From Inv_Qc_Schedule_Detail A ,Inv_Dsales C,Inv_Product B,Inv_Qc_Visitresult D Where A.Showroom_Code = '$SHOWROOM_CODE_Q' And A.Invoice_No = $invoice_q And C.Showroom_Code = A.Showroom_Code And C.Invoice_No = A.Invoice_No And C.Serial_No = A.Inv_Srlno And B.Department_Code = C.Department_Code And B.Product_Code = C.Product_Code And D.Visit_Result = A.Qc_Finding"; $sql_fin_parse = oci_parse($conn, $sql_fin_update); ociexecute($sql_fin_parse); while ($row_coun_fin = oci_fetch_array($sql_fin_parse, OCI_RETURN_NULLS + OCI_ASSOC)) { ?> <tr id="row<?php echo $row_coun_fin['PRODUCT']; ?>"> <td id="pro_val<?php echo $row_coun_fin['PRODUCT']; ?>"><?php echo $row_coun_fin['PRODUCT']; ?></td> <td id="desc_val<?php echo $row_coun_fin['PRODUCT']; ?>"><?php echo $row_coun_fin['DESCRIPTION']; ?></td> <td id="remarks_val<?php echo $row_coun_fin['PRODUCT']; ?>"><?php echo $row_coun_fin['REMARKS']; ?></td> <td id="result_val<?php echo $row_coun_fin['PRODUCT']; ?>"><?php echo $row_coun_fin['RESULT_DESCRIPTION']; ?></td> <td style="display: grid;"> <input type='button' class="edit_button btn btn-info btn-sm m-1" id="edit_button<?php echo $row_coun_fin['PRODUCT']; ?>" value="edit" onclick="edit_row('<?php echo $row_coun_fin['PRODUCT']; ?>');"> <input type='button' style="float: right;" class="save_button btn btn-success btn-sm m-1" id="save_button<?php echo $row_coun_fin['PRODUCT']; ?>" value="save" onclick="save_row('<?php echo $row_coun_fin['PRODUCT']; ?>')"> </td> </tr> <?php } ?> </table> function save_row(id) { var remarks_text = document.getElementById("remarks_text" + id).value; var remarks_text = document.getElementById("remarks_text" + id).value; var remarks_text = document.getElementById("remarks_text" + id).value; var result_text = document.getElementById("result_text" + id).value; console.log(remarks_text); console.log(result_text); $.ajax({ type: 'post', url: 'modify_records.php', data: { edit_row: 'edit_row', row_id: id, remarks_val: remarks_val, result_val: result_val, showroom_code_q: showroom_code_q, invoice_q: invoice_q // showroom_code_q: showroom_code_q, // invoice_q: invoice_q }, success: function(response) { if (response == "success") { document.getElementById("remarks_val" + id).innerHTML = remarks_val; document.getElementById("result_val" + id).innerHTML = result_val; document.getElementById("edit_button" + id).style.display = "block"; document.getElementById("save_button" + id).style.display = "none"; } } }); } Thank you. Please assist me
  5. Hi Friends, I need to create a editable table and all the values in the table should be summited with a single save button, Please help. I was able to save the rows separately but actually what i need is to submit all the modified text in a single button instead a separate button beside each rows.
  6. HI, gw1500se, Thank you so much for the reply! I understood but to make it little more clear, can you help me with some examples since i am newbie to PHP. Thank you so much
  7. Hi Friends, I have developed an API for a client and Could you please help me secure database connection as i don't want to hard code any credentials in the PHP script. Thanks in advance.
  8. Hi friends , I have developed an API and ready to provide that to our client. I would like to know how to handle the security parameters? How to generate API key?
  9. Thanks for the reply Barand! I went through that link, Still i have few confusions.. Can you be more specific please. I am actually making an API and need to provide that ink to client so i have created a connection file as above and uploaded that in a hosting and tried to trigger that from other WWW. But the page is blank and no error msg also... How can i get that connected? Hope i was able to explain you better...Thank you once more... Is this a right way to HOST the API?
  10. r/PHP •Posted by u/Abrar_Sh 5 minutes ago How to connect Oracle database in PHP from external network? Hi Friends, I am trying to connect to oracle db from outside network.. i have enable access to that public IP and port. I am also able to ping that IP from outside network, But not able to connect to database. Please let me know if there is any error in my code.. or is there any other way to connect. Your help is highly appreciated. <?php // Create connection to Oracle $conn = oci_connect("xxxxUSERNAME", "xxxxPASSWORD", "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = xx.xxx.xx.xx) (PORT = 2000) ) (CONNECT_DATA = (SID = xxxxx)))", "AL32UTF8"); if (!$conn) { $m = oci_error(); echo $m['message'], "\n"; exit; } else { print "Connected to Oracle!"; } ?>
  11. Hi @NotionCommotion, Hope you doing great! I contacted the clients and below is their reply with JSON data. { "contact_id": "dfg3453", "serial_no": "I/TEST/21-45", "name": "Bill's TEST Shop", "inv_date": "2021-01-23", "due_date": "2021-01-23", "currency": "KWD", "subtotal": "1065.0", "tax_total": "106.5", "shipment_data": [ { "serial_no": "I/TEST/21-45", "master_no": "123-26365653", "house_no": "QAS2131204", "cost_revenue_items": [ { "charge_ref": "K0067", "currency": "USD", "quantity": "1.0", "selling_rate": "1500.0", "exchange_rate": "0.71", "taxes": ["VAT"] } ] } ] } Their reply -> " The request type is up to your team to specify, as the request will be sent from our side to yours, please find attached the requested sample." My Question: How will they do a delete request for the above JSON data? Currently as you know i have done 3 different request for the same JSON data(Request(POST),Request(PUT),Request(DELETE)) all in a single PHP file, is this right?
  12. Thanks for the suggestion @NotionCommotion. I have contacted the client team that creates the request and asked them about the details, waiting for their reply. I believe after their reply it would we clear and i can proceed accordingly.
  13. Hi Friends, I am trying to do an API with oracle database. The JSON request from 3rd party will look like below. { "contact_id": "1", "serial_no": "100", "name": "baby", "inv_date": "2018-06-27", "due_date": "2018-06-27", "currency": "KD", "subtotal": "143", "tax_total": "13", "shipment_data": [ { "serial_no": "33", "master_no": "55", "house_no": "77", "cost_revenue_items": [ { "charge_ref": "rr", "currency": "INR", "quantity": "2", "selling_rate": "45", "exchange_rate": "7", "taxes": [ { "serial_no": "1", "ref": "INR", "voiding_remarks": "oo" },{ "serial_no": "2", "ref": "KWD", "voiding_remarks": "asd" } ] } ] } ] } how to handle request for JSON in which master is updated (PUT) and child record is (Either INSERTED, UPDATED or DELETED) ?
  14. Hello Barand, Thanks for replying . Sorry, I could not make you understand. I want to know , how the JSON request will Look like when we want to delete one record from "cost_revenue_items". Why I am confused, because "cost_revenue_items" is nested within "$invoice_data -> "Shipment_data". So If they only want to delete only a record from "cost_revenue_items" , in what format JSON request will come ? Will it be nested and sent within parent or will be sent standalone.
  • 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.