<M/> 170 Why so serious? Featured Poster

A story in "Time Magazine" once reported that while Donald Trump was in college he enjoyed reading federal foreclosure listings just for fun.

<M/> 170 Why so serious? Featured Poster

Romanesco is one good looking veggie.

I had a pizza from a restraunt known as Pieology.

<M/> 170 Why so serious? Featured Poster

If a woman ruled the whole world, there'd be no negotiating.
Everyone is home for dinner and in bed before midnight or there's hell to pay.

Sounds like my home...

<M/> 170 Why so serious? Featured Poster

How about we have women run the world... we wouldn't have wars, just intense negotiations every 28 days. I rather see that than countries killing each other.

<M/> 170 Why so serious? Featured Poster

We can't really help you if we can't see your work. A screenshot of an output doesn't really help if there are many ways to come out with the same output.

<M/> 170 Why so serious? Featured Poster

@Pixel, well... i had them repeated 3 times... because... ummm... I have no idea why I did that to begin with. But anyways, I got it to work, but what was weird is that I started getting the emails literally a few hours late.

<M/> 170 Why so serious? Featured Poster

So, I made some progress on the php. The security part works and so does the part where i get a copy of the inputs into my csv. The only part that still doesn't work is the email part of it... Here is what it is now:

<?php 
$contactname  = $_POST["contact-name"];
$contactemail = $_POST["contact-email"];
$contactphone = $_POST["contact-phone"];
$child_info   = $_POST["child_info"];
$to           = 'yahoo@gmail.com';
$subject      = 'Contact Form Submission!';

//******************************************************************************************************************************//

