Jump to content

realmainer

Member
  • Posts

    18
  • Joined

  • Last visited

Posts posted by realmainer

  1. okay here are 2 of the 4 switches I put the closing } and I get the error on each line I put that closing } There has to be another reason why.

     

    switch($_POST['rgroup3']) {
        case "rg3v1":
            $value3 = "Radio Group 3 - Value 1 was selected.";
            break;
        case "rg3v2":
            $value3 = "Radio Group 3 - Value 2 was selected."};
     
    switch($_POST['rgroup4']) {
        case "rg4v1":
            $value4 = "Radio Group 4 - Value 1 was selected.";
            break;
        case "rg4v2":
            $value4 = "Radio Group 4 - Value 2 was selected."};
  2. I get this Parse error: syntax error, unexpected $end in /home/realmai1/public_html/whitetaildeerpool.com/survey.php on line 87

     

    There is nothing on line 87 but on line 68 is a red mark see photo

     

    Here is the code again 

    <?php

     
    /* Email Variables */
     
    $emailSubject = 'survey!';
    $webMaster = 'realmainer@gmail.com';
     
     
    /* Data Variables */
     
    $fname = $_POST['fname'];
    $lname = $_POST['lname'];
    $email = $_POST['email'];
    $state = $_POST['state'];
     
    switch($_POST['rgroup1']) {
        case "rg1v1":
            $value = "Radio Group 1 - Value 1 was selected.";
            break;
        case "rg1v2":
            $value = "Radio Group 1 - Value 2 was selected.";
     
    switch($_POST['rgroup2']) {
        case "rg2v1":
            $value2 = "Radio Group 2 - Value 1 was selected.";
            break;
        case "rg2v2":
            $value2 = "Radio Group 2 - Value 2 was selected.";
     
    switch($_POST['rgroup3']) {
        case "rg3v1":
            $value3 = "Radio Group 3 - Value 1 was selected.";
            break;
        case "rg3v2":
            $value3 = "Radio Group 3 - Value 2 was selected.";
     
    switch($_POST['rgroup4']) {
        case "rg4v1":
            $value4 = "Radio Group 4 - Value 1 was selected.";
            break;
        case "rg4v2":
            $value4 = "Radio Group 4 - Value 2 was selected.";
     
     
    $comments = $_POST['comments'];
     
    echo $value;
    echo $value2;
    echo $value3;
    echo $value4;
     
    $body = <<<EOD
    <br><hr><br>
    Name: $fname <br>
    Name: $lname <br>
    Email: $email <br>
    State: $state <br />
     
    comments: $comments <br>
     
    Comments: $comments <br>
    EOD;
    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($webMaster, $emailSubject, $body,
    $headers);
    ?>
     
    /* Results rendered as HTML */
     
     
    <html>
    <head>
    <title>sent message</title>
    <meta http-equiv="refresh" content="2;URL=http://www.whitetaildeerpool.com">
     
     
    -->
    </style>
    </head>
    <div align="center">thank you for filling out our form !</div>
    </div>
    </body>
    </html>
     

    post-130505-0-96848300-1398424521_thumb.jpg

  3. I have been working to figure this out. Here are the 2 pages I have The form and PHP page but I can not get it too work can someone tell me what I did wrong?

     <form  method="post"  name="form1" id="form1" action="survey.php">
          <p>
            <label>First Name
              <input type="text" name="fname" id="fname" />
            </label>
         </p>
          <p>
            <label>Last Name
              <input type="text" name="lname" id="lname" />
            </label>
          </p>
          <p>
            <label>Email
              <input type="text" name="email" id="email" />
            </label>
          </p>
           <p>
            <label>What state you from?
              <input type="text" name="state" id="state" />
            </label>
          </p>
          <p>
            <label> Would you like to see a nation wide pool? Winner by antler size.<br />
         <input type="radio" name="rgroup1" value="rg1v1"> yes
       <input type="radio" name="rgroup1" value="rg1v2"> no
          </label> 
          </p>
          <p>
            <label> Would you like to see a Maine State wide pool? Winner by weight.<br />
             <input type="radio" name="rgroup2" value="rg2v1"> yest
       <input type="radio" name="rgroup2" value="rg2v2"> no
       </label>
          </p>
          <p>
            <label> Would you like to see a Sanford Maine local pool? Winner by weight. All deer would be put on the same scale in Sanford. <br />
             <input type="radio" name="rgroup3" value="excellent"> yes
       <input type="radio" name="rgroup3" value="good"> no
       </label>
          </p>
          <p>
            <label> Would you be willing to pay $10.00 for the Nation wide pool? <br />
             <input type="radio" name="rgroup4" value="excellent"> yes
       <input type="radio" name="rgroup4" value="good"> no
              </label>
            <br />
          </p>
          <p>
            <label>Comments <br />
              <textarea name="comments" id="comments" cols="45" rows="5"></textarea>
            </label>
          </p>
          <p>
            <input name="submit" type="submit" class="buttons" id="submit" value="Send" />
          </p>
        </form>
     
    Now the PHP page
     
    <?php
     
    /* Email Variables */
     
    $emailSubject = 'survey!';
    $webMaster = 'realmainer@gmail.com';
     
     
    /* Data Variables */
     
    $fname = $_POST['fname'];
    $lname = $_POST['lname'];
    $email = $_POST['email'];
    $comments = $_POST['comments'];
     
     
     
    $body = <<<EOD
    <br><hr><br>
    Name: $fname <br>
    Name: $lname <br>
    Email: $email <br>
    Comments: $comments <br>
    EOD;
    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($webMaster, $emailSubject, $body,
    $headers);
     
     
    /* Results rendered as HTML */
     
    $theResults = <<<EOD
    <html>
    <head>
    <title>sent message</title>
    <meta http-equiv="refresh" content="2;URL=http://www.whitetaildeerpool.com/.html">
     
     
    -->
    </style>
    </head>
    <div align="center">thank you for filling out our form !</div>
    </div>
    </body>
    </html>
    EOD;
    echo "$theResults";
    ?>
  4. I have been watching videos and have not found anything yet that can help me to get radio group to work See my code and see if you can help me. I have tried  different things I put XXXX in were I thing I need some thing I also think I need something in the first line were the form starts

     

    <form  method="post"  name="form1" id="form1" action="survey.php">
          <p>
            <label>First Name
              <input type="text" name="fname" id="fname" />
            </label>
          </p>
          <p>
            <label>Last Name
              <input type="text" name="lname" id="lname" />
            </label>
          </p>
          <p>
            <label>Email
              <input type="text" name="email" id="email" />
            </label>
          </p>
           <p>
            <label>What state you from?
              <input type="text" name="state" id="state" />
            </label>
          </p>
          <p>
            <label> Would you like to see a nation wide pool? Winner by antler size.<br />
              <input type="radio" name="RadioGroup1" value="yes" id="RadioGroup1_0" />
              yes</label>
            <br />
            <label>
              <input type="radio" name="RadioGroup1" value="no" id="RadioGroup1_1" />
              no</label>
          </p>
          <p>
            <label> Would you like to see a Maine State wide pool? Winner by weight.<br />
              <input type="radio" name="RadioGroup2" value="yes" id="RadioGroup2_0" />
              yes</label>
            <br />
            <label>
              <input type="radio" name="RadioGroup2" value="no" id="RadioGroup2_1" />
              no</label>
          </p>
          <p>
            <label> Would you like to see a Sanford Maine local pool? Winner by weight. All deer would be put on the same scale in Sanford. <br />
              <input type="radio" name="RadioGroup3" value="yes" id="RadioGroup3_0" />
              yes</label>
            <br />
            <label>
              <input type="radio" name="RadioGroup3" value="no" id="RadioGroup3_1" />
              no</label>
          </p>
          <p>
            <label> Would you be willing to pay $10.00 for the Nation wide pool? <br />
              <input type="radio" name="RadioGroup4" value="yes" id="RadioGroup4_0" />
              yes</label>
            <br />
            <label>
              <input type="radio" name="RadioGroup4" value="no" id="RadioGroup4_1" />
              no</label>
            <br />
          </p>
          
          <p>
            <label>Comments <br />
              <textarea name="comments" id="comments" cols="45" rows="5"></textarea>
            </label>
          </p>
          <p>
            <input name="submit" type="submit" class="buttons" id="submit" value="Send" />
          </p>
        </form>
        <!--ends form-->
     
    This PHP below is in a external file
     
    <?php
     
    /* Email Variables */
     
    $emailSubject = 'survey!';
    $webMaster = 'realmainer@gmail.com';
     
     
    /* Data Variables */
     
    $fname = $_POST['fname'];
    $lname = $_POST['lname'];
    $email = $_POST['email'];
    XXXXXXXXXXXXXXXXXXXXX  I think I need something here for each group I have
    XXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXX
    $comments = $_POST['comments'];
     
     
     
    $body = <<<EOD
    <br><hr><br>
    Name: $fname <br>
    Name: $lname <br>
    Email: $email <br>
    Comments: $comments <br>
    EOD;
    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($webMaster, $emailSubject, $body,
    $headers);
     
     
    /* Results rendered as HTML */
     
    $theResults = <<<EOD
    <html>
    <head>
    <title>sent message</title>
    <meta http-equiv="refresh" content="2;URL=http://www.whitetaildeerpool.com">
     
     
    -->
    </style>
    </head>
    <div align="center">thank you for filling out our form !</div>
    </div>
    </body>
    </html>
    EOD;
    echo "$theResults";
    ?>
  5. I think going over the course again would be invaluable as I have had 4 courses of the killersites site and have found all of them a great product and easy to follow

    thanks

  6. When looking at programming, you need to try to figure out what you are really doing at the most basic level.

     

    So in this case, you say you have a survey form to create ... all that means, is that you need to create a form and be able to use PHP to capture the information people fill into the form. 

     

    It doesn't matter if it is a 'survey' form or a 'contact' form or say a 'fruit and vegetables' form - when it comes down to it, it is all the same.

     

    In general, most web programming is:

     

    1. Just capturing user inputted information in html forms, cleaning it and inserting it into databases.

    2. Then the sending it back to web pages.  

     

    This is an oversimplification but nonetheless, it is pretty much it.

     

    Stefan

    Yes it sound simple. But my server told me I need it to be a php. That is were I am ost. As I can not figure out how to get the php to work with the form

  7. I bought complete web programming. I have been watching the videos and need to know what I missed. I am trying to get a survey form to work. My host place tells me I have to have it in php. I have been trying to see what video shows it to me.  Can anyone tell me which one. I have watched all the php ones and did not see it.

     

  8. Not certain what page you want me to send. Do you want the setting page for chrome?

    Hi Stefan I think I am alset. I re installed it and it is working now. That is wierd that the other pages worked but not the main page. But it works now so thanks for the help

  9. Hard for me to see ... the image size is small.

     

    That said, I think it is running ... it is just not showing an image file ... I think.

     

    Did you add an index.php page to Wamp's web root?

     

    Stef

    Yes I did add it to the root here is a bigger picture.

    post-130505-0-32972500-1395871381_thumb.jpg

×
×
  • Create New...