Jump to content

aarti789

Members
  • Posts

    17
  • Joined

  • Last visited

About aarti789

  • Birthday 01/01/2001

Contact Methods

  • Website URL
    https://www.absmartly.com/

Profile Information

  • Gender
    Female
  • Age
    22

Recent Profile Visitors

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

aarti789's Achievements

Member

Member (2/5)

0

Reputation

  1. Can you try the below code, I hope you can get what you are looking for. Thanks
  2. Well, there are some process which can help you to reduce PDF generating time that are litsted below: 1. Optimization of image 2. Applu lazy loading 3. Ensure you are using latest version of DOMPDF 4. Use image format like JPG and PNG. Thanks
  3. Well, there are some logical errors with your code, you can try this code to fix this error. <?php $full_name = filter_input(INPUT_POST, 'full_name'); $phone = filter_input(INPUT_POST, 'phone'); $email = filter_input(INPUT_POST, 'email'); $type_of_property = filter_input(INPUT_POST, 'type-of-property'); $property_address = filter_input(INPUT_POST, 'property_address'); $price_range = filter_input(INPUT_POST, 'price_range'); $ideal_number_of_bedrooms = filter_input(INPUT_POST, 'ideal-number-of-bedrooms'); $ideal_number_of_bathrooms = filter_input(INPUT_POST, 'ideal-number-of-bathrooms'); $are_you_preapproved_for_a_mortgage = filter_input(INPUT_POST, 'are-you-preapproved-for-a-mortgage'); if ($are_you_preapproved_for_a_mortgage == 'yes') { echo $Pre-approvalAmount; // Make sure $Pre-approvalAmount is defined elsewhere } $type_of_parking_you_need = filter_input(INPUT_POST, 'type-of-parking-you-need'); $expected_timeline_for_buying = filter_input(INPUT_POST, 'expected-timeline-for-buying'); $neighborhoods_or_zip_codes_you'd_like_to_explore = filter_input(INPUT_POST, 'neighborhoods-or-zip-codes-youd-like-to-explore'); $what_do_you_want_the_most_in_your_dream_home = filter_input(INPUT_POST, 'what-do-you-want-the-most-in-your-dream-home'); ?> Thanks
  4. Well, there are some logical error with your code, you can try below code to do this. <?php require 'vendor/autoload.php'; // Make sure to include the MongoDB PHP library autoload file $client = new MongoDB\Client('mongodb+srv://'.$_ENV['MDB_USER'].':'.$_ENV['MDB_PASS'].'@'.$_ENV['ATLAS_CLUSTER_SRV'].'/test'); try { $databases = $client->listDatabases(); foreach ($databases as $databaseInfo) { echo "Database: " . $databaseInfo['name'] . "\n"; } } catch (Exception $e) { echo "Unable to connect to the database at the moment!"; exit(); } $database = $client->selectDatabase('your_database_name'); // Replace with your actual database name $collectionNames = $database->listCollectionNames(); foreach ($collectionNames as $collectionName) { echo "Collection: " . $collectionName . "\n"; } ?> Thanks
  5. Well, there are some steps that you can take to fix these issues. 1. You can try for optmizing link rendering. 2. You can use developer tools of browser to improve the performance. 3. Disabling extensions of browser. 4. Lazy Loading Thanks
  6. @Strider64 thanks a lot for your suggestions, definetely I will talk about it to my mates. Well, it shows some logical error at the time of its execution. Thanks
  7. Well, I am creating a PHP program (code and project reference taking from here) for making chess game but it shows some error at the time of its execution. Here is the source code: <?php // Define chessboard array $chessboard = array( array("R", "N", "B", "Q", "K", "B", "N", "R"), array("P", "P", "P", "P", "P", "P", "P", "P"), array("", "", "", "", "", "", "", ""), array("", "", "", "", "", "", "", ""), array("", "", "", "", "", "", "", ""), array("", "", "", "", "", "", "", ""), array("p", "p", "p", "p", "p", "p", "p", "p"), array("r", "n", "b", "q", "k", "b", "n", "r"), ); // Display chessboard echo "<table>"; for ($row = 0; $row < 8; $row++) { echo "<tr>"; for ($col = 0; $col < 8; $col++) { $piece = $chessboard[$row][$col]; echo "<td>" . $piece . "</td>"; } echo "</tr>"; } echo "</table>"; // Sample move validation (simplified) function isValidMove($startRow, $startCol, $endRow, $endCol, $chessboard) { // Implement move validation logic here return true; // For demonstration purposes } // Sample game loop (simplified) $player = "white"; while (true) { // Display current player's turn echo "<p>{$player}'s turn</p>"; // Get move input from the user $startRow = /* user input */; $startCol = /* user input */; $endRow = /* user input */; $endCol = /* user input */; // Validate and apply the move if (isValidMove($startRow, $startCol, $endRow, $endCol, $chessboard)) { // Update the chessboard and switch players $chessboard[$endRow][$endCol] = $chessboard[$startRow][$startCol]; $chessboard[$startRow][$startCol] = ""; $player = ($player === "white") ? "black" : "white"; } else { // Invalid move, display error message echo "<p>Invalid move!</p>"; } } ?> <?php // Define chessboard array $chessboard = array( array("R", "N", "B", "Q", "K", "B", "N", "R"), array("P", "P", "P", "P", "P", "P", "P", "P"), array("", "", "", "", "", "", "", ""), array("", "", "", "", "", "", "", ""), array("", "", "", "", "", "", "", ""), array("", "", "", "", "", "", "", ""), array("p", "p", "p", "p", "p", "p", "p", "p"), array("r", "n", "b", "q", "k", "b", "n", "r"), ); // Display chessboard echo "<table>"; for ($row = 0; $row < 8; $row++) { echo "<tr>"; for ($col = 0; $col < 8; $col++) { $piece = $chessboard[$row][$col]; echo "<td>" . $piece . "</td>"; } echo "</tr>"; } echo "</table>"; // Sample move validation (simplified) function isValidMove($startRow, $startCol, $endRow, $endCol, $chessboard) { // Implement move validation logic here return true; // For demonstration purposes } // Sample game loop (simplified) $player = "white"; while (true) { // Display current player's turn echo "<p>{$player}'s turn</p>"; // Get move input from the user $startRow = /* user input */; $startCol = /* user input */; $endRow = /* user input */; $endCol = /* user input */; // Validate and apply the move if (isValidMove($startRow, $startCol, $endRow, $endCol, $chessboard)) { // Update the chessboard and switch players $chessboard[$endRow][$endCol] = $chessboard[$startRow][$startCol]; $chessboard[$startRow][$startCol] = ""; $player = ($player === "white") ? "black" : "white"; } else { // Invalid move, display error message echo "<p>Invalid move!</p>"; } } ?> Can anyone give their suggestions on this. Thanks
  8. Well, to access FTP using PHP in XAMPP you can utilize PHP built in FTP function. Code Example: <?php // Server credentials $ftpServer = 'your_ftp_server_address'; $ftpUsername = 'your_ftp_username'; $ftpPassword = 'your_ftp_password'; // Connect to the FTP server $connId = ftp_connect($ftpServer); if (!$connId) { die('Could not connect to the FTP server'); } // Log in to the FTP server $loginResult = ftp_login($connId, $ftpUsername, $ftpPassword); if (!$loginResult) { die('FTP login failed'); } // Get a list of files in the remote directory $files = ftp_nlist($connId, '/path/to/remote/directory'); // Output the list of files print_r($files); // Close the FTP connection ftp_close($connId); ?> <?php // Server credentials $ftpServer = 'your_ftp_server_address'; $ftpUsername = 'your_ftp_username'; $ftpPassword = 'your_ftp_password'; // Connect to the FTP server $connId = ftp_connect($ftpServer); if (!$connId) { die('Could not connect to the FTP server'); } // Log in to the FTP server $loginResult = ftp_login($connId, $ftpUsername, $ftpPassword); if (!$loginResult) { die('FTP login failed'); } // Get a list of files in the remote directory $files = ftp_nlist($connId, '/path/to/remote/directory'); // Output the list of files print_r($files); // Close the FTP connection ftp_close($connId); ?> Thanks
  9. Well, there are some error in function. Here is the correct code: <?php $duration = 45; $cleanup = 0; $start = "10:00"; $end = "15:15"; function timeslots($duration, $cleanup, $start, $end){ $start = new DateTime($start); $end = new DateTime($end); $interval = new DateInterval("PT".$duration."M"); $cleanupInterval = new DateInterval("PT".$cleanup."M"); $slots = array(); for($intStart = $start; $intStart<$end; $intStart->add($interval)->add($cleanupInterval)){ $endPeriod = clone $intStart; $endPeriod->add($interval); if($endPeriod>$end){ break; } $slots[] = $intStart->format("H:i")." h "; } return $slots; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $con = mysqli_connect('localhost', 'root', '', 'tpozdb'); if (mysqli_connect_errno()) { die("Failed to connect to MySQL: " . mysqli_connect_error()); } $tIme = $_POST['tIme']; $tPrezime = $_POST['tPrezime']; $tTelefon = $_POST['tTelefon']; $tDatum = $_POST['tDatum']; $tVreme = $_POST['tVreme']; // Use prepared statement to prevent SQL injection $sql = "INSERT INTO `tehnicki` (`Id`, `Ime`, `Prezime`, `Telefon`, `Datum`, `Vreme`) VALUES (?, ?, ?, ?, ?, ?)"; $stmt = mysqli_prepare($con, $sql); mysqli_stmt_bind_param($stmt, "isssss", $id, $tIme, $tPrezime, $tTelefon, $tDatum, $tVreme); // Set the initial value of $id to 0 $id = 0; // Execute the prepared statement if (mysqli_stmt_execute($stmt)) { // Success echo "Appointment successfully scheduled."; } else { // Error handling echo "Error: " . mysqli_error($con); } // Close the statement and connection mysqli_stmt_close($stmt); mysqli_close($con); } ?> <!DOCTYPE html> <html lang="en"> <head> <!-- Rest of your head section... --> </head> <body> <!-- Your HTML content... --> <div id="myModal" class="modal"> <!-- Your modal content... --> </div> <section class="content" id="termin"> <?php // Your PHP code for displaying calendar and time slots goes here... ?> <table> <!-- Your table content... --> </table> <span>Odaberite željeno vreme.</span> </section> <script src="app.js"></script> </body> </html> Thanks
  10. Well, I seached it on Google and ChatGPT both and conclude. Sorry for inconvince, I will take care about it for future reference. Thanks
  11. Well, the best methodology for coordinating your code with PDO relies upon the particular prerequisites and intricacy of your task. Both approaches are valid, and you can choose the one that fits your needs and coding style better. Thanks
  12. Well, there are some error in your code and you need to update below sections of your code: <td> elements in the timeslots loop: <td><a href="#" onclick="MyFunction('<?php echo $ts; ?>'); return false;"><?php echo $ts; ?></a></td> <td><a href="#" onclick="MyFunction('<?php echo $ts; ?>'); return false;"><?php echo $ts; ?></a></td> <td><a href="#" onclick="MyFunction('<?php echo $ts; ?>'); return false;"><?php echo $ts; ?></a></td> <td><a href="#" onclick="MyFunction('<?php echo $ts; ?>'); return false;"><?php echo $ts; ?></a></td> <td><a href="#" onclick="MyFunction('<?php echo $ts; ?>'); return false;"><?php echo $ts; ?></a></td> <td><a href="#" onclick="MyFunction('<?php echo $ts; ?>'); return false;"><?php echo $ts; ?></a></td> <td><a href="#" onclick="MyFunction('<?php echo $ts; ?>'); return false;"><?php echo $ts; ?></a></td> I hope it will help you. Thanks
  13. Well, I searched about it on internet, there is an error on mentiones function. You can replace your code by below code. <?php error_reporting(E_ALL); ini_set('display_errors', '1'); echo nl2br("<div id='goodContent'>" . $row['info'] . "</div><br><a href='updatecopypaste.php?id=" . $row['id'] . "'><img src='/ppreq/editbtn.jpg'></a>&nbsp &nbsp<a class='leftf' href='deletecopypaste.php?id=" . $row['id'] . "'><img src='/ppreq/deletebtn.jpg'></a>&nbsp &nbsp<button name='copy' id='clickCopy' name='copybtn' class='unstyled-button' style='cursor:pointer'><img src='/ppreq/copybtn.jpg' border='0'></button><br><br>___________<br><br>", 60); } else { echo "0 Listings"; } $conn->close(); ?> <script> copyToClipboard(document.getElementById("content")); document.getElementById("clickCopy").onclick = function() { copyToClipboard(document.getElementById("goodContent")); } document.getElementById("clickCopyString").onclick = function() { copyToClipboard("This is a variable string"); } /** * This will copy the innerHTML of an element to the clipboard * @param element reference OR string */ function copyToClipboard(e) { var tempItem = document.createElement('input'); tempItem.setAttribute('type', 'text'); tempItem.setAttribute('display', 'none'); let content = e; if (e instanceof HTMLElement) { content = e.innerHTML; } tempItem.setAttribute('value', content); document.body.appendChild(tempItem); tempItem.select(); document.execCommand('Copy'); tempItem.parentElement.removeChild(tempItem); } </script> I hope it will work for you. 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.