#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0

    Having Form issues


    I am trying to get a form on my web page to send a email after I am pretty new to php so anyone that can help please do. Here is my code.

    PHP Code:

    <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">


    <h1>
    <label for='artistname'>Artist / Group Name :</label>
    <input type="text" name="artistname" >
    </h1>


    <h1>
    <label for='contactname'>Contact Name: </label>
    <input type="text" name="contactname" >
    </h1>

    <h1>
    <label for='contactnumber'>Contact Number: </label>
    <input type="text" name="contactnumber" >
    </h1>
     
     <h1>
    <label for='Genre'>Genre: </label>
    <input type="text" name="Genre" >
    </h1>

    <h1>
    <label for='Country'>Country: </label>
    <input type="text" name="Country">
    </h1>

    <h1>
    <label for='State'>State:</label>
    <input type="text" name="State" >
    </h1>

    <h1>
    <label for='County'>County: </label>
    <input type="text" name="County" >
     </h1>

    <h1>
    <label for='City'>City:</label>
    <input type="text" name="City" >
     </h1>


    <h1>
    <label for='email'>Email: </label>
    <input type="text" name="email" >
     </h1>

    <h1>
    <label for='weblink'>Web Link:</label>
    <input type="text" name="weblink" >
     </h1>

    <h1>
    <label for='uploaded_file'>Select A Song To Upload:</label>
    <input type="file" name="uploaded_file">
     </h1>

    <h1>
    <label for='Bandbio'>Band Bio</label>
    <textarea name="Bandbio" ></textarea>
     </h1>

    <h1>
    <input type="submit" value="Submit" name='submit'>
    </h1>


    <?php
    if (isset($_REQUEST['Voiceoftheindependentartist@gmail.com']))
    //if "email" is filled out, send email
      
    {
      
    //send email
      
    $ArtistName $_REQUEST['artistname'] ;
      
    $Description $_REQUEST['Description'] ;
      
    $Genre $_REQUEST['Genre'] ;
      
    $Country $_REQUEST['Country'] ;
      
    $State $_REQUEST['State'] ;
      
    $County $_REQUEST['County '] ;
      
    $City $_REQUEST['City'] ;
      
    $Bandbio$_REQUEST['Bandbio'] ;
      
    $email $_REQUEST['email'] ;
      
      
    mail("Voiceoftheindependentartist@gmail.com"$subject,
      
    $message"From:" $email);
      echo 
    "Thank you for submitting your song!";
      }
    else
    //if "email" is not filled out, display the form
      
    {
      echo 
    "Please go back and fill in form completly";
      
      }
    ?>


    </form>

    Thx in advance
    Last edited by Baalaakar; March 17th, 2013 at 08:55 AM. Reason: php tags
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,498
    Rep Power
    594
    Did you look at the resulting HTML source to see what you are getting?
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    you forgot to mention the actual issue. So what is it?

    I don't see $subject and $message defined anywhere, so maybe that's the problem. But maybe you just didn't give us the full code. I can't tell, I'm not sitting in front of your computer.

    Also, please wrap your code in [ PHP ] tags.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0

    reply


    When I log into my page and fill the form out and send it the page says unable to load page.

    the site i am using is a social engine php networking page.


    At this time the form will allow me to put in information in the to inputs and press the send but will not actually send the email.

    I have been using w3school.com to find the codes i need but i have been unable to get past were I am at on the code.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by gw1500se
    Did you look at the resulting HTML source to see what you are getting?
    I am not sure what you mean by this I will try to look into that. I made another reply maybe it will answer that.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,498
    Rep Power
    594
    I mean the raw HTML source. When you right click on that page, you should see a selection to view page source.

    I suspect you are not getting what you expect with the way you generate the action. If you want to run the same page with the submit, you done need to specify the action page, as that is the default.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.

IMN logo majestic logo threadwatch logo seochat tools logo