Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Php Form Issue With Migration To Php5

    Hi there!

    My host has just informed me that tonight PHP was upgraded from 4 to 5. They also sent me a very exhausive document that tells me what has been changed, but as usual, makes no sense to me!

    On PHP4, my form submitted fine, now my confirmation page (code below) says it has sent the details to my email then nothing appears in the inbox!

    Any suggestions welcome!

    TY
    Nath

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Code please, methinks you forgot to post it in >.<
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Whoops! This is the form page in which info is entered:

    Code:
    <?php include('page_top.php'); ?>
    <?php include('page_nav.php'); ?>
    <?php include('page_middle.php'); ?>			
            
    <!-- MAIN CONTENT
    
    This is a table that is maintained by the user.  See the commented out code below to make sure you set the paragraphs and cell attributes correctly.
    
    This is a row and cell for a subject heading
    <tr>
    		<td width="100&#37;" align="center" valign="middle" bgcolor="#FF0000">
            	<b><font face="Arial" pointsize="12" color="#000000">Heading here</font></b>
            </td>
        </tr>
    
    This is the Sub Heading line
    <p style="word-spacing: 1px; margin-top: 0; margin-bottom: 0">
    	<b><font face="Arial" color="#FFFF00">Sub Heading Style</font></b></p>
        
    This is a normal paragraph line
    <p style="word-spacing: 1px; margin-top: 0; margin-bottom: 0">
    	<font face="Arial">Paragraph Style</font></p>
    -->
    
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    	<tr>
    		<td width="100%" height="20" align="center" valign="middle" bgcolor="#FF0000">
            	<b><font face="Arial" pointsize="12" color="#000000">Register With Jivetastic</font></b>        </td>
        </tr>
        <tr>
    		<td width="100%" align="left" valign="top" bgcolor="#000000">	
        <form method=post action="register2.php">
    	<p style="word-spacing: 1px; margin-top: 0; margin-bottom: 0">&nbsp;</p>
        <p style="word-spacing: 1px; margin-top: 0; margin-bottom: 0" align="left">
    		  <b><font face="Arial" color="#FF9900">PLEASE DO NOT SUBMIT INFORMATION USING THIS FORM. DETAILS WILL NOT BE TRANSMITTED DUE TO A TECHNICAL FAULT WITH THE HOSTING PROVIDER. PLEASE TRY AGAIN SOON.</font><font face="Arial" color="#FFFF00"><br />
    		  <br />
    		  Jivetastic Membership Form</font></b><br />
    	<font size="1" face="Arial" color="#FF0000">All fields marked with an asterisk * must be completed.</font></p>
    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="30%" valign="top" align="left"><p><font face="Arial">First Name:</font><br />&nbsp;</p>        </td>
            <td width="70%" valign="top" align="left"><font face="Arial">
              <input type="text" id="t_name1" name="t_name1">
            *</font></td>
            </tr><tr>
            <td valign="top" align="left"><font face="Arial">Surname:<br />
              &nbsp;</font></td>
            <td valign="top" align="left"><font face="Arial">
              <input type="text" id="t_name2" name="t_name2" />
              *</font></td>
            </tr>
          <tr>
            <td valign="top" align="left"><font face="Arial">House No./Name:</font></td>
            <td valign="top" align="left"><font face="Arial">
              <input type=text  name="door" id=door size="15">
            *</font></td>
            </tr>
          <tr>
            <td valign="top" align="left"><font face="Arial">Street</font></td>
            <td valign="top" align="left"><p><font face="Arial">
              <input type=text  name="street" id=street size="20">
            </font>*</p>          </td>
            </tr>
          <tr>
            <td valign="top" align="left"><font face="Arial">Town</font></td>
            <td valign="top" align="left"><font face="Arial">
              <input type=text  name="town" id=town size="20">
            *</font></td>
            </tr>
          <tr>
            <td valign="top" align="left"><font face="Arial">County</font></td>
            <td valign="top" align="left"><font face="Arial">
              <input type=text name="county" id=county size="20" />
            *</font></td>
            </tr>
          <tr>
            <td valign="top" align="left"><font face="Arial">Postcode</font><br />&nbsp;</td>
            <td valign="top" align="left"><font face="Arial">
              <input type=text name="code" id=code size="20">
            *</font></td>
            </tr>
          <tr>
            <td valign="top" align="left"><font face="Arial">Home Tel:<br />
              &nbsp;</font></td>
            <td valign="top" align="left"><font face="Arial">
              <input type="text" id="htel" name="htel" size="15" />
            </font></td>
            </tr>
          <tr>
            <td valign="top" align="left"><font face="Arial">Mob</font><font face="Arial"> Tel:<br />
              &nbsp;</font></td>
            <td valign="top" align="left"><font face="Arial">
              <input type="text" id="wtel" name="wtel" size="15" />
            </font></td>
            </tr>
          <tr>
            <td valign="top" align="left"><font face="Arial">Email Address</font><sup><a href="#1"><font face="Arial, Helvetica, sans-serif" color="#FF0000">1</font></a></sup>:</td>
            <td valign="top" align="left"><font face="Arial">
              <input type="text" name="email" id="email" size="35" />
              * </font></td>
            </tr>
        </table>
    	<p><font face="Arial">How did you hear about us?&nbsp;
    	    <select size="1" name="hear" id=hear>
    	          <option selected>Select</option>
    	          <option>Newspaper</option>
    	          <option>Stonehenge Trader</option>
    	          <option>Google/Yahoo</option>
    	          <option>Website</option>
    	          <option>Word of Mouth</option>
    	          <option>Leaflet/Flyer</option>
            </select>
    	</font></p>
    	<p><font face="Arial">Have you been to a Modern Jive class before?
    	<select size="1" name="attend" id=attend>
    	<option selected>Select</option>
    	<option>Yes</option>
    	<option>No</option>
    	</select>
    	</font></p>
    	<p><font size="2">By continuing with this registration, you agree to the <a href="terms.html" target="_blank">terms and 
    	conditions</a> of membership. You understand that Jivetastic will not be held 
    	responsible for any injury caused in any manner and will not be responsible 
    	for the loss of any items at the Bowman Community Centre by whatever cause. </font></p>
        <p><font face="Arial">
    	<font size="2">
    	<input type="reset" name="reset" id="reset" value="Clear Form" />
    	</font>&nbsp;&nbsp;&nbsp;
    	<input type=submit value="Complete Registration">
        </font></p>
        <p><a name="1"></a><font face="Arial, Helvetica, sans-serif" color="#FF0000" size="2">1.  Please note that Jivetastic&copy; will not share personal information (including your email address) with ANY third party under any circumstance whatsoever.</font></p>
        </form>			
            </td>
        </tr>
        </table>
    
    <!-- MAIN CONTENT END -->
    
    <?php include('page_bottom.php'); ?>
    and this is the page which (i thinks) sends the info:

    Code:
    <?php include('page_top.php'); ?>
    <?php include('page_nav.php'); ?>
    <?php include('page_middle.php'); ?>			
            
    <!-- MAIN CONTENT
    
    This is a table that is maintained by the user.  See the commented out code below to make sure you set the paragraphs and cell attributes correctly.
    
    This is a row and cell for a subject heading
    <tr>
    		<td width="100%" align="center" valign="middle" bgcolor="#FF0000">
            	<b><font face="Arial" pointsize="12" color="#000000">Heading here</font></b>
            </td>
        </tr>
    
    This is the Sub Heading line
    <p style='word-spacing: 1px; margin-top: 0; margin-bottom: 0'>
    	<b><font face='Arial' color='#FFFF00'>Sub Heading Style</font></b></p>
        
    This is a normal paragraph line
    <p style="word-spacing: 1px; margin-top: 0; margin-bottom: 0">
    	<font face="Arial">Paragraph Style</font></p>
    -->
    
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    	<tr>
    		<td width="100%" height="20" align="center" valign="middle" bgcolor="#FF0000">
            	<b><font face="Arial" pointsize="12" color="#000000">Thanks For Registering</font></b>        </td>
        </tr>
        <tr>
    		<td width="100%" align="left" valign="top" bgcolor="#000000">
            	<p style="word-spacing: 1px; margin-top: 0; margin-bottom: 0">&nbsp;</p>
    	<?
    $sendable="yes";
    $to="info@jivetastic.co.uk";
    $subject="JIVETASTIC REGISTRATION";
    
    $fname = $_REQUEST["t_name1"];
    if($fname==""){
    	$sendable="no";
    }
    
    $surname=$_REQUEST["t_name2"];
    if($surname==""){
    	$sendable="no";
    }
    
    $email = $_REQUEST["email"];
    if($email==""){
    	$sendable="no";
    }
    
    $door=$_REQUEST["door"];
    if($door==""){
    	$sendable="no";
    }
    
    $street=$_REQUEST["street"];
    if($street==""){
    	$sendable="no";
    }
    
    $town=$_REQUEST["town"];
    if($town==""){
    	$sendable="no";
    }
    
    $county=$_REQUEST["county"];
    if($county==""){
    	$sendable="no";
    }
    
    $code=$_REQUEST["code"];
    if($code==""){
    	$sendable="no";
    }
    
    $htel=$_REQUEST["htel"];
    if($htel==""){
    	$htel="not supplied";
    }
    
    $wtel=$_REQUEST["wtel"];
    if($wtel==""){
    	$wtel="not supplied";
    }
    
    $hear=$_REQUEST["hear"];
    if($hear=="Select"){
    	$hear="not specified";
    }
    
    $attend=$_REQUEST["attend"];
    
    ini_set('sendmail_from', $email);
    $message = "This is a registration form for Jivetastic.\n\n 
    Name: $fname  $surname \n 
    Address: $door $street, $town, $county, $code. \n\n
    Home tel: $htel.  \n
    mob: $wtel.  \n\n
    I heard about you via: $hear.  \n\n";
    
    if($attend=="Yes") {
    	$message=$message."I have attended a modern jive class before.";
    }
    if($attend=="No") {
    	$message=$message."I have not attended a modern jive class before.";
    }
    if($attend=="Select") {
    	$message=$message."I have not answered the question about attending a modern jive class.";
    }
    			
    $headers =
    "From: $email .\n";
    "Reply-To: $email .\n";
    
    if ($sendable=="yes") {
    $sent = mail($to, $subject, $message, $headers);
    	if ($sent) {
    		echo("<p style='word-spacing: 1px; margin-top: 0; margin-bottom: 0'>
    	<b><font face='Arial' color='#FFFF00'>Thanks for registering.  Your membership card and details will be with you in the next few days.</font></b></p>");
    	} else {
    		echo("<p style='word-spacing: 1px; margin-top: 0; margin-bottom: 0'>
    	<b><font face='Arial' color='#FFFF00'>You didn't supply a valid email address.<p>Please press the back button on your browser and try again.</font></b></p>");
    	}
    } else {
    	echo("<p style='word-spacing: 1px; margin-top: 0; margin-bottom: 0'>
    	<b><font face='Arial' color='#FFFF00'>You didn't complete all of the mandatory fields.<p>Please press the back button on your browser and try again.</font></b></p>");
    }
    ?>
            </td>
        </tr>
        </table>
    
    <!-- MAIN CONTENT END -->
    
    <?php include('page_bottom.php'); ?>

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    I hate mails, they can fail for so many reasons. I'm looking at this line though:
    PHP Code:
    $headers =
    "From: $email .\n";
    "Reply-To: $email .\n"
    Thats not the correct way to format you're headers in PHP for sendmail. Reply-to isn't contained within the headers variable, and should be separated with a return newline.
    PHP Code:
    $headers "From: $email \r\n";
    $headers .= "Reply-To: $email \r\n"
    Other than that it looks ok. Might want to keep en eye out for <? and replace them with <?php - shorttags are not recommended since only some servers configure them for use. I don't recommend using _REQUEST since it includes cookies, but you should also check for the existence of the variable before using it with isset.

    It is possible that they queue their mail up for batch sending every x minutes instead of immediately. Its also possible that the configurations have changed for their sendmail_path which you can check with ini_get('sendmail_path'). If its empty, you've got to contact them to inform them that their sendmail has not been configured - I'm quite certain you cannot configure the sendmail path in anything below the ini script.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #5
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks very much. I replaced <? with <?PHP and changes the /r /n bit and hey presto it works perfect!

    Much appreciated!

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Glad to hear it worked. I would have been very annoying if it was a configuration issue
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #7
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a similar problem caused by the same thing host upgraded to php5 and cant help me fix the email form.
    It is a slightly modified clankit application form. clankit are no longer and I am having a problem finding anyone that can offer advise with php forms.

    Code:
    <?PHP
    $EmailTo = "me@hotmail.com";
    $Subject = "Maverick Renegades Recruitment Form from $FirstName\n";
    $Name = $_POST['FirstName'];
    $RealName = $_POST['RealName'];
    $GamerName = $_POST['GamerName'];
    $Age = $_POST['Age'];
    $Location = $_POST['Location'];
    $EmailAddress = $_POST['EmailAddress'];
    $Hours = $_POST['Hours'];
    $Clans = $_POST['Clans'];
    $Practices = $_POST['Practices'];
    $Weapon = $_POST['Weapon'];
    $Vehicle = $_POST['Vehicle'];
    $About = $_POST['About'];
    $Pay = $_POST['Pay'];
    $Where = $_POST['Where'];
    $WhyJoin = $_POST['WhyJoin'];
    $CodeofConduct = $_POST['CodeofConduct'];
    
    $App = "RealName: $RealName\n GamerName: $GamerName\n Age: $Age\n Location: $Location\n EmailAddress: $EmailAddress\n Hours spent online per week: $Hours\n Other Clans: $Clans\n Will you be able to attend practices? $Practices\n Your favorite weapon?: $Weapon\n Your favorite vehicle: $Vehicle\n About yourself: $About\n Would you help pay for a server?: $Pay\n Where did you hear about =MR=?: $Where\n $WhyJoin\n CodeofConduct: $CodeofConduct\n IP Address: {$_SERVER['REMOTE_ADDR']}";
    mail($EmailTo,$Subject,$App,"From: $EmailAddress\n");
    ?>PHP
    <html>
    <head>
    <title>MaverickReneades</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body bgcolor="#999999">
    <table width="100%" border="1">
      <tr> 
        <td width="40%"><p align="center"><strong><img src="http://www.maverickrenegades.com/images/clanimages/400.jpg"></strong></p></td>
        <td width="60%">
    <p align="center"><strong><font color="#FF0000">Success</font> 
            you have just applied for =MR= Clan Membership</strong></p>
          <p align="center"><strong>Please be patient as we process your application</strong></p>
          <p align="center"><strong>You will be notified by email upon our decision</strong></p>
          <p align="center"><strong>Until then please register for our <a href="http://www.maverickrenegades.com/modules.php?name=Your_Account&op=new_user">public 
            forums</a></strong></p>
          <p align="center"><strong>Thankyou.</strong></p>
          <p align="center"><img src="http://maverickrenegades.com/images/clanimages/serverlogo.bmp"></p></td>
      </tr>
    </table>
    <p align="center">&nbsp;</p>
    <p align="center">&nbsp;</p>
    <p align="center">&nbsp;</p>
    <div align="center">
      <p>&nbsp;</p>
    </div>
    </body>
    </html>
    Code:
    <?
    include("header.php");
    OpenTable();
    ?><head>
    <title>ClanKit Recruitment Form</title>
    
    <left>
    	  <style type="text/css">
    <!--
    a:link {
    	text-decoration: none;
    	color: #666666;
    }
    a:visited {
    	text-decoration: none;
    	color: #666666;
    }
    a:hover {
    	text-decoration: none;
    	color: #FFFFFF;
    }
    a:active {
    	text-decoration: none;
    	color: #666666;
    }
    .style31 {
    	font-size: 12px;
    	font-family: Arial, Helvetica, sans-serif;
    	color: #C0C0C0;
    }
    .style32 {
    	font-family: Arial, Helvetica, sans-serif;
    	color: #C0C0C0;
    }
    .style33 {color: #C0C0C0}
    .style34 {font-family: Arial, Helvetica, sans-serif; font-size: 12px;}
    .style37 {
    	font-family: "Courier New", Courier, mono;
    	font-size: 24px;
    	font-weight: bold;
    }
    -->
          </style>
    	  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                <p class="style31"><span class="style37">RECRUITMENT FORM</span><br>
                  <br>
                  <strong>Welcome soldier! you are interested in joining our clan then please fill out<br> 
                this application form
                and submit it, we will get back to you as soon as<br>
                possible and in the meantime you can
                check out the forums.<br>
            Thank you. </strong> </p>
                <span class="style31"><left>
    	        </left><left></left><left></left><left></left><left></left><left></left><left></left></span><span class="style32"><left></left></span><span class="style33"><left></left><left></left></span><left><form action="apply.php" method="post" name="Application" class="style33">
                  <div align="left>" class="style34">
          Real Name: 
              <input name="RealName" type="text" value="" size="15">
          Gaming Name: 
          <input name="GamerName" type="text" size="15">
          <br>
          Age:
          <input name="Age" type="text" size="2">
          <br>
          Location:
          <input name="Location" type="text" size="15">
          <br> 
          Email Address:
          <input name="EmailAddress" type="text" size="30">
          Hours spent online per week:
          <input name="Hours" type="text" size="15">
          <br>
          <br>
          If you have been in a clan before, please list all of the<br> 
          ones you were in and the reason why you left them:<br>
          <textarea name="Clans" cols="50" rows="3" textarea="textarea"></textarea>
          <br>
          <br>
          Will you be able to attend practices and matches when scheduled?:
              <select name="Practices">
                            <option selected>------------------</option>
                                <option>Yes</option>
                                <option>I'll do my best to be there</option>        
                                <option>Maybe not</option>
                                <option>No</option>
              </select>
              <br>
              <br>
        Your favorite weapon?:
        <input name="Weapon" type="text" size="20">
        Your favorite vehicle?:
        <input name="Vehicle" type="text" size="20">
        <br>
        <br>
        <br>
        Please explain a little about yourself, when you are normally online,<br>
        when you can get a microphone (If you dont already have one) and anything<br>
        else you would like to inform us:<br>
        <textarea name="About" cols="50" rows="3" textarea="textarea"></textarea>
        <br>
        <br>
          Would you help pay for a server?: 
                <select name="Pay">
                  <option selected>------------------</option>
                  <option>Yes</option>
                  <option>No</option>
                </select>
                <br>
                <br>
          Where did you hear about =MR=?<br>
          <textarea name="Where" cols="50" rows="3" textarea="textarea"></textarea>
          <br>
    
          And finally....<br>
          <br> 
          Code of Conduct Verification:
          <input name="CodeofConduct" type="text" size="30">
          <br>
          <br>
          <input name="Submit" type="submit" value="Submit Recruitment Form">
                  </div>
    	        </form>
    	        <span class="style31">Powered by <a href="www.clankit.bravoclan.com">ClanKit&trade;</a><br>
    	        </span></left>
                    <span class="style31">
    </div>
    </body>
    </html>
    <?
    CloseTable();
    include("footer.php");
    ?>
                    </span>
    you can see the form in action here


    Any help is appreciated.

  • #8
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    This should really be a new thread, but thats ok. Try changing the mail function to add a crlf instead of just a lf.
    mail($EmailTo,$Subject,$App,"From: $EmailAddress\r\n");. Next would be to wrap the mail in an if:
    Code:
    if (!mail($EmailTo,$Subject,$App,"From: $EmailAddress\r\n"))
    {
        die("Could not send mail.");
    }
    Enabling you're error reporting:
    Code:
    ini_set('display_errors', 1);
    error_reporting(E_ALL);
    may provide you with more specific information. If all of the above fail to provide the cause of the problem it is likely a configuration issue with you're ini file.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #9
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    This should really be a new thread, but thats ok. Try changing the mail function to add a crlf instead of just a lf.
    mail($EmailTo,$Subject,$App,"From: $EmailAddress\r\n");. Next would be to wrap the mail in an if:
    Code:
    if (!mail($EmailTo,$Subject,$App,"From: $EmailAddress\r\n"))
    {
        die("Could not send mail.");
    }

    This just brings up Could not send mail.


    Enabling you're error reporting:
    Code:
    ini_set('display_errors', 1);
    error_reporting(E_ALL);
    may provide you with more specific information. If all of the above fail to provide the cause of the problem it is likely a configuration issue with you're ini file.

    Where is this done?

  • #10
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Error reporting generally goes at the top. The mail wrapper goes wherever you're mail command is.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

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