Jump to content

eddytheflow

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by eddytheflow

  1. thanks a lot guiltygear! nice to know that my pictures influence the design a bit. and totally agree with the content separation comment, now that you mention it. i think out of laziness i must have just kept similar backgrounds, and then just forgot about it. i'll look into finding some better contrasting backgrounds, for content separation thanks again gg
  2. So i haven't quite figured out why I was getting blank emails; either my code was wrong or I was getting terrorized. I suspect Pikachu was right, I need server side validation, which I think I've solved by adding the above lines to the php script. I've also now added a few lines that report the senders ip address, the browser used, and the referrer (last link clicked). Hopefully this gives me some insight if the validation wasn't the problem. My code now looks like this: <?php $EmailFrom = "ED-YU.com"; $EmailTo = "eddytheflow@gmail.com"; $Subject = "A ".($_POST['Topic'])." from ".$_POST['Name']." "; $Name = Trim(stripslashes($_POST['Name'])); $Email = Trim(stripslashes($_POST['Email'])); $Message = Trim(stripslashes($_POST['Message'])); $Topic = Trim(stripslashes($_POST['Topic'])); $ip = $_SERVER['REMOTE_ADDR']; $hostaddress = gethostbyaddr($ip); $browser = $_SERVER['HTTP_USER_AGENT']; $referred = $_SERVER['HTTP_REFERER']; // validation $validationOK=true; if (Trim($Name)=="") $validationOK=false; if (Trim($Topic)=="") $validationOK=false; if (Trim($Email)=="") $validationOK=false; if (Trim($Message)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Topic: "; $Body .= $Topic; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Message: "; $Body .= $Message; $Body .= "\n"; $Body .= "\n"; $Body .= "ip: "; $Body .= $ip; $Body .= "\n"; $Body .= "Detailed IP: "; $Body .= $hostaddress; $Body .= "\n"; $Body .= "Browser: "; $Body .= $browser; $Body .= "\n"; $Body .= "referred: "; $Body .= $referred; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?>
  3. Thanks pikachu, I guess the JS is more of a UI function? I just added the following code to my php, is this right: // validation $validationOK=true; if (Trim($Name)=="") $validationOK=false; if (Trim($Subject)=="") $validationOK=false; if (Trim($Email)=="") $validationOK=false; if (Trim($Message)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; }
  4. Thanks for the responses guys. Here is the JS I'm using as a validator: http://www.javascript-coder.com/html-form/javascript-form-validation.phtml#download and the code at the bottom of my page: <script type="text/javascript"> var frmvalidator = new Validator("contact"); frmvalidator.addValidation("Name","req","Name required!"); frmvalidator.addValidation("Email","req","Email required!"); frmvalidator.addValidation("Email","email","Please use a valid Email address!"); frmvalidator.addValidation("subject", "dontselect=000","Please select a subject!"); frmvalidator.addValidation("Message","req","Please enter a message!"); frmvalidator.addValidation("Message","minlen=20","Your message is too short!"); </script><!--end validation--> Should I use a non-JS based validation? Definitely understand the weakness here.
  5. Hello, I've looked around at some previous posts and can't seem to get them to work for me. I'm occasionally receiving blank emails from my contact form, i.e. Name: Email: Subject: Message: with no fields filled out. No doubt the cause is my form. It has validation, and I'm aware that with JS turned off, the validation won't work, but I find it hard to believe that people are just submitting blank forms, I'm confused, and am worried that I'm getting emails and not realizing it! My code is below, if you can point me in the right direction or point out the problem area that would be great! website is: www.ed-yu.com <div id="contact_box"> <h3>Questions?<br />Comments?<br />Just get in touch.</h3><p>(use the form below, or email edward@ed-yu.com)</p> <form id="contact" method="post" class="form" action="js/contactengine.php"> <p class="name"> <input type="text" name="Name" id="Name" /> <label for="Name">Name</label> </p> <p class="email"> <input type="text" name="Email" id="Email" /> <label for="Email">Email</label> </p> <p class="Subject"> <select name="Subject" id="Subject"> <option value="000" selected="selected"> - Choose -</option> <option value="General Question">General Question</option> <option value="Photography Inquiry">Photography Inquiry</option> <option value="Web-design Inquiry">Web-design Inquiry</option> <option value="Love Letter">Love Letter</option> <option value="Hate Mail">Hate Mail</option> <option value="Website Feedback">Website Feedback</option> </select> <label for="Subject">Subject</label> </p> <p class="Message"> <label for="Message"> </label><br /> <textarea name="Message" rows="20" cols="20" id="Message"></textarea> </p> <p class="Submit"> <input type="Submit" name="Submit" value="Send Email" class="submit-button" /> </p> </form> </div><!--contact_box--> <?php $EmailFrom = "ED-YU.com"; $EmailTo = "eddytheflow@gmail.com"; $Subject = "A new ".mb_strtolower($_POST['Subject'])." from ".$_POST['Name']." "; $Name = Trim(stripslashes($_POST['Name'])); $Tel = Trim(stripslashes($_POST['Tel'])); $Email = Trim(stripslashes($_POST['Email'])); $Message = Trim(stripslashes($_POST['Message'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Subject: "; $Body .= $Subject; $Body .= "\n"; $Body .= "Message: "; $Body .= $Message; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?>
  6. I've got the 301 redirect working, not so elegant, but it hopefully helps with the image burden by automatically sorting the images to the "recent" category. I've also made the PDFs in the services area open a new window. the social icons and blog areas also open a new window now. i think these changes make sense
  7. ugh I tried it with chrome and the fancybox works for me.. and this is why webdesign is hard! but anyways, Quicksand looks like it's going to be very useful. I'll probably work on that in the next couple weeks, seeing if I can get everything to work. In the meantime I tried to 301 redirect from www.ed-yu.com to www.ed-yu/com/#recent but that ain't working out so well =\ *edit* not working out so well, probably because both addresses are on the same page... ugh!
  8. thanks for the feedback mens! -- i changed the black background on in the about section, you're right, too harsh. -- I'm a little distraught that you mentioned fancybox, because I'm actually using it. What browser are you using? i might need to debug some more. -- as far as all the images being loaded, -all- of them.. that never occurred to me, as a problem but now I put that at the top of my list. Apprently, Desandro, the creator of the masonry plugin i'm using, hasn't added any support to change the default filter to anything other than "all", he's trying to sell his isotope plugin.. understandable.. but now I may have to sacrifice some image quality or be a bit more selective with that I display. open to suggestions. Thanks again mens, great advice
  9. Hey guys, just finished up my website on my own, and with a lot of help various developers who share their code. So here is what I've got: www.ed-yu.com http://www.ed-yu.com Right off the bat, I didn't build with graceful degradation in mind, so I've pretty much left non-JS enabled people to a less UI-friendly experience. But at least it works.. I've managed to smooth out my html code using the w3 validator, but haven't done so for the css. My biggest problem thus far is the contact form. I keep getting sporadic emails with empty fields i.e. Name: Subject: Message: I suck at php and might have to ask about this on another post, but for now, thanks for any input!
×
×
  • 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.