Jump to content

email parse error


Ninjakreborn

Recommended Posts

This isn't working, I am just wondering if theres any errors in the code, it is just having different errors
The form is below, that processor and validator below that.
I have done this once, but now with checkboxes and radio buttons, and it's not passing through.
[code]
<form onsubmit="return submitcheckproject()" name="projectinformation" action="../cgi-bin/form-processors/projectinformationprocessor.php" method="post">
<fieldset class="formstyle">
<legend>Project Information</legend><br />
<label for="firstname" accesskey="f">*First Name:</label><br />
<input tabindex="1" name="firstname" id="firstname" type="text" maxlength="30" /><br />
<label for="lastname" accesskey="l">*Last Name:</label><br />
<input tabindex="2" name="lastname" id="lastname" type="text" maxlength="30" /><br />
<label for="age" accesskey="2">Age:</label><br />
<input tabindex="3" name="age" id="age" type="text" maxlength="3" /><br />
*Sex:<br />
<label for="male"><input name="sex[]" id="male" type="radio" value="male" checked="checked" />Male</label>
<br />
<label for="female"><input name="sex[]" id="female" type="radio" value="female" />
Female</label><br />
<label for="operatingsystem">*Operating System</label><br />
<select name="operatingsystem[]" id="operatingsystem">
<option>Unix</option>
<option>Windows</option>
<option>Linux</option>
<option>MacOs</option>
<option>Other</option>
<option>Don't Know</option>
<option>Not Application</option>
</select><br />
<label for="serverside">*Server Side</label><br />
<select name="serverside" id="serverside">
<option>Java Server Pages/jsp</option>
<option>Hypertext Preprocessor/PHP</option>
<option>Active Server Pages/ASP</option>
<option>Cold Fusion/CF</option
<option>Server Side Javascript</option>
<option>Other</option>
<option>Unknown</option>
<option>Not Applicable</option>
</select><br />
*Does Your website have/will have a database:<br />
<label for="yes"><input name="database[]" id="yes" type="radio" />Yes</label><br />
<label for="no"><input name="database[]" id="no" type="radio" checked="checked" />No</label><br />
<label for="databasetype">*What database server:</label><br />
<input name="databasetype" id="databasetype" type="text" maxlength="80" /><br />
<label for="emailaddress" accesskey="e">*Email Address:</label><br />
<input tabindex="4" name="emailaddress" id="emailaddress" type="text" maxlength="80"  /><br />
<label for="verifyemail" accesskey="v">*Verify Email:</label><br />
<input tabindex="5" name="verifyemail" id="verifyemail" type="text" maxlength="80" />
<br />
<label for="computerknowledge" accesskey="c">*How much do you know about computers in general:</label>
<br />
<input tabindex="6" name="computerknowledge" id="computerknowledge" type="text" maxlength="80" />
<br />
<label for="languageknowledge" accesskey="l">*Put the computer languages you know, with your level of experience in each one:</label><br />
<input tabindex="7" name="languageknowledge" id="languageknowledge" type="text" maxlength="80" />
<br />
*Is there a deadline associated with this project:<br />
<label for="yes"><input name="deadline[]" id="yes" type="radio" value="yes" />Yes</label><br />
<label for="no"><input name="deadline[]" id="no" type="radio" value="no" checked="checked" />No</label><br />
<label for="timelimit">*If so what is the time limit, if not applicable, just put none:</label><br />
<input tabindex="8" name="timelimit" id="timelimit" type="text" maxlength="30" /><br />
<label for="projectrelation" accesskey="t">*What is the project related too:</label><br />
<input name="projectrelation" id="projectrelation" type="text" maxlength="80" /><br />
<label for="description" accesskey="d">*Description:</label><br />
<textarea tabindex="9" name="description" id="description" rows="6" cols="30">
</textarea><br />
<input tabindex="10" name="submit" id="submit" type="submit" value="submit" />
<input tabindex="11" name="reset" id="reset" type="reset" value="reset" />
</fieldset>
</form>
[/code]
Below is the
processor and validater

