Jump to content

Dilip

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by Dilip

  1. Hi, I have been creating graphics for around 10 years now. I started learning by creating logos and banners for my projects. Now I can do videos, animated GIF banners and more. Have decent command over 2D and some 3D. My entry was voted into top 10 for Ubuntu wallpaper content last month. Feel free to PM me if you need any graphics help.
  2. This is what I am trying to achieve. Get my original P code listed with the input description. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>P Code Generator</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> </head> <body> <h1>P Code Generator</h1> <input type="text" id="myInputText" placeholder="Enter Description"> <button onclick="replaceDescription()">Generate Code</button> <script src="myscript.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> </body> </html> function replaceDescription() { // Get the user input for the Description const myInput = document.getElementById("myInputText").value; // The original text with $description placeholder const originalText = '<p style="background: black; padding: 15px; color:white;"> $description </p>'; // Replace description with the input const replacedText = originalText.replace(/\$description/g, myInput); // Access the element where you want to display the plain text const displayElement = document.getElementById("textDisplay"); // Set the element's textContent to the replaced text (display as plain text) displayElement.textContent = replacedText; }
  3. Hi, regret to confuse, I will show my raw code in a couple of minutes.
  4. Hi, thanks. I was hoping an HTML text input and the output as plain text. So that I can copy the <p> code from browser and paste it. ie, the output is plain text, not styled <p> tag. Something like <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>P Code Generator</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> </head> <body> <h1>P Code Generator</h1> <input type="text" id="myInput" placeholder="Enter Description"> <button onclick="replaceDescription()">Generate Code</button> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> </body> </html>
  5. Hi,I have this code. I need help using a text input to replace the $description in this code <p style="background: black; padding: 15px; color:white;"> $description </p> Because I need to add description many times and can save time if I have a text input that takes in description and displays the above code with text input as plain text. I can then copy paste, use it. Any help will be great.
  6. Fixed by using col-sm-12
  7. Hi, I am using Grid in Bootstrap 5.3. It scales instead of stacking one below another. <section class="mt25me"> <div class="text-center"> <h2 class="mt-2">Why me?</h2> <br> <h1 class="fs-5 poppins-extralight">The Copywriter</h1> <br> </div> <br><br><br> <div class="container text-center"> <div class="row"> <div class="col"> <div class="mb-4" style="color: #0070ff;"> <i class="fa-solid fa-thumbs-up fa-5x"></i> </div> <h3>Impressive</h3> <br> <p>Words that work magic, helps gain attention</p> </div> <div class="col"> <div class="mb-4 green"> <i class="fa-solid fa-circle-check fa-5x"></i> </div> <h3>Effective</h3> <br> <p>Post that standout in crowd. Simple by design, effective on field</p> </div> <div class="col"> <div class="mb-4" style="color: #ffa700;"> <i class="fa-solid fa-trophy fa-5x"></i> </div> <h3>Result Oriented</h3> <br> <p>They will love you for sure, and buy from you as well</p> </div> </div> </div> </section> CSS .msect5 { margin-top: 50px; padding-top: 15px; margin-bottom: 75px; } Please help.
  8. Hi, is there any method to export text effects as GIF or webp ( with transparency ). Say I have a web page and I have a Fade In animation for text. I have only that made either using CSS or a library like animate.css. Is it possible to export as image? I can of course take a screen grab, but it will have the white background added. PS: was not sure which board to use
  9. I guess ../ is the only way then .
  10. Yes, please see Edit 1 : It works fine when I use include " ../inc/header.php";
  11. Hi, I just tried using /inc/header.php in index.php as well as a subfolder PHP file. But it is not being called it all Attaching the screenshot. Some of the content is not English Edit 1: the index.php works when I use `include "inc/header.php";` but not sure what to do for subfolders and deeper
  12. Hi, say I have inc folder inside root folder which has header.php. I add it to index.php as include 'inc/header.php'; But say I have a folder name category inside the root folder and I have a file named category1.php, how to add the header.php into it? If I use the above, it will look for a folder called inc in the same level as the category folder, right? How do I place header.php, nav.php and footer.php inside the inc folder and add them to sub folder or even deeper folders? Thanks.
  13. this works, thanks echo "<div class='alert alert-success' role='alert'style='width:250px; margin-left: 30px;'>this is my_message</div>";
  14. It kind of works, but the alert box is too wide. Please see <?php echo "<div style='color: green;'>my_message</div>"; echo "my error"; echo 'my error 2'; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap demo</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> </head> <body> <h1>Hello, world!</h1> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script> <?php echo "<div class='alert alert-success' role='alert'>this is my_message</div>"; ?> </body> </html>
  15. thanks, it works @Barand I am trying to use this styling from Boostrap echo "<div class='alert alert-success' role="alert">my_message</div>"; How do I make it work? Normally I add Bootstrap CDN inside <head>. Looks like it is not possible in this case.
  16. I just tried this code as index.php in a test folder, no output at all. Renders a blank page <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap demo</title> </head> <body> <?php <div style="color: green;">echo 'my_message';</div> echo "my error"; echo 'my error 2'; ?> <h1>Hello, world!</h1> </body> </html> <?php echo 'not working'; ?> But when I delete everything and just use this, it works <?php echo 'not working'; ?>
  17. Hi, I do not have much. I simply use the Bootstrap CDN in <head>. No extra styling added. Can I add <div style="color: green;">echo 'my_message';</div> Never thought it would be that simple.
  18. I simply used it like this, which didn't work even though there was Bootstrap CDN inside <head> <div class="alert alert-success" role="alert"> echo 'Entry Successful'; </div>
  19. Hi, I have this connect.php which has an echo when the db entry is a failure or success. I am trying to use Bootstrap alert to style it. Using a div around echo make the code non functional. When I click submit, it goes to connect.php and nothing happens when there is a styling div. Would be nice to know any way around connect.php <?php if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['submit'])) { echo 'submit button clicked'; $conn= mysqli_connect('localhost', 'root', '', 'my_db') or die("Connection Failed:" .mysqli_connect_error()); echo 'no connection error'; if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['phone'])) { $name= $_POST['name']; $email= $_POST['email']; $phone= $_POST['phone']; echo 'Upto SQL'; $sql= "INSERT INTO `users` (`name`, `email`, `phone`) VALUES ('$name', '$email', '$phone');"; echo 'SQL Run'; $query = mysqli_query($conn,$sql); echo 'query run'; if($query) { echo 'Entry Successful'; } else { echo 'Error, Entry Failed'; } } } ?> I am trying to style the echo at the last which are Entry Successful and Errory, Entry Failed Thanks.
  20. Hi, thanks. I am learning this slowly. Hope to improve.
  21. It worked this time. I don't know what was wrong. I added a row using phpMyAdmin, copy pasted the query from phpMyAdmin and replaced it with the $name and so on. It was exactly the same, but it worked this time.
  22. Hi, I am using XAMPP and trying to put up a simple form. The index.php is <form action='connect.php' method="POST"> <label for="user">Name: </label> <input type='text' name='name' id="name" required/> <br><br> <label for="email">Email: </label> <input type='email' name='email' id="email" required/> <br><br> <label for="phone">Phone: </label> <input type='text' name='phone' id="phone" required/> <br><br> <input type='submit' name='submit' id='submit' /> </form> The connect.php is <?php if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['submit'])) { echo 'submit button clicked'; $conn= mysqli_connect('localhost', 'root', '', 'my_software') or die("Connection Failed:" .mysqli_connect_error()); echo 'no connection error'; if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['phone'])) { $name= $_POST['name']; $email= $_POST['email']; $phone= $_POST['phone']; echo 'Upto SQL'; $sql= "INSERT INTO 'user' ('name', 'email', 'phone') VALUES ('$name', '$email', '$phone')"; echo 'SQL Run'; $query = mysqli_query($conn,$sql); echo 'query run'; if($query) { echo 'Entry Successful'; } else { echo 'Error, Entry Failed'; } } } ?> There was no addition to the database. So I used echo to find what or where it is going wrong. It prints up to " SQL Run ". But still, no input to the database I created using phpMyAdmin or any error message indicating where I am doing it all wrong. Any help would be great.
  23. Hi, I have a working contact form with CAPTCHA now. Please see the code below contact.php is <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Contact Us</title> <!--Load reCAPTCHA API --> <script src="https://www.google.com/recaptcha/api.js" async defer></script> </head> <body> <form method="post"> <!-- Form --> <input type="text" name="name" value="Name"/> <input type="email" name="email" value="name@example.com"/> <input type="text" name="message" value="Your Message"/> <!-- CAPTCHA --> <div class="g-recaptcha" data-sitekey="SITEKEY"></div> <input type="submit" name="submit" value="Go!"/> </form> <?php //Process form on submit if (isset($_POST['submit'])) { require "process.php"; } ?> </body> </html> process.php is <?php // Verify CAPTCHA $error = ""; $secret = "SECRET KEY"; $url = "https://www.google.com/recaptcha/api/siteverify?secret=$secret&response=".$_POST['g-recaptcha-response']; $verify = json_decode(file_get_contents($url)); // Send email if all is good if($verify->success) { $to = "name@email.com"; $subject = "Contact Form Submission"; $body = ""; foreach ($_POST as $k=>$v) { if ($k != "g-recaptcha-response") { $body .= "$k : $v\r\n"; } } if (!mail($to, $subject, $body)) { $error = " Failed to send email"; } } else { $error = "Invalid CAPTCHA"; } // Output result echo $error=="" ? "OK" : $error; ?> Sadly, there is no error displayed when someone skips CAPTCHA. The kind of people I am expecting might most likely won't know that they should click the " I am not a robot " box. It would be nice if someone could help me add the same. 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.