Jump to content
Lizard Wizard Coding Club

markvs

Member
  • Content Count

    27
  • Joined

  • Last visited

Community Reputation

0 Neutral

About markvs

  • Rank
    Member
  1. I'm not sure? I'm just trying to limit the number of calls to the database and I'm not sure how to do this within PHP. I just thought I could send it all to MySQL and then filter out the empty fields somehow.
  2. Hello, I have a one row table that's being populated using a HTML form with several fields. I'm needing the database fields to be UPDATED only if the form fields have been filled in. I can do this in PHP, but would prefer to do this using MySQL. Below is an example of the PHP code. Keep in mind that I'm a green at both PHP/MySQL, so any suggestions are appreciated. if($user_name == 'user' && $password == 'password') { if(!empty($_POST['location'])) { mysqli_query($con, "UPDATE gig_date SET location='$location' WHERE gig_id=1"); } if(!empty($_POST['band_name'])) { mysqli_quer
  3. I can create a php web form, but how can I use it to change the value of a variable on the server?
  4. Before you send the form to the server to be processed by the php interpreter, it would be nice if all of the required fields had some data; preferably in the correct format. eg. An email address could be checked to make sure it had some minimal formatting, such as making sure it contained the "@" and "." symbols and this could be done by JavaScript on the clients computer. If a required field was left blank, that could be checked, etc. - all before you send a request to the server. Considering that a very large percentage of users have JavaScript turned on (over 97%, I think), it would be a g
  5. For those with JavaScript available - I would think that you could do some simple verification using JavaScript before submitting the form. And then do a more thorough validation using php and Regular Expressions. I'm also far from an expert, but I've read that somewhere and it would make for a better user experience for most.
  6. return false; good to know and it's important for this application. Thanks for the heads up.
  7. Okay, that help a lot. Here is my re-worked code. I'll have to modify things a bit for my application, but the getElementById() is what I needed. The HTML, CSS, and Javascript are all in this file, so you can run it in your browser with ease. Thanks again! <!DOCTYPE html> <html> <head> <style type="text/css"> body {font-size:large; font-family:sans-serif;} a {color:red; font-weight:bold; text-decoration:none; } #content { width: 500px; margin: 100px auto; padding: 20px; background-color: #FFF; border: solid 2px #000; } #content_to700js { width: 700px; mar
  8. Yes Ben that's what I'm looking for, let me try and wrap my brain around it and I'll reply after lunch. Thanks!
  9. Thanks for the replies. I'm just trying to learn Javascript for now, but later on I would like to learn how to use jQuery. w3s... is helpful at times, but I enjoy the back and forth here on Killersites with explanations to include best practices, etc.. In my code example, forget the iframe or why, I just want to learn how to grab an id using some Javascript, and change it to something else so that it will be styled according to the CSS file. Thanks, Mark
  10. I'll include some code that will hopefully be self explanatory. The CSS is included in the markup, but I need to learn Javascript. Thanks in advance, Mark <!DOCTYPE html> <html> <head> <style type="text/css"> body {font-size:large; font-family:sans-serif;} a {color:red; font-weight:bold; text-decoration:none; } #content { width: 500px; margin: 100px auto; padding: 20px; background-color: #FFF; border: solid 2px #000; } #content_to700js { width: 700px; margin: 100px auto; padding: 20px; background-color: #000099; color: #FFF; border: solid 2px #000; } </style
  11. Yes Ben, that did the trick. I had left off the parenthesis. Thanks!
  12. Why does this code display the code for the getValue function and not the return value? // Card constructor, using private variables. var Card = function(s,n) { 'use strict'; var suit = s; var number = n; this.getSuit = function(){ return suit; }; this.getNumber = function(){ return number; }; this.getValue = function () { if (number>= 10 && number <=13){ return 10; } else if ( number>=2 && number<=9) { return number; } else if (number === 1) { return 11; } else {return "what the heck";} }; }; var card1 = new Card(2, 11); var ca
  13. I found this in a php book last night. "On some - primarily Unix-systems, the \r\n characters aren't handled properly. If you have problems with them, use just \n instead." Larry Ullman I've also read that it's important to have an empty line separating the message(body) from the headers, using \r\n\r\n or just \n\n.
  14. Wickham, You might find this post helpful, it talks about Outlook and using (PHP_EOL) instead of \r\n.... ... http://forums.devarticles.com/php-development-48/formatting-a-newline-line-break-in-php-html-output-5274.html
  15. Hi Amy, I agree, but by using the if statement, you would at least know if the email was being handed off to the mail server for delivery, whether delivered or not.
×
×
  • Create New...