Jump to content

Search the Community

Showing results for tags 'form'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

  1. Hello, I have a question about how to send form data to the database, without reloading the entire page. I discovered working with xmlhttprequest. I managed to show text from another file by implementing a javascript function with xhr into my script. I donā€™t know much about javascript and donā€™t understand how a javascript form should be added to an existing function. Finally this should run a php script executing the code to add the form data to the database. <!DOCTYPE html> <html> <body bgcolor="grey"> <center> <br><br><br> <div style="height: 200px; width: 600px; border: solid 2px blue;"> <div id="kn_ze"> <form id="my_form" action=""> Give your name: <input type="text" name="fname"> <br> <input type="submit" value="Send" onclick="loadXMLDoc();"> <!-- <button type="button" onclick="loadXMLDoc()">send it</button> --> </form> </div> </div> <script> function loadXMLDoc() { /* document.getElementById("my_form").submit();*/ var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("kn_ze").innerHTML = this.responseText; } }; xhttp.open("GET", "prophp.php", true); xhttp.send(); } </script> </body> </html> test script to process the form data prophp.php : <?php echo '<br>test code here : '; if (isset($_POST['fname'])) { var_dump($_POST['fname']); // execute mysql queries } ?> 11) How are the form data placed in the existing function? (or should I create a second one? ) Maybe someone can help me out solving it.
  2. skyhighweb

    hiding a value

    hi how do i hide the (team_id) value in the below form <option value="' . $row['team_id'] . '' . $row['teams'] . '" ' . $selected . '>' . $row['teams'] . '</option> thanks
  3. Hi everyone, I am a newbe and would like to ask for help with the following task: I am designing a website with a vertical accordion-menu on the left side that should stay fixed. So far no problem, an example I found on the w3school site. Now I would like the buttons that do not have sub-menu items to link to the index-, kontakt- pages directly. The recommended description to link a button is to include it into <form> tag and assign a Ā«formactionĀ» to it. When I do this the accordion looses the ability to spring open. Do I have to adapt anything in the Java-script or is there another way to solve this. Ideally I would like the accordion menu to behave like this: when clicking one menu item the corresponding page should be shown with the submenu items opened. when choosing anothe menu item that page should be opened and the previous sub-menu items closed. my coding attempt looks like that: ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€” <!DOCTYPE html> <html><!-- InstanceBegin template="/Templates/acc_template.dwt" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>My Accordion Menu Website</title> <style> button.accordion { background-color: #eee; color: #444; cursor: pointer; padding: 18px; width: 100%; border: none; text-align: left; outline: none; font-size: 15px; transition: 0.4s; } button.accordion.active, button.accordion:hover { background-color: #ddd; } div.panel { padding: 0 18px; display: none; background-color: white; } </style> </head> <body> <!--Anfang Seiten-Menu Accordeon DIV--> <nav> <div class="accnavleft"> <!--Anfang Buttons--> <form><button class="accordion" formaction="/index.html">Homepage</button></form> <form> <button class="accordion" formaction="//page_one.html">Page one</button></form> <div class="panel"> <ul> <li><a href="#navb">first paragraph page one</a></li> <li><a href="#navc">2nd paragraph page one/a></li> <li><a href="#navd">3rd paragraph page one</a></li> <li><a href="#nave">4th paragraph page one/a></li> </ul> </div> <form> <button class="accordion" formaction="/page_two.html">Page two</button></form> <div class="panel"> <ul> <li><a href="#navf">first paragraph page two</a></li> <li><a href="#navg">2nd paragraph page two/a></li> <li><a href="#navh">3rd paragraph page two</a></li> <li><a href="#navi">4th paragraph page two/a></li> </ul> </div> <form> <button class="accordion" formaction="/page_three.html">Page three</button></form> <div class="panel"> <ul> <li><a href="#navj">first paragraph page three</a></li> <li><a href="#navk">2nd paragraph page three/a></li> <li><a href="#navl">3rd paragraph page three</a></li> <li><a href="#navm">4th paragraph page three/a></li> </ul> </div> <form> <button class="accordion" formaction="/kontakt.html">Kontakt</button></form> <div class="panel"> <ul> </ul> </div> <form> <button class="accordion" formaction="/impressum.html">Impressum</button></form> <div class="panel"> <ul> </ul> </div> </div> </nav> <!--end Seiten Menu DIV accordeon --> <!--Java Script of Accordion --> <script> var acc = document.getElementsByClassName("accordion"); var i; for (i = 0; i < acc.length; i++) { acc.onclick = function(){ this.classList.toggle("active"); var panel = this.nextElementSibling; if (panel.style.display === "block") { panel.style.display = "none"; } else { panel.style.display = "block"; } } } </script> <!--end of Accordion --> <!-- "Content" --> <main> <div style="margin-left:25%;padding:1px 16px;height:100%;"> <h1>first paragraph page one</h1><br /> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, doloremque maiores excepturi iste porro cumque rem praesentium illo labore error quasi magni cupiditate rerum sequi dolores architecto consectetur harum soluta neque placeat culpa nesciunt molestias quam facilis ipsum ab aspernatur ut similique aperiam nemo tempore earum esse repellat provident eum blanditiis tempora molestiae! Optio, asperiores neque nam reiciendis ad rerum.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, doloremque maiores excepturi iste porro cumque rem praesentium illo labore error quasi magni cupiditate rerum sequi dolores architecto consectetur harum soluta neque placeat culpa nesciunt molestias quam facilis ipsum ab aspernatur ut similique aperiam nemo tempore earum esse repellat provident eum blanditiis tempora molestiae! Optio, asperiores neque nam reiciendis ad rerum. <a name="navb"></a> <h1>2nd paragraph page one</h1><br /> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, doloremque maiores excepturi iste porro cumque rem praesentium illo labore error quasi magni cupiditate rerum sequi dolores architecto consectetur harum soluta neque placeat culpa nesciunt molestias quam facilis ipsum ab aspernatur ut similique aperiam nemo tempore earum esse repellat provident eum blanditiis tempora molestiae! Optio, asperiores neque nam reiciendis ad rerum.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, doloremque maiores excepturi iste porro cumque rem praesentium illo labore error quasi magni cupiditate rerum sequi dolores architecto consectetur harum soluta neque placeat culpa nesciunt molestias quam facilis ipsum ab aspernatur ut similique aperiam nemo tempore earum esse repellat provident eum blanditiis tempora molestiae! Optio, asperiores neque nam reiciendis ad rerum. <a name="navc"></a> <h1>3rd paragraph page one</h1><br /> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, doloremque maiores excepturi iste porro cumque rem praesentium illo labore error quasi magni cupiditate rerum sequi dolores architecto consectetur harum soluta neque placeat culpa nesciunt molestias quam facilis ipsum ab aspernatur ut similique aperiam nemo tempore earum esse repellat provident eum blanditiis tempora molestiae! Optio, asperiores neque nam reiciendis ad rerum.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, doloremque maiores excepturi iste porro cumque rem praesentium illo labore error quasi magni cupiditate rerum sequi dolores architecto consectetur harum soluta neque placeat culpa nesciunt molestias quam facilis ipsum ab aspernatur ut similique aperiam nemo tempore earum esse repellat provident eum blanditiis tempora molestiae! Optio, asperiores neque nam reiciendis ad rerum. <a name="navd"></a> <h1>4th paragraph page one</h1><br /> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, doloremque maiores excepturi iste porro cumque rem praesentium illo labore error quasi magni cupiditate rerum sequi dolores architecto consectetur harum soluta neque placeat culpa nesciunt molestias quam facilis ipsum ab aspernatur ut similique aperiam nemo tempore earum esse repellat provident eum blanditiis tempora molestiae! Optio, asperiores neque nam reiciendis ad rerum.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, doloremque maiores excepturi iste porro cumque rem praesentium illo labore error quasi magni cupiditate rerum sequi dolores architecto consectetur harum soluta neque placeat culpa nesciunt molestias quam facilis ipsum ab aspernatur ut similique aperiam nemo tempore earum esse repellat provident eum blanditiis tempora molestiae! Optio, asperiores neque nam reiciendis ad rerum. <a name="nave"></a> <h1>5th paragraph page one</h1><br /> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, doloremque maiores excepturi iste porro cumque rem praesentium illo labore error quasi magni cupiditate rerum sequi dolores architecto consectetur harum soluta neque placeat culpa nesciunt molestias quam facilis ipsum ab aspernatur ut similique aperiam nemo tempore earum esse repellat provident eum blanditiis tempora molestiae! Optio, asperiores neque nam reiciendis ad rerum.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, doloremque maiores excepturi iste porro cumque rem praesentium illo labore error quasi magni cupiditate rerum sequi dolores architecto consectetur harum soluta neque placeat culpa nesciunt molestias quam facilis ipsum ab aspernatur ut similique aperiam nemo tempore earum esse repellat provident eum blanditiis tempora molestiae! Optio, asperiores neque nam reiciendis ad rerum. <a name="navf"></a> </div> </main> <!-- End Content --> </body> </html> Accord_Menu_Button_link.html
  4. Hi W3S I am trying to make a login PHP code with MySQLI and it won't work for some reason, not sure what i have done wrong, can someone see what i did wrong? This is the code: //////////////////////////////////////////////////////////////////////////////////////////////////////// // Login //////////////////////////////////////////////////////////////////////////////////////////////////////// $SUBMIT_FORM_ACTION___TakeLoginForm = (isset($_GET["SUBMIT_FORM_ACTION"]) ? $_GET["SUBMIT_FORM_ACTION"] : ""); if( $SUBMIT_FORM_ACTION___TakeLoginForm == "TakeLogin" ) { $query_1 = "SELECT u_id, u_username, u_password, u_email FROM users WHERE u_email=? AND u_password=?"; if ( $stmt = $mysqli->prepare($query_1) ) { $FORM_email = $_POST['email']; $FORM_password = $_POST['password']; $stmt->bind_param('ss', $FORM_email, $FORM_password); $stmt->execute(); $stmt->bind_result($id, $username, $password, $email); $stmt->fetch(); // SECURITY! CHECK & COMPARE! if($FORM_password !== $password) { die(" <center><b>(Form) Login ErrMSG #1</b></center> <br /> <center>Password incorrect/wrong! Try again!</center> "); } // Make Sessions Needed! $_SESSION['user'] = array(); $_SESSION['user']['id'] = $id; $_SESSION['user']['username'] = $username; $_SESSION['user']['password'] = $password; $_SESSION['user']['email'] = $email; $stmt->close(); //header("location: index.php"); } } okay so lets see if i get this straight. In the bind_result part, this does not matter what kind of variable it is right? In the naming part... or does the names actual HAS to be like the ones in the Database Columns? I somehow think its the part there but correct me if i am wrong... Hoping someone can help me a little bit. Thanks in advance
  5. anr241193

    HTML5

    What is the difference between: <form> tag and <div> tag ?
  6. I see that in the W3.Css demo and templates there is use of forms. When I tried to edit this for use with HTML/PHP The button for the HTML form only works when the Modal Submit is used. <div id="id01" class=" w3-modal" > ... <form action="subscribe.php" method="POST"> <input name="subname" class="w3-input" placeholder="Full Name" type="text" required> <input name="subemail" class="w3-input" placeholder="Email Address" type="text" required> <label class="w3-label w3-validate">Subscribe to e-Mail Newsletter</label> <input class="w3-btn" type="submit" value="Submit"> <p><a class="w3-btn w3-center" href="">Submit</a></p> </form> ... I've also tried the following and the variables are not passed to the php script. ... <form> <input name="subname" class="w3-input" placeholder="Full Name" type="text" required> <input name="subemail" class="w3-input" placeholder="Email Address" type="text" required> <label class="w3-label w3-validate">Subscribe to e-Mail Newsletter</label> <p><a class="w3-btn w3-center" href="subscribe.php">Submit</a></p> </form> ... Any help is appreciated. Thanks Mike
  7. I followed the lessons about php and php forms. Everything is clear and very useful, but I would like to ask how could I send eg this form if valid with SMTP? So, I would like to first validate the form and then send it with SMTP. Thank you!
  8. Hello everyone! This is my very first PHP document, and i must admit, i have no experience or knowledge about PHP, i looked at an example and tryd to connect the dots to create this one. It works better than expected, but I do encounter a few issues, where I would very much like to have some advise with. Problem 1: The data from the form gets mailed to me, but even though everything in the form is filled in, I would only receive the "E-mail: INPUT@HOTMAIL.COM" The rest of the data like: "Meetnaam: " Were blank, as if the data did not exist. The form did check correctly wether this information was provided, but seems not to provide so in the e-mail send to me. Problem 2: $meetnaam should be the subject of the e-mail. Problem 3: $email should also be the e-mail adress asigned to the sender, as such, I can easily reply. Problem 4: The checkbox, $akkoord, should be checked, if not, an error should be displayed, I do not know how to do this. Your help with this problem is very much apreciated! Once again: I am new to this, so try to be very specific (if you would even be so kind, type it out and put the update in bold text) =D This is the PHP and HTML code I used respectively: PHP HTML
  9. <?php include "connetti.php"; session_start(); $query = "SELECT id_studente, nome, cognome, anno_maturita, voto_maturita FROM utenti_studenti WHERE utenti_studenti.confermato = 0"; $risultato = @mysql_query($query); if (mysql_num_rows($risultato) == 0) { echo("Nessun elemento trovato"); header("refresh:3;url=AreaAmministratore.phtml"); exit(); } ?> <html> <head> <title>Annuario Studenti</title> <link rel="stylesheet" href="cssUtils/aggiungi_properties.css"/> <script type="text/javascript" src="jsUtils/jsUtils_annuario/annuario_properties.js"></script> </head> <body> <form method='post' action='confermaStudenti.php' name='aggiornaStatoStudente'> <div align='center'> <table class='tg'> <tr> <th class='tg' style='color: #000;'>ID</th> <th class='tg' style='color: black'>Nome</th> <th class='tg' style='color: black'>Cognome</th> <th class='tg' style='color: black'>Anno Maturita</th> <th class='tg' style='color: black'>Voto Maturita</th> <th class='tg' style='color: black'>Accetta</th> </tr><?php while ($row = @mysql_fetch_assoc($risultato)) { echo " <tr align='center'> <td class='tg' style='color: black'>" . $row['id_studente'] . "</td> <td class='tg' style='color: black'>" . $row['nome'] . "</td> <td class='tg' style='color: black'>" . $row['cognome'] . "</td> <td class='tg' style='color: black'>" . $row['anno_maturita'] . "</td> <td class='tg' style='color: black'>" . $row['voto_maturita'] . "</td> <td class='tg' style='color: black'>" . "<input type=\"hidden\" name=\"rifiuta\"/><input type=\"checkbox\" name=\"accetta\"/>" . "</td> </tr>"; } ?> </table> </div> <div align='center'> <a href='AreaAmministratore.phtml'>Torna indietro.</a> <input type='submit' value='Prosegui'/> </div> </form> </html> <?php session_start(); include("connetti.php"); if (isset($_POST["accetta"])) { $accetta = 1; } else { $accetta = 0; } if ($accetta) { $cognome = $_POST['cognome']; $nome = $_POST['nome']; $id_studente = $_POST['id_studente']; $query = "UPDATE utenti_studenti SET confermato='1' WHERE nome='$nome' AND cognome='$cognome' AND id_studente='$id_studente'"; $risultato = @mysql_query($query) or die('<p align="center">Errore!</p>' . mysql_error()); echo("<script>alert('La modifica eseguita')</script>"); header("refresh:0;url='AreaAmministratore.phtml'"); } else { echo "<script>alert('Errore');</script>"; header("refresh:0;url='AreaAmministratore.phtml'"); exit(); } ?> Greetings guys, could you help me with those codes above? Cuz I can't understand why it doesn't work... So I have an table with the users that not confirmed. So to confirm them I've made checkbox, so on the other side I have a control if the checkbox is checked so I need to update some values on my database right ? Well it doesn't work....
  10. How i submit form to other website and Get Result on my website Here Is An example site I want Make like this website http://singhfm.com/psebresult/ and here tagret website where i want pick data http://results2.indiaresults.com/pb/pseb/result-of-12-class-march-2016/query.htm How I Done Any one can help about this
  11. I am making a contact form in a new template liquid for a shopify website. Everything works and looks great in desktop mode but I've noticed as you drag the screen to a skinnier size some inline-block elements jump down perfectly as they are supposed to, the problem is other smaller text boxes are jumping up over other text fields to try and fill that gap. Also I've had issues with the legend and labels abandoning the text box they belong to jump up the form and fill space. Obviously I do not want this, how can I fix it?
  12. Let's pretend, there's a <div> on a page. There's a usual HTML form inside it that sends information to another php-file. By default, the visibility of the div is hidden, and the click on the button makes it visible. The question is how to close the form (i.e. hide the div) using a button or <a> element on the div, WITHOUT the sending data to php-file. In other words, how to close this <div> as if it is usual popup-window, without changes?
  13. I am attempting to create a drop down menu and I liked the style of the top home menu seen here http://www.lego.com/en-us/products (right near the lego symbol) but I am not sure how to create a similar one would some one gI've me guidance on how I can do this I just started html coding so I am a noon with little knowledge of html right now.
  14. What is the best way of capturing data sent via a contact-us form (I am using form and PHP)--in DB only, in a dedicated email only, or in both? Pros and cons of each method please, if possible.
  15. sspolice

    Template Form

    Hello guys am practically a day old here so i am not a pro with dreamweaver but i know sort of my way around but i am so puzzled and hope i can get help fast, so i downloaded a template and there is a form but i dont know what the ###### is goin on haha. DW has it own form but this one goes with the template so yes. below is the code , if any one could help me i would be greatful ! and yes am learning <form id="form" method="post" > <fieldset> <label><strong>Name:</strong><input type="text" value=""></label> <label><strong>Email:</strong><input type="text" value=""></label> <label><strong>Phone:</strong><input type="text" value=""></label> <label><strong>Message:</strong><textarea></textarea></label> <div class="btns"><a href="#" class="link">Clear</a><a href="#" class="link" onClick="document.getElementById('form').submit()">Send</a></div> </fieldset> </form> that's all that there is but it need to send to a mail and i dont know if it needs a thank you page or redirect to home afterwards once the website is up i shall post the link... Regards Rory
  16. I'm looking for a way to block input in a text field occuring more than 5 times. For example aaaaaa is wrong but: A sentence having an input of a happening several times or even more is okay. above sentence has 7 inputs and shouldnt be blocked. What is the solution?
  17. when working with $_SESSION and creating a super global then in the script where I use include and call the variable the entire form is showing up. I have to work with $_SESSION, because $_POST or $_GET wont work in this situation. Is there a way to transfer a form value to another script, and then a single value and not the complete form with everything in it.
  18. wesley

    align form with css

    Hello, I have make a form. But the form is not align. I want to have spece between the label and the input, like in the image. The dual column example you see space between the label and the input. My question is: how can I make this? My css is: label{ display:block; color: white; margin:12px; padding: 12px; }input{ height:40px; width: 190px; font-size:20px;} thanks in advance.
  19. Hello Forum! I have a little problem. What I have is a registration page. I want to validate the input of the user in real time. I use JQuery. $("#inputUsername").change(checkUsername); $("#inputEmail").change(checkEmail); $("#inputPassword").change(checkPassword); $("#inputPasswordConfirm").change(checkPasswordConfirm); I check if something was changed. For example like this: function checkUsername() { $(this).popover({placement:"right", container:'body'}); var username = $(this).val(); if(username == '') { $(this).data('bs.popover').options.content = 'Please enter a username'; $(this).popover("show"); } else if(username.length < 5 || username.length > 20) { $(this).data('bs.popover').options.content = 'Please enter a username with 5-20 characters'; $(this).popover("show"); } else { $(this).popover("destroy"); } } Now when the user submits the form, I thought I could use something like this: $("#registerForm").submit(function( event ) { if(!checkUsername || !checkEmail || !checkPassword || !checkPasswordConfirm) { event.preventDefault(); } }); Obviously the functions don't have return types. But even with it doesn't work. With it doesn't work I mean that submit event isn't ignored even if there are errors in the form. I might be doing something wrong with JavaScript as I'm not used to it! Before someone suggests a plugin, I don't have enough control with them. Thanks!
  20. please i need help on how to create a comment box so that people can comment on my sit when they visit thanks
  21. Hello, I was unable to find a solution for this problem. I'm hoping someone knows the answer. I have a mobile website and a phone number you can click to call. I even made it a hyperlink tel:###-###-####. This works correctly. I have a hidden form with a comment field only that basically says "Someone from your website placed a call to you." What I want to do is when the user clicks to call the number on the website call my number and send a quick Email letting me know by submitting the form I just mentioned along with the time and date. I have a php file working that sends the email to me when I hit the submit button. I have the hyperlink opening the box to allow the call to be placed. What I can't seem to figure out is how to get both things done on that one click of the phone number. ANY HELP would be appreciated. I understand that php is server side and the click to call is client side. But I'm still lost.
  22. I'm a beginnerI have an error in the contact form where the data fields are not being sent to the targeted email.Please helpWhat did I do wrong? <!-- contact --> <div class="contact" id="reservations"> <div class="col-md-4 contact-left"> <div class="contact-left1"> <img src="images/logo5.png" class="img-responsive" alt=""> <h3>RESERVAS</h3> </div> </div> <div class="col-md-8 contact-right" id="contact"> <div class="contact-details"> <h3>CONTATO</h3> <div class="text-field-name-1"> <form action="http://www.pousadaestacaodaserra.com/cgi-sys/formmail.pl" method="post"> <input type="hidden" name="recipient" value="contato@pousadaestacaodaserra.com"> <input type="hidden" name="subject" value="FormMail E-Mail"> .<br /><br /> <input type="text" class="text" value=" Nome completo*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ' Name*';}"> <input type="text" class="text" value="PaĆ­s / Estado*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Surname*';}"> <input type="text" class="text" value=" Facebook*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Country';}"> <input type="text" class="text" value="Email*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Email*';}"> <input type="text" class="text" value=" Telefone / Celular*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ' Phone*';}"> </form> </div> </div> <div class="reservation-details"> <h3>DETALHES DA RESERVA</h3> <div class="text-field-name-1"> <form action="http://www.pousadaestacaodaserra.com/cgi-sys/formmail.pl" method="post"> <input type="hidden" name="recipient" value="contato@pousadaestacaodaserra.com"> <input type="hidden" name="subject" value="FormMail E-Mail"> .<br /><br /> <input type="text" class="text" value=" Check-in*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ' Arrival Date*';}"> <input type="text" class="text" value=" Check-out*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Departure Date*';}"> <input type="text" class="text" value=" Tipo de Quarto*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ' Rooms*';}"> </form> </div> <div class="text-field-name-2"> <form action="http://www.pousadaestacaodaserra.com/cgi-sys/formmail.pl" method="post"> <input type="hidden" name="recipient" value="contato@pousadaestacaodaserra.com"> <input type="hidden" name="subject" value="FormMail E-Mail"> <input type="text" class="text" value="Quartos*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Departure Date*';}"> <input type="text" class="text" value=" Qde Pessosas*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ' Rooms*';}"> </form> <label class="checkbox"><input type="checkbox" name="checkbox" checked=""><i> </i>Privacy</label> </div> </div> <div class="clearfix"> </div> <div class="button"> <form action="http://www.pousadaestacaodaserra.com/cgi-sys/formmail.pl" method="post"> <input type="hidden" name="recipient" value="contato@pousadaestacaodaserra.com"> <input type="hidden" name="subject" value="FormMail E-Mail"> <input type="submit" name="submit" value="Enviar Mensagem"> <input type="hidden" name="redirect" value="http://pousadaestacaodaserra.com/paginaok.html"> </form> </div> </div> <div class="clearfix"> </div> </div><!-- contact -->
  23. Hello, i am having issues adding info to a database i have a html from where a user should fill in charname and select ###### then press submit. if i do this i get the error ERROR:could not able to execute INSERT INTO character(charname, ######, xp, gold, accdate) VALUES(jay, male, 0, 100000, now()).You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character(charname, ######, xp, gold, accdate) VALUES(jay, male, 0, 100000, now())' at line 1 <?php include_once 'db_connect.php'; include_once 'psl-config.php'; $error_msg = ""; $now = time(); // check connection if($mysqli === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } // Escape user inputs for security $charname = mysqli_real_escape_string($mysqli, $_POST['charname']); $###### = mysqli_real_escape_string($mysqli, $_POST['######']); //attempt inser quesry execution $sql = "INSERT INTO character (charname, ######, gold, xp, accdate) VALUES ($charname, $######, 100000, 0, now())"; if(mysqli_query($mysqli, $sql)){ echo "Records added successfully."; } else{ echo " ERROR:could not able to execute $sql." .mysqli_error($mysqli); } // close connection mysqli_close($mysqli); ?> Table CREATE TABLE IF NOT EXISTS `character` ( `id` int(11) NOT NULL AUTO_INCREMENT, `charname` varchar(30) NOT NULL, `######` tinyint(4) NOT NULL, `gold` int(11) NOT NULL, `xp` int(11) NOT NULL, `accdate` timestamp NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; I was wondering if some one could explain me what i do wrong, and or have some tips how to make this better. the idea is to add a check to see in the "charname" is already used. and some other stuff. but first i like to see the info end up in my DB Thanks
  24. Hello, I have recently been working on a HTML form to submit new results into a search engine. However I have ran into a problem that I cant seem to get past. I have one page where the info from the form can be properly submitted, however it requires a password to get into. (its the admin panel) located at index.php?a=admin However when a user tries to insert a new site to the form the just are denied access because they cant log into the admin panel, even though the form itself is not actually in the admin panel... The HTML form looks like this and is located in a page called /AddSite.html however its trying to submit the info to /index.php?a=admin how can I use JavaScript to possibly bypass needing the password? and not redirecting to the admin panel when you click submit? (Also, not as important as the above issue... but as you can see I tried to add a capatcha, but I cant get it to be required, users can press submit without even using the capatcha... if anyone could tell me what I did wrong that would be helpful ) my current code: <form action="/index.php?a=admin" method="post"><div class=""> Site Title: <input type="text" name="addtitle" value="" required/><br /> Site URL: <input type="url" name="addurl" value="http://" required/><br /> Site Description: <br /><textarea lass="ads" name="adddesc" required></textarea><div align="center" class="g-recaptcha" data-sitekey="6LfDoAYTAAAAAOUmPcjfwv3I84xYqFBV5tyQMPJu"></div></div><br /><input type="submit" value="Add new result"/></form> Any help works!!!
  25. I was wondering if someone could help me. We were learning some basic javascript in class and I can't seem to get my form to validate. Basically all I wanted it to do is return an error when nothing is entered in the field. I've done it the way we were taught in class via examples. Any help would be much appreciated!! index.html
×
×
  • Create New...