www.webdeveloper.com
Results 1 to 2 of 2

Thread: php problems for email forms

  1. #1
    Join Date
    Apr 2003
    Posts
    8

    php problems for email forms

    with help from members of this forum I have tried to construct a php based system whereby with the click of a button a form pops up with multiple feilds for email addreses and names and a box with set message in it, when send is clicked it emails the desired recipients. My problems are that even though my server says PHP4 is enabled any page with a PHP extension appears balnk in my browser after taking more than the usual time to load. if I put a html extension on the button and form pages they appear but the refer.php page to handle the info comes up blank and dosen't send the mail.

    do all pages involved have to have the php extension?
    Is it a mac problem?

    here are my pages maybe they aren't correct.

    (THE BUTTON TEST PAGE)

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF">
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <a href="etest.html?<?_echo_$_SERVER['PHP_SELF'];_?>">form
    test</a>
    </body>
    </html>

    (THE FORM TEST PAGE)

    <html>

    <head><title>Send this page to a friend</title></head>



    <style>

    .formbox {

    ____BORDER-RIGHT: 2px groove; BORDER-TOP: 2px groove; BORDER-LEFT: 2px groove; BORDER-BOTTOM: 2px groove; FONT-SIZE: 8pt; BACKGROUND: #ffffff; COLOR: #000000; FONT-FAMILY: Verdana, Geneva, Arial, Helvetica, sans-serif

    }

    .formbut {

    ____BORDER-RIGHT: 2px outset; BORDER-TOP: 2px outset; BORDER-LEFT: 2px outset; BORDER-BOTTOM: 2px outset; FONT-SIZE: 8pt; BACKGROUND: #dddddd; COLOR: #000000; FONT-FAMILY: Verdana, Geneva, Arial, Helvetica, sans-serif

    }

    </style>



    <body bgcolor="#eeeeee">

    <center>

    Thank you for sending a link to this page to a friend. We hope they will enjoy it.



    <form action="refer.php" method="post">

    __<p>Cover.ie:

    ____<?php_$fullurl_=_"http://www.cover.ie".$_SERVER['QUERY_STRING'];

    _echo_"<a_href='txt.html'>txt</a>"_;

    _echo"<input_type='hidden'_name='link'_value=text.html>";?>

    ____<br>

    ____<br>

    __</p>

    __<table width="27%" border="0" cellspacing="0" cellpadding="0">

    ____<tr>

    ______<td width="50%">Friend's&nbsp;Name:</td>

    ______<td width="50%">

    <input type="text" name="name" class="formbox">

    ______</td>

    ____</tr>

    ____<tr>

    ______<td>Friend's&nbsp;E-mail:</td>

    ______<td><input type="text" name="email" class="formbox"></td>

    ____</tr>

    ____<tr>

    ______<td>Your&nbsp;Name:</td>

    ______<td><input type="text" name="sendername" class="formbox"></td>

    ____</tr>

    ____<tr>

    ______<td>Your&nbsp;E-mail:</td>

    ______<td><input type="text" name="senderemail" class="formbox"></td>

    ____</tr>

    __</table>

    __<p> Your Message:<br>

    ____<textarea name="message" cols="50" rows="5" class="formbox">this is the text of your message</textarea>

    ____<br>

    ____<input type="submit" value="Send Page" class="formbut">

    ____<input type="reset" value="Reset" class="formbut">

    ____<input type="button" value="Back to Page" class="formbut" onClick="history.go(-1)">

    __</p>

    __</form>

    __</center>

    </body>

    </html>


    (THE REFER PAGE)

    <html>

    <head><title>Send this page to a friend</title></head>

    <style>

    .formbut {

    ____BORDER-RIGHT: 2px outset; BORDER-TOP: 2px outset; BORDER-LEFT: 2px outset; BORDER-BOTTOM: 2px outset; FONT-SIZE: 8pt; BACKGROUND: #dddddd; COLOR: #000000; FONT-FAMILY: Verdana, Geneva, Arial, Helvetica, sans-serif

    }

    </style>


    <body bgcolor="#eeeeee">
    <?

    mail($_POST['email'],_$_POST['sendername']." thought you would enjoy this page","Hi ".$_POST['name']."!\n\n".$_POST['sendername']." (".$_POST['senderemail'].") thought you would enjoy the page found at ".$_POST['link'].".\n\nThey wrote the following message to you:\n\n".$_POST['message']."",_"from: ".$_POST['senderemail']."\r\n");

    echo_"<div align=\"center\"><table width=\"96%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" ";

    echo_"style=\"font-size:11pt;font-color:black;\">";

    echo_"<tr height=\"40\" align=center><td><p>&nbsp;</p></td></tr>";



    echo_"<tr><td >An e-mail was sent to ".$_POST['name']." (<a href=\"mailto:".$_POST['email']."\">".$_POST['email']."</a> ), we hope they will enjoy the page at";

    echo_" <a href=".$_POST['link']." target=_blank>".$_POST['link']." </a><br><br>Your message was:<br>".$_POST['message']."";

    echo_"<CENTER><FORM><INPUT type='button' value='Back to Page' class='formbut' onClick='history.go(-2)'></FORM></CENTER>";

    echo_"</td></tr></table></div>";

    ?>

    </body>

    </html>

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104

    Re: Re: php problems for email forms

    Originally posted by Dave Clark
    No, all pages do not have to have the .php extension -- only those that actually use PHP.
    But, out of the code he posted, all the pages are using PHP, so yes, they all need .php or .php4 extentions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles