Skip to main content

Posts

Using PHP, how can I get the element holding the visit ID from the corresponding row in the HTML table?

I have an HTML table that fills its data from a table in the database, there's an approve button for the admin to approve the visit and change its status to APPROVED, I need to know how I can be able to select element holding the ID, so I can query on the visits and edit its 'STATUS' attribute HTML table Here's the code inserting the table: <table class="table table-bordered table-striped"> <thead> <tr> <th scope="col">Request Num</th> <th scope="col">Visitor Name</th> <th scope="col">Car Number</th> <th scope="col">Visit Date</th> <th scope="col">Status</th> <th scope="col">Approve</th> </tr> </thead> <tbody> <?php if ($_SESSION['sess_flag'] == 1) { $getV

Laravel http request with NTLM Auth

Is there any package/documentation/sample code available to call a http request using NTLM authentication in Laravel. I tried to the below was to first authenticate and then send the NTLM token from response header and call the request again. $response = Http::withHeaders([ "Host" => $my_host_name, "Connection" => "keep-alive", "Authorization" => "NTLM TlRMTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ])->get($MY_URL); $authKey = $response->header('WWW-Authenticate'); $response = Http::withHeaders([ "Host" => $my_host_name, "Connection" => "keep-alive", "Authorization" => $authKey, "Cache-Control" => "no-cache" ])->get($MY_URL); dd($response); Getting a 400 Bad Request error. source https://stackoverflow.com/questions/68975886/larav

JS FormData Image Upload to PHP Image can not be uploaded

i want to upload an image over Ajax and PHP. To get the Image i use FormData. The Ajax call is working fine from my point of view, but in my PHP code I always get the Error Fatal error Uncaught ValueError: Path cannot be empty in C:\xampp\htdocs\fitnesslaeufer-redesign\profile\includes\settings\profile-settings-update-image.php:43 Stack trace: #0 C:\xampp\htdocs\fitnesslaeufer-redesign\profile\includes\settings\profile-settings-update-image.php(43): getimagesize('') #1 C:\xampp\htdocs\fitnesslaeufer-redesign\profile\includes\settings\profile-settings-update-image.php(2): update_user_image() #2 {main} thrown in C:\xampp\htdocs\fitnesslaeufer-redesign\profile\includes\settings\profile-settings-update-image.php on line 43 " when I want to get informations ( $fileinfo ) about the image that is uploaded. I tried to find a solution in some Posts but nothing helped to solve my problem. For the Background I know how to upload an Image with PHP and now I want to up

Getting Shipping Address from WooCommerce Checkout Page?

i'm a little bit stuck. I've figured out how to retrieve the addresses assigned to a customers profile via the follow: print_r(WC()->customer); But I can't for the life of me figure out what the hook or whichever is required in order to get the shipping address that is being used for the calculation of shipping on the order checkout page. Is this something that is possible to get? Thank you for the help! source https://stackoverflow.com/questions/68959861/getting-shipping-address-from-woocommerce-checkout-page

How to uplaod Resume php contact form with pdf, doc, docx file

I want to upload a pdf, doc, docx, zip files with the below codes but it throws error. Am a new beginner into php. The codes works correctly with image extension only but I want to include pdf and doc file extension to the code. Your contribution is highly needed. Thanks. <?php /* validate.php */ //the form has been submitted with post if ($_SERVER["REQUEST_METHOD"] == "POST") { //two passwords are equal to each other if ($_POST['password'] == $_POST['confirmpassword']) { //define other variables with submitted values from $_POST $username = $mysqli->real_escape_string($_POST['username']); $name = $mysqli->real_escape_string($_POST['fullname']); $email = $mysqli->real_escape_string($_POST['email']); //md5 hash password for security $password = md5($_POST['password']); //path were our avatar image will be stored $

Why the function left the execution without any condition?

I've been trying to write a function using PHP to calculate the factorial of a given number. I thought the function will keep running without giving a condition, but the function outputted the right answer. Can someone please explain to me why? Here the code: function f($x) { $x *= $x - 1; return $x; } source https://stackoverflow.com/questions/68975736/why-the-function-left-the-execution-without-any-condition