How do the "PHP form" for blogspot?

Discussion in 'PHP' started by fixesign, Jun 9, 2010.

  1. #1
    I have two PHP files for the contact form.

    # 1. How to apply on blogspot?
    # 2. How to fill in for the action =...?
    # 3. Where is the place to upload files so that files can be called?

    first file:
    <form name="contact_form" method="post" action="mailer93.php" onSubmit="return evalid()">
    <table border="0"><tr>
    <td>First Name *</td>
    .........................etc
    </table>
    </form>
    __________________________________
    second file:
    <?php session_start();
    if(isset($_POST['Submit'])) {
    $youremail = 'my@mail.com';
    ..................................etc
    }
    ?>

    I hope, help me
     
    fixesign, Jun 9, 2010 IP
  2. sudharsan

    sudharsan Active Member

    Messages:
    164
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    1. Add a HTML/JavaScript Gadget in the blogger layout, add the HTML form code to the Gadget.
    2. The path where the file is hosted ex: http://abcd.com/123.php to the "action"
    3. upload the php file to a free host (google it) or to your own server(if you have one)

    let me know if it didnt work.
     
    sudharsan, Jun 9, 2010 IP
  3. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #3
    Right!
    You need a separate host that supports PHP Hosting
    You can Place the Script in the page using gadget or iframes or embedded codes ! :)
     
    roopajyothi, Jun 9, 2010 IP
  4. fixesign

    fixesign Member

    Messages:
    175
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #4
    I've uploaded the file on code.google. com/hosting. I get the download link "http://responer.googlecode.com/files/mailer93.php". I paste the link to <form action = "http: // responer.googlecode. com/files/mailer93. php". Then I tried using a form and submit, but I get an error message:
    "Forbidden
    Your client does not have permission to get URL /files/mailer93 .php from this server. (Client IP address: 202.xx.xx.xxx) Uploads are temporarily disabled. Please try again Later."

    Where is my mistake?
    Where better to host a php files?
     
    Last edited: Jun 9, 2010
    fixesign, Jun 9, 2010 IP
  5. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #5
    Oops! code.google.com is not a Host man!
    Its Google's Code Sharing site like Sourceforge and some other :)
     
    roopajyothi, Jun 9, 2010 IP
  6. fixesign

    fixesign Member

    Messages:
    175
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #6
    Thank you, roopajyothi.
    Does google do not have to host?
    Can you give an example, where I could host "PHP files".?
    Sorry, I really do not know.
     
    fixesign, Jun 9, 2010 IP
  7. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #7
    Google that for free hosts!
    It will help you!
    Theres a ton's of free host :)
     
    roopajyothi, Jun 10, 2010 IP
  8. fixesign

    fixesign Member

    Messages:
    175
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #8
    Can host PHP files to sites.google.com?
     
    fixesign, Jun 10, 2010 IP
  9. sudharsan

    sudharsan Active Member

    Messages:
    164
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
  10. fixesign

    fixesign Member

    Messages:
    175
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #10
    Should I create a MySQL-Database?
    Should I create a small website-php?
    Please, give me an explanation. thanks mate
     
    fixesign, Jun 12, 2010 IP
  11. sudharsan

    sudharsan Active Member

    Messages:
    164
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #11
    Ok..you just need to upload the php file to the free host and add the url to the "action", if your script needs a database then you need to create a database else no need..

    I have created a demo for you..have a look at http://tropicalhouseplants.blogspot.com/

    first i created a account in 110mb.com and i uploaded the php file to the server.. and got the url from 110mb.com which would be

    http://mywebsites123456.110mb.com/add.php and added a simple form to blogger blog and pointed it to the file i uploaded to the 110mb.com


    let know if have any issues in getting it..i can help you

    Thanks!!
     
    sudharsan, Jun 12, 2010 IP
  12. AjansBlack

    AjansBlack Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #12
    AjansBlack, Jun 12, 2010 IP
  13. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #13
    I recommend 110mb or zymic
     
    roopajyothi, Jun 12, 2010 IP
  14. fixesign

    fixesign Member

    Messages:
    175
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #14
    Thank you sudharsan! I've used 110MB.com and another on idwebs.net. (http://sticker123.110mb.com/contact93.php and http://stickers.idwebs.net/ and falling down here http://indoprofil.blogspot.com/2009/11/submit-opinion.html)
    The script I've good worked.
    But the message does not go into inbox / email me. "disappear"

    I make the form as follows:
    Name :_____
    Email :_____
    Subject :_____
    Message :_____

    Please, give me an explanation again, mate. Where I went wrong?
    #1 Contact.file:
    <script type="text/javascript">
    //email form validation

    function everif(str) {

    var at="@"
    var punct="."
    var lat=str.indexOf(at)
    var lstr=str.length
    var lpunct=str.indexOf(punct)
    if (str.indexOf(at)==-1){
    alert("Valid email must be entered")
    return false
    }

    if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
    alert("Valid email must be entered")
    return false
    }

    if (str.indexOf(punct)==-1 || str.indexOf(punct)==0 || str.indexOf(punct)==lstr){
    alert("Valid email must be entered")
    return false
    }

    if (str.indexOf(at,(lat+1))!=-1){
    alert("Valid email must be entered")
    return false
    }

    if (str.substring(lat-1,lat)==punct || str.substring(lat+1,lat+2)==punct){
    alert("Valid email must be entered")
    return false
    }

    if (str.indexOf(punct,(lat+2))==-1){
    alert("Valid email must be entered")
    return false
    }

    if (str.indexOf(" ")!=-1){
    alert("Valid email must be entered")
    return false
    }

    return true
    }

    function evalid(){
    var emailID=document.contact_form.mail

    if (everif(emailID.value)==false){
    emailID.focus()
    return false
    }

    //empty field validation

    var fname=document.contact_form.fname
    if ((fname.value==null)||(fname.value=="")){
    alert("Fields marqued with * must be entered")
    fname.focus()
    return false
    }

    var subject=document.contact_form.subject
    if ((subject.value==null)||(subject.value=="")){
    alert("Fields marqued with * must be entered")
    subject.focus()
    return false
    }

    var message=document.contact_form.message
    if ((message.value==null)||(message.value=="")){
    alert("Fields marqued with * must be entered")
    message.focus()
    return false
    }

    return true
    }
    </script>
    <form name="contact_form" method="post" action="http://sticker123.110mb.com/mailer93.php" onSubmit="return evalid()">
    <table border="0"><tr>
    <td>First Name *</td>
    <td colspan="2"><input name="fname" type="text" size="30" /></td>
    </tr><tr>
    <td>Your E-mail *</td>
    <td colspan="2"><input type="text" name="mail" size="30" /></td>
    </tr><tr>
    <td>Subject *</td>
    <td colspan="2"><input name="subject" type="text" size="30" /></td>
    </tr><tr>
    <td>Message *</td>
    <td colspan="2"><textarea name="message" onkeyup="return limitarelungime(this, 255)" cols="35" rows="5"></textarea></td>
    </tr><tr>
    <td> </td>
    <td colspan="2"> </td>
    </tr>
    <tr>
    <td><INPUT type="reset" name="reset" /></td>
    <td align="right"><input type="submit" name="Submit" value="Submit"></td>
    </tr>
    </table>
    </form>

    #2 Mailer.file:
    <?php session_start();
    if(isset($_POST['Submit'])) {
    $youremail = 'xxxxxxxx@mail.com';
    $fromsubject = 'Contact US';
    $fname = $_POST['fname'];
    $mail = $_POST['mail'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    $to = $youremail;
    $mailsubject = 'Masage recived from'.$fromsubject.' Contact Page';
    $body = $fromsubject.'

    The person that contacted you is '.$fname.'
    E-mail: '.$mail.'
    Subject: '.$subject.'

    Message:
    '.$message.'

    |---------END MESSAGE----------|';
    echo "Thank you fo your feedback. I will contact you shortly if needed.<br/>Go to <a href='/index.php'>Home Page</a>";
    mail($to, $subject, $body);
    } else {
    echo "You must wright a message. </br> Please go to <a href='/contact93.php'>Contact Page</a>";
    }
    ?>

    I want my friends can try the file above.
     
    Last edited: Jun 13, 2010
    fixesign, Jun 13, 2010 IP
  15. Obi

    Obi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    I consider you should to create php form than to generate code and insert your form into blogspot widget.
     
    Obi, Jun 14, 2010 IP
  16. sudharsan

    sudharsan Active Member

    Messages:
    164
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #16
    looks like..you can send mails only in paid version :(

    http://www.110mb.com/forum/help-with-email-files-and-php-refferal-t30143.0.html

    i would suggest you to use free form services like http://kontactr.com/ or http://www.contactify.com/


    Thanks,
    Sudharsan.


     
    sudharsan, Jun 15, 2010 IP
    fixesign likes this.
  17. extremephp

    extremephp Peon

    Messages:
    1,290
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    0
    #17
    extremephp, Jun 15, 2010 IP