[code]
<?php
if ($_POST['firstname'] == ""){
print("Please go back and fill in the first name field correctly");
}elseif ($_POST['lastname'] == ""){
print("Please go back and fill in the last name field correctly");
}elseif ($_POST['age'] == ""){
print("Please go back and fill in the Age field");
}elseif ($_POST['databasetype'] == ""){
print("Please go back and fill in the Database Type Field");
}elseif ($_POST['emailaddress'] == ""){
print("Please go back and fill in the Email Address field");
}elseif ($_POST['verifyemail'] == ""){
print("Please go back and fill in the Verify Email Address field");
}elseif ($_POST['emailaddress'] != $_POST['verifyemail']){
print("Your email Address fields DO NOT match, please correct this");
}elseif ($_POST['computerknowledge'] == ""){
print("Please go back and fill in the computer knowledge field");
}elseif ($_POST['languageknowledge'] == ""){
print("Please go back and fill in the Language Knowledge field");
}elseif ($_POST['timelimit'] == ""){
print("Please go back and fill in the Time Limit field");
}elseif ($_POST['projectrelation'] == ""){
print("Please go back and fill in the project relation field");
}elseif ($_POST['description'] == ""){
print("Please go back and fill in the Description field");
}else {
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$age = $_POST['age'];
$databasetype = $_POST['databasetype'];
$emailaddress = $_POST['emailaddress'];
$verifyemail = $_POST['verifyemail'];
$computerknowledge = $_POST['computerknowledge'];
$languageknowledge = $_POST['languageknowledge'];
$timelimit = $_POST['timelimit'];
$projectrelation = $_POST['projectrelation'];
$description = $_POST['description'];
$to = "businessman332211@hotmail.com";
$subject = "Project Information";
$message = "
First Name: $firstname
Last Name: $lastname
Age:"
$message .= "implode(', ',$_POST['sex']);
Operating System:" $message .= "implode(', ',$_POST['operatingsystem']);
Server Side:" $message .= "implode(', ',$_POST['serverside']);
Database Type: $databasetype";
$message .= "implode(', ',$_POST['database']);
Email Address: $emailaddress
Verify Email: $verifyemail
Computer Knowledge: $computerknowledge
Language Knowledge: $languageknowledge";
$message .= "implode(', ',$_POST['deadline']);
Time Limit: $timelimit
Project Relation: $projectrelation
Description: $description
";

if(mail($to, $subject, $message)) {
print("Thank you for submitting your email has been successfully sent");
print("<br />Return to the homepage at <a href='http://www.freelancebusinessman.com'>Freelance Businessman</a>");
}else{
print("I am sorry but there was some sort of error and the email could not be sent");
print("<br />I am not totally sure of the cause of this error.");
print("<br />Please return to <a href='http://www.freelancebusinessman.com'>Freelance Businessman</a>");
print("<br />If you try again and recieve this error message a second time, then please email me at the original email address and notify me of this error, so it can be checked into.  Thank you for visiting Freelance Businessman.");
}
}
?>
[/code]
any help would be appreciated, I have 1 hour left to work, thanks.
Link to comment
Share on other sites

Just saying "This isn't working" is not really helpful. Explain exactly what is wrong when you post a problem.

[code]$message = "
First Name: $firstname
Last Name: $lastname
Age:"[/code]
It's missing the closing ;

Take a look at whatever error messages you are getting. They always point the way to solving the mistake.
Link to comment
Share on other sites

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/freelan4/public_html/cgi-bin/form-processors/projectinformationprocessor.php on line 51

that is one of them. My problem is, I don't know how to "hardwire" something into a variable, I had the message right, but when I started adding in the extra fields like the radio buttons and select boxes, it started having errors, I don't know where to put those /n's and . and " and all that stuff. I have problems before some people throw in some punctuation marks and all of a sudden BOOM it works, no problem. But when I try to do it, it always messes up.
Link to comment
Share on other sites

I should have said "tell us what the error is AND identify the line in any posted code" otherwise this is simply transferring your work off to the people on this board. You have all the information, we're left to guess and the end result is people will move along to easier/better-defined problems/posts.

'hardwiring' - sorry don't understand; can't help.

. is the concatenation operator. It's used to add strings together. \n inside a string will generate a 'newline' in the message. Work with that and sort out your basics first.
Link to comment
Share on other sites

First of all hardwiring is specifically the way I talk.
Second of all I wasn't asking someone to do the script for me, I did the whole thing myself, all I was asking for was a little help understand understanding where to put newline characters and other punctuation, and I specified the areas, the places that you add in stuff to the message, with the implode, to all the different sections of message, I wanted to be able to put in the radio buttons, and select boxes, so I can see it in the email, I am having a hard time "hardwiring" it into the message.
Link to comment
Share on other sites

Change this:[code]$message = "
First Name: $firstname
Last Name: $lastname
Age:"
$message .= "implode(', ',$_POST['sex']);
Operating System:" $message .= "implode(', ',$_POST['operatingsystem']);
Server Side:" $message .= "implode(', ',$_POST['serverside']);
Database Type: $databasetype";
$message .= "implode(', ',$_POST['database']);
Email Address: $emailaddress
Verify Email: $verifyemail
Computer Knowledge: $computerknowledge
Language Knowledge: $languageknowledge";
$message .= "implode(', ',$_POST['deadline']);
Time Limit: $timelimit
Project Relation: $projectrelation
Description: $description
";[/code]to:[code]$message = "
First Name: $firstname
Last Name: $lastname
Age:" . implode(', ',$_POST['sex']) . "
Operating System:" . implode(', ',$_POST['operatingsystem']) . "
Server Side:" . implode(', ',$_POST['serverside']) . "
Database Type: $databasetype";

$message .= implode(', ',$_POST['database']) . "
Email Address: $emailaddress
Verify Email: $verifyemail
Computer Knowledge: $computerknowledge
Language Knowledge: $languageknowledge";

$message .= implode(', ',$_POST['deadline']) . "
Time Limit: $timelimit
Project Relation: $projectrelation
Description: $description";[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.