if(isset($_POST['contact-email'])) {
    $to      = "yahoo@gmail.com";
    $subject = "Contact Form Submission";

    function died($error)
    {
        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
        echo "These errors appear below.<br /><br />";
        echo $error . "<br /><br />";
        echo "Please go back and fix these errors.<br /><br />";
        die();
    }

    if(!isset($_POST['contact-name']) || !isset($_POST['contact-email']) || !isset($_POST['contact-phone']) || !isset($_POST['child_info'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');
    }

    $contactname   = $_POST['contact-name']; //required
    $contactemail  = $_POST['contact-email']; //required
    $contactphone  = $_POST['contact-phone']; //required
    $child_info    = $_POST['child_info']; //required
    $error_message = "";

    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';

    if(!preg_match($email_exp, $contactemail)) {
        $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
    }

    $string_exp = "/^[A-Za-z .'-]+$/";
    $numb_exp   = '/^[0-9.-]/';

    if(!preg_match($string_exp, $contactname)) {
        $error_message .= 'The First Name you entered does not appear to be valid.<br />';
    }

    if(!preg_match($numb_exp, $contactphone)) {
        $error_message .= 'The Phone Number you entered does not appear to be valid.<br />';
    }

    if(strlen($child_info) < 2) {
        $error_message .= 'The Comments you entered do not appear to be valid.<br />';
    }

    if(strlen($error_message) > …
<M/> 170 Why so serious? Featured Poster

Where do i put that superglobal?

<M/> 170 Why so serious? Featured Poster

Incase anyone was going to try this... don't try merging the two codes, it doesn't work...

<M/> 170 Why so serious? Featured Poster

I would do that, but I... well... have no clue how to use them (don't ask :P):/ That is why I prefer to do it like the way I do, that way, I never have to ask a basic question like I have already. All I would need is a solution but I haven't had much success so far. Based on Lau's version, do you know what could have went wrong?

<M/> 170 Why so serious? Featured Poster

Google Images... just type what you are looking for, and baaam. You get pictures.

<M/> 170 Why so serious? Featured Poster

... This whole argument from a guy trying to scam us about a false business completely changed gears into a more political debate about... erm... nukes? elections? politics? Middle East?

<M/> 170 Why so serious? Featured Poster

Alright, so I tried running the code, the results are much more positive. I don't get any of the errors I get before but the form security doesn't seem to work because I can just click submit and it just keeps refreshing the page and it doesn't collect any of the inputs (it doesn't show in my email)? Did I forget to add anything?

Oh, and this is the form I worked on before. This was the one where I can submit the form and I can collect the inputs but the form lacks security and has odd glitches to it (incase you wanted to see it...):

<?php 
        $contactname = $_POST["contact-name"];
        $contactemail = $_POST["contact-email"];
        $contactphone = $_POST["contact-phone"];
        $child_info = $_POST["child_info"];
        $to      = 'yahoo@gmail.com';
        $subject = 'Contact Form Submission!';

        $v1 = "
                <html> <body> <style>
                    h1 {color:#000066;}
                    table {border:1px solid black; background: #e3f0ff;}
                </style> <h1>Hello, this form has been submitted!</h1> <img src= 'logo1.png' /> <table rules='all' style='border-color: #ffb300;' cellpadding='10' width='500px'> <tr style='background: #ffb300;'><td>First Name: $contactname</td> <tr style='background: #fafafa;'><td>Email: $contactemail</td> <tr style='background: #fafafa;'><td>Phone: $contactphone</td><tr style='background: #fafafa;'><td>Child Information: $child_info</td></table> </body> </html> ";
        $message = $v1; 
        $headers  = "From: $from\r\n"; 
        $headers .= "Content-type: text/html\r\n"; 
        mail($to, $subject, $message, $headers); 
        echo "Message has been sent..."; //Page RE DIRECT 
        echo $v1;
    //******************************************************************************************************************************//



        $contactname = $_POST["contact-name"];
        $contactemail = $_POST["contact-email"];
        $contactphone = $_POST["contact-phone"];
        $child_info = $_POST["child_info"];
        $verificationmsg = 'Thank you for your inquiry, we will contact you shortly! <br>Best,<br>M<br>©Name of Company was here :)(TM) All Rights Reserved 2015';
        $subject = 'Message Confirmed!';
        $v1 = "
                <html> <body> <style>
                    #disclosure …
<M/> 170 Why so serious? Featured Poster

@Lau, Sorry about that, I was trying to work on an old form of mine and wanted to see there was a better alternative. I saw that one and wanted to see if i can work off of that.

U may follow the example, but please, type it by urself, you will learn from that.

I will do that

I had fixed the problem, error for ur code is cause by the space. Try this code below:

I am gonna take a look at the code when I get home (its 2:00 am and I coming home from a wedding...)

<M/> 170 Why so serious? Featured Poster

Yes, the code is the same as the above. There were comments, i removed them, that is the only difference.

<M/> 170 Why so serious? Featured Poster

It says: Parse error: syntax error, unexpected T_IF in /home/content/86/5284386/html/thenameofmywebsite/contact.php on line 16

<M/> 170 Why so serious? Featured Poster

@Lau, i tried those changes, and still had errors :/

<M/> 170 Why so serious? Featured Poster

I was using the form from here: http://www.freecontactform.com/email_form.php

Is the form that this person created correctly written?

<M/> 170 Why so serious? Featured Poster

@diafol, I am gonna go download phpstorm...

@pixelsoul... should i remove that >.>

<M/> 170 Why so serious? Featured Poster

I spread the word the best I can about how great daniweb is... i did lose a few stackoverflow and codeprojects accounts in the process of talking about how great daniweb is, but totally worth it.

<M/> 170 Why so serious? Featured Poster

On this line: $subject = "Contact Form Submission;
Its supposed to be: $subject = "Contact Form Submission";

I pasted it in wrong.

<M/> 170 Why so serious? Featured Poster

I am working on adding security onto my contact form and I can't seem to find the reason as to why I get errors. Currently, when I test the php form, I get this error: Parse error: syntax error, unexpected T_IF in /home/content/86/5284386/html/websitenamewashere/contact.php on line 16
Here is my php:

<?php
 
if(isset($_POST['email'])) {
 
     
 
 
    $to = "yahoo@gmail.com";
 
    $subject = "Contact Form Submission;
 

 
    function died($error) {
 
 
        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
 
        echo "These errors appear below.<br /><br />";
 
        echo $error."<br /><br />";
 
        echo "Please go back and fix these errors.<br /><br />";
 
        die();
 
    }
 
     
 
    // validation expected data exists
 
    if(!isset($_POST['contact-name']) ||
  
        !isset($_POST['contact-email']) ||
 
        !isset($_POST['contact-phone']) ||
 
        !isset($_POST['child_info'])) {
 
        died('We are sorry, but there appears to be a problem with the form you submitted.');       
 
    }
 
     


        $contactname = $_POST["contact-name"]; //required

        $contactemail = $_POST["contact-email"]; //required

        $contactphone = $_POST["contact-phone"]; //required

        $child_info = $_POST["child_info"]; //required

 
     
 
    $error_message = "";
 
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
 
  if(!preg_match($email_exp,$contactemail)) {
 
    $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
 
  }
 
    $string_exp = "/^[A-Za-z .'-]+$/";
    $numb_exp = '/^[0-9.-]';
 
  if(!preg_match($string_exp,$contactname)) {
 
    $error_message .= 'The First Name you entered does not appear to be valid.<br />';
 
  }
 
  if(!preg_match($numb_exp,$contactphone)) {
 
    $error_message .= 'The Phone Number you entered does not appear to be …
<M/> 170 Why so serious? Featured Poster

Chipotle Steak Burrito and guac'... yes... i know it costs extra... but it tastes good...

<M/> 170 Why so serious? Featured Poster

Help with Java/PHP/Programming problem
* Gaining advice on different business endeavours I've tried/want to try
* Expressing my disdain for joining a company and building a conventional career
Does that not sound like I really am a Computer Science graduate, with ambitions to start a company, and make a big impact in the world?

I have done all of those... and look at me... I am arguably a mess ;)

Mike Askew commented: Can confirm, is mess. See OP avatar for proof +0
<M/> 170 Why so serious? Featured Poster

Yes, I used to think that every person in England used to have a piss pot under their bed... turns out that I was wrong... I watched too much Mr. Bean before going there...

Have you ever been fired from a job

<M/> 170 Why so serious? Featured Poster

Arguably, I have lost a bit of "clothing" when "wrestling" a "sumo." During football, we were doing a drill, and those who play reciever were put up (idk why we did this drill but oh well, it could be why the coach is gone) to go and basically tackle Offensive and defensive tackle players. I was put up to basically push the center, he is also the strongest on the team because he is a fat kid, and when we were about to start, he goes before the whistle and tackles me and knocks my offseason training cap off. In the next attempt, I hurt him pretty badly because I got a better leverage and managed to bring him to the ground... It was a good day...

Have you ever been in a fight (physical one, not the type of arguments you get in with your wife because you forgot to put the milk in the fridge).

<M/> 170 Why so serious? Featured Poster

I wasn't considering something very advanced because its a pretty basic site and the main source of contacting is through a phone call. The contact form is an optional thing, but I guess i will just implement captcha then.

<M/> 170 Why so serious? Featured Poster

Hmm, I need to add some form security. What do you guys think is the best approach since I don't need a very advanced form security?

<M/> 170 Why so serious? Featured Poster

No.
Have you ever been to prison

<M/> 170 Why so serious? Featured Poster

Yes

Have you ever used Stackoverflow

<M/> 170 Why so serious? Featured Poster

You should have seen my first posts on Daniweb... I didn't know how to write a loop XD (2 years ago lol)

https://www.daniweb.com/members/950732/m/posts/246

Have my skills increased overtime? Yes (this is where diafol lifts his finger and says, "Oh really..."). Has my maturity increased overtime? Pfft... Yeah right.

Its great to see where we all began :)

<M/> 170 Why so serious? Featured Poster

Is there a certain requirement to what skill sets the person must have...? And is this innovation about a drink company that was supposed to be launched mid 2014...?

<M/> 170 Why so serious? Featured Poster

You know what, I think I figured out why I had a problem the entire time. My php variables didn't match what I had in the HTML file because of what I changed - diafol face atm after reading it until this far: :D . I finally got it to send me verifications and send me a copy of what they sent. I just need to clean it up... a lot.

<M/> 170 Why so serious? Featured Poster

I am gonna go check out PHPStorm, hopefully that will be pretty good.

<M/> 170 Why so serious? Featured Poster

Out of curiousity, what would be the most preferred editor for catching mistakes like the ones I am making? Coda 2 doesn't do the job, even though its a nice looking editor...

<M/> 170 Why so serious? Featured Poster

Sorry Diafol, I am using Coda as the editor. It does a poor job of telling me about errors :/

Let me see if Dreamweaver can do things better than Coda

Losing the will here M. Some of these issues have been covered already. Ok leaving you to it.

I don't blame you, I am a mess at the moment and I need to get things straightened up to where I was last summer. But I do appreciate your help!

<M/> 170 Why so serious? Featured Poster

Okay, so I am starting to see some progress when having it set up like that. Atm, I do get what the user submitted, but only half of it (view image). Currently, I don't get half of the inputs, the user doesn't get a verification, and the csv isn't recieving any inputs.
Screen_Shot_2015-06-24_at_9.52_.06_AM_.png

<M/> 170 Why so serious? Featured Poster

Hmm, okay.
I tend to prefer at times to use inline styling to overwrite a css I did. Is it the best approach? Of course not. Do I like it for no reason? Yeah :P

I added some name attributes and this is what I have so far (hopefully it looks good :P):

<form action="contact.php" class="footer-form" method="post">
<p class="title">Feel free to write some words</p>

<div class="form-group">
    <strong>
        <input type="text" class="form-control" name="contact-name" id="contact-name" placeholder="Your Name:">
    </strong>
</div>
<div class="form-group">
    <strong>
        <input type="email" class="form-control" name="contact-email"" id="contact-email" placeholder="Your E-mail:">
    </strong>
</div>
<div class="form-group">
    <strong>
        <input type="phone" class="form-control" name="contact-phone" id="contact-phone" placeholder="Your Phone Number:">
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="child_info" class="form-control" name="child_info" id="child_info" placeholder="Information About Child:">
    </strong>
</div>
<div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
    <strong style="font: Raleway; color: #999; font-size: 16.5px;" name="gender" id="gender">Child's Gender:</strong>
    <strong style="color: #888;">
        <input type="radio" id="gender" name="male" value="male"> Male
    </strong>
    <strong style="color: #888;">
        <input type="radio" id="gender" name="female" value="female"> Female
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="age" name="age" id="age" class="form-control" placeholder="Age of Child:">
    </strong>
</div>
<div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
    <strong style="font: Raleway; color: #999; font-size: 16.5px;" id="specialneeds">Does Your Child Have Special Needs:</strong> 
    <strong style="color: #888;">
        <input id="yes" type="radio" name="specialneeds" value="yes">Yes
    </strong>
    <strong style="color: #888;">
        <input id="no" type="radio" name="specialneeds" value="no"> No
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="comment" class="form-control" name="message" id="message" placeholder="Comments about service or if you want to add another child, write here:">
    </strong>
</div>
<button type="submit" class="btn btn-default waves-effect waves-button waves-float waves-classic"><strong>Submit</strong></button>
<M/> 170 Why so serious? Featured Poster

Alright, I am back reviving this thread...

So, I have made a few tweaks to the form. Currently, the only thing that works is that it sends me an email that someone submitted the form. What doesn't work is that I can't see what they submitted, the user who submitted it doesn't get a verification, and the results don't get recorded in my csv file.

Here is the current progress (i removed the extra ID tags):

HTML:

<form action="contact.php" class="footer-form" method="post">
<p class="title">Feel free to write some words</p>

<div class="form-group">
    <strong>
        <input type="text" class="form-control" id="contact-name" placeholder="Your Name:">
    </strong>
</div>
<div class="form-group">
    <strong>
        <input type="email" class="form-control"  id="contact-email" placeholder="Your E-mail:">
    </strong>
</div>
<div class="form-group">
    <strong>
        <input type="phone" class="form-control" id="contact-phone" placeholder="Your Phone Number:">
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="child_info" class="form-control" id="child_info" placeholder="Information About Child:">
    </strong>
</div>
<div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
    <strong style="font: Raleway; color: #999; font-size: 16.5px; " id="gender">Child's Gender:</strong>
    <strong style="color: #888;">
        <input type="radio" id="maLe" name="male" value="male"> Male
    </strong>
    <strong style="color: #888;">
        <input type="radio" id="female" name="female" value="female"> Female
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="age" id="age" class="form-control" placeholder="Age of Child:">
    </strong>
</div>
<div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
    <strong style="font: Raleway; color: #999; font-size: 16.5px;" id="specialneeds">Does Your Child Have Special Needs:</strong> 
    <strong style="color: #888;">
        <input id="yes"" type="radio" name="yes" value="yes">Yes
    </strong>
    <strong style="color: #888;">
        <input id="no" type="radio" name="no" value="no"> No
    </strong>
</div>
<div class="form-group">
    <strong> 
        <input type="comment" class="form-control" id="message" placeholder="Comments about service or if you want to add another child, write here:">
    </strong>
</div>
<button type="submit" class="btn btn-default waves-effect …
<M/> 170 Why so serious? Featured Poster

Congrats man! Glad you are coming to California!

<M/> 170 Why so serious? Featured Poster

Man... I am still doing my finals...

<M/> 170 Why so serious? Featured Poster

Were you looking for sommething more complicated?

I was wondering if there was an actual generator already made that can do it. But i can try toying around with that.

<M/> 170 Why so serious? Featured Poster

Does anyone here know of a generator that can automatically create tables for you? Basically, I have a site with over 100 pdf files in it, and I want to put them in a table so that they display in a list. Is there a generator that can create the table for me without me having to create each individual link to each pdf?

I don't know if that makes sense or not.

<M/> 170 Why so serious? Featured Poster

Sorry Diafol, things have been pretty "off" for me lately and I haven't been writing or practicing much due to finals that are coming up before the end of school :P

I usually make it a rule of thumb to keep 'name' and 'id' the same if possible to avoid this confusion, as sometimes you want to lever some ajax goodness out of forms, wheree you may be using 'id' instead of 'name'. Is there any reason for the difference?

I did it the way I did because I assumed (for whatever random reason I had) that it can work because it did before in the past with a different site I was practicing on.

Did you not think to test it first?

No, not while I was using my phone at that moment.

<M/> 170 Why so serious? Featured Poster

its a lung disease... or basically Silicosis

<M/> 170 Why so serious? Featured Poster

So by doing something like this:
HTML (before):
<input type="text" class="form-control" name="contactname" id="contact-name" placeholder="Your Name:">

After:
<input type="text" class="form-control" name="contact-name" id="contactname" placeholder="Your Name:">

<M/> 170 Why so serious? Featured Poster

Form security is pretty important and is something I have to implement. I would use phpmailer but I am not really sure how to use it.

Based on my current form:
HTML:

<form action="contact.php" class="footer-form">
    <p class="title">Feel free to write some words</p>

    <div class="form-group">
        <strong>
            <input type="text" class="form-control" name="contactname" id="contact-name" placeholder="Your Name:">
        </strong>
    </div>
    <div class="form-group">
        <strong>
            <input type="email" class="form-control" name="contactemail" id="contact-email" placeholder="Your E-mail:">
        </strong>
    </div>
    <div class="form-group">
        <strong>
            <input type="phone" class="form-control" name="contactphone" id="contact-phone" placeholder="Your Phone Number:">
        </strong>
    </div>
    <div class="form-group">
        <strong> 
            <input type="child_info" class="form-control" name="child_info" id="contact-text" placeholder="Information About Child:">
        </strong>
    </div>
    <div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
        <strong style="font: Raleway; color: #999; font-size: 16.5px; " id="gender">Child's Gender:</strong>
        <strong style="color: #888;">
            <input type="radio" id="maLe" name="gender" value="male"> Male
        </strong>
        <strong style="color: #888;">
            <input type="radio" id="female" name="gender" value="female"> Female
        </strong>
    </div>
    <div class="form-group">
        <strong> 
            <input type="age" name="age" class="form-control" id="contact-text" placeholder="Age of Child:">
        </strong>
    </div>
    <div class="form-group" style="border-bottom: 1px solid #e5e5e5;">
        <strong style="font: Raleway; color: #999; font-size: 16.5px;" id="specialneeds">Does Your Child Have Special Needs:</strong> 
        <strong style="color: #888;">
            <input id="yes"" type="radio" name="specialneeds" value="yes">Yes
        </strong>
        <strong style="color: #888;">
            <input id="no" type="radio" name="specialneeds" value="no"> No
        </strong>
    </div>
    <div class="form-group">
        <strong> 
            <input type="comment" class="form-control" id="message" id="contact-text" placeholder="Comments about service or if you want to add another child, write here:">
        </strong>
    </div>
    <button type="submit" class="btn btn-default waves-effect waves-button waves-float waves-classic"><strong>Submit</strong></button>
</form>

The PHP is the same as above:

<?php 
    $contactname = $_POST["contact-name"];
    $contactemail = $_POST["contact-email"];
    $contactphone = $_POST["contact-phone"];
    $child_info = $_POST["child_info"];
    $gender = $_POST["gender"];
    $age = $_POST["age"];
    $specialneeds = $_POST["specialneeds"];   
    $message = $_POST["message"];
    $to …
<M/> 170 Why so serious? Featured Poster

Sorry about the formatting, i didn't realize it until now. It was perfectly fine till i posted it on the editor here :P
I will see if i can make some changes based on what you guys have said

<M/> 170 Why so serious? Featured Poster

Hey guys,
I am working on my contact form for a site of mine (i am designing the form differently) that is for a child care, and I can't seem to get the form to connect with the php in order to get it to send verification to the user, send me a copy, and record it within a csv.

Here is the html form that goes on the page:

                            <form action="#" class="footer-form" action="contact.php"> <p class="title">Feel free to write some words</p> <div class="form-group"> <strong><input type="text" class="form-control" id="contactname" id="contact-name" placeholder="Your Name:"></strong> </div> <div class="form-group"> <strong><input type="email" class="form-control" id="contactemail" id="contact-email" placeholder="Your E-mail:"></strong> </div> <div class="form-group"> <strong><input type="phone" class="form-control" id="contactphone" id="contact-phone" placeholder="Your Phone Number:"></strong> </div> <div class="form-group"> <strong> <input type="child_info" class="form-control" id="child_info" id="contact-text" placeholder="Information About Child:"></strong> </div> <div class="form-group" style="border-bottom: 1px solid #e5e5e5;"> <strong style="font: Raleway; color: #999; font-size: 16.5px; " id="gender">Child's Gender:</strong> <strong style="color: #888;"><input type="radio" id="maLe" name="male" value="male"> Male</strong>   
                                <strong style="color: #888;"><input type="radio" id="female" name="female" value="female"> Female</strong> </div> <div class="form-group" > <strong> <input type="age" id="age" class="form-control" id="contact-text" placeholder="Age of Child:"></strong> </div> <div class="form-group" style="border-bottom: 1px solid #e5e5e5;"> <strong style="font: Raleway; color: #999; font-size: 16.5px;" id="specialneeds">Does Your Child Have Special Needs:</strong> <strong style="color: #888;"><input id="yes"" type="radio" name="yes" value="yes"> Yes</strong>   
                                <strong style="color: #888;"><input id="no" type="radio" name="no" value="no"> No</strong> </div> <div class="form-group"> <strong> <input type="comment" class="form-control" id="message" id="contact-text" placeholder="Comments about service or if you want to add another child, write here:"></strong> </div> <button type="submit" class="btn btn-default waves-effect waves-button waves-float waves-classic"><strong>Submit</strong></button> </form>

Here is the PHP that does all the heavy liftin':


       
<M/> 170 Why so serious? Featured Poster

San Andreas was an awesome film.