![]() |
|
#1
|
|||
|
|||
Sessions QuestionHi, I'm working on a project for a mortgage site where I'm using a session to hold session variables as the client navigates from page to page. The problem is not capturing the clients info, the problem is...
1. Sending the info via e-mail to an administrator. 2. Adding the submitted info to a database. (Not yet there!) Also, I'm using Smarty. FYI This is how I have it all set up. <Php Files> index.php step2.php step3.php step4.php thankyou.php <Template files> The same as above, but include header.tpl and footer.tpl. In index.php I have the following code for starting the session. Code:
NOW! -My form handling script goes like this.- PHP Code:
Now every time I try to run this script with out sending the e-mail it works the way it should. It takes me from page to page registering all the session variables. But when I add the send e-mail function to process the information I get this: Error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /Users/littleome/Sites/mysite.com/form.php on line 2 Clould someone assist with this. I have no Idea why it gives me an error. Or advise if there is a better method to do the same thing. Thanks! Last edited by admin : 03-Jan-2006 at 06:34.
Reason: Please insert your PHP code between [php] & [/php] tags
|
|||
|
#2
|
||||
|
||||
Re: Sessions QuestionFirst, the session codes -- the following line contains mismatched quotes:
Code:
and should really be: PHP Code:
In the second example, you have your quotes messed up again (see comments starting with "Edited by Admin:"): PHP Code:
|
|
#3
|
|||
|
|||
Re: Sessions QuestionHi, Admin! Thanks for the reply. I updated the script to what you edited. I added
an mail(); function with variables to process when the submit_4 is pressed, but it still doesn't work. I may have missed an (') or two. New edited script. Could you see whats wrong! <? //Headers if(isset($_POST['submit_1'])) { header("Location: step2.php"); exit; } elseif(isset($_POST['submit_2'])) { header("Location: step3.php"); exit; } elseif(isset($_POST['submit_3'])) { header("Location: step4.php"); exit; } elseif(isset($_POST['submit_4'])) { header("Location: thankyou.php"); exit; } else { echo "There has been a problem procession your request. Please report this problem to the site administrator at <a href='mailto:administrator@somewhere.com'> Site Admin</a>"; } //send email function # Email to Function function sendemail() { // Edited by Admin: escape the ' $emailTo = '"Javier Lopez" <jalopez13@yahoo.com>'; $emailSubject = "Mortgage Quote"; // Edited by Admin: used curly braces... $emailHeader = "From: {$_SESSION['email']}\n" . "Reply-To: {$_SESSION['email']}\n" . "MIME-Version: 1.0\n" . "Content-type: text/plain; charset=\"ISO-8859-1\"\n" . "Content-transfer-encoding: quoted-printable\n"; $emailBody = ":................................................ ..................................:" ."Mortgage Quote Request" "\n" ."<h3>Contact Information</h3>" . "\n" . "First Name:............................................. ......................: $_POST['first_name']" . "Last Name:............................................. ......................: $_POST['last_name']" . "Address:......................................... .............................: $_POST['address']" . "City:............................................ ...............................: $_POST['city']" . "State:........................................... ..............................: $_POST['stateCode']" . "Zip Code:............................................. ........................: $_POST['zipcode']" . "Preferred Number:........................................... ...............: $_POST['day_npa'].$_POST['day_nxx'].$_POST['day_station'].$_POST['day_ext']" . "Alternate Number:........................................... ...............: $_POST['eve_npa'].$_POST['eve_nxx'].$_POST['eve_station']" . "Email:........................................... ..............................: $_POST['email']" . " Best Time to Call:............................................. .............: $_POST['BestTime']" . "\n" . "<h3>Property Information</h3>" . "\n" . "Subject Property State:............................................ .......: $_POST['propertyStateCode']" . "Subject Description:...................................... ..................: $_POST['propertyDesc']" . "Credit Rating:........................................... ....................: $_POST['credit_rating']" . "Loan Type:............................................. .....................: $_POST['typeOfLoan']" . "Loan Purpose:.......................................... ....................: $_POST['refi_purpose']" . "Property Purchased:........................................ ..............: $_POST['homepurchaseyear']" . "Estimate Value:............................................ ................: $_POST['home_value_preset']" . "Other Value:............................................ ...................: $_POST['home_value_other']" . "Mortgage Balance:.......................................... ..............: $_POST['mortgage1_balance']" . "Current Rate:............................................. ................: $_POST['m1IrDDa'].$_POST['m1IrDDb']" . "Mortgage Type:............................................. ..............: $_POST['mortgageRateType']" . "Second Mortgage:......................................... ...............: $_POST['second_mortgage']" . "2nd Current Balance:.......................................... ...........: $_POST['mortgage2_balance']" . "Current Rate:............................................. .................: $_POST['m2IrDDa'].$_POST['m2IrDDb']" . "\n" . "Income Incormation" . "\n" . "Annual Income:........................................... .................: $_POST['annualIncome']" . "Occupation:...................................... ..........................: $_POST['occupational_status']" . "Est. Monthly debt:............................................. ...........: $_POST['monthlyDebtPayments']" . " Bankruptcy:....................................... ........................: $_POST['bankruptcy']" . "\n" ; mail($emailTo, $emailSubject, $emailBody, $emailHeader); } if(isset($_SESSION['submit_4'])) { sendemail(); } ?> Thanks for you help! |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| non-member function question | crq | C++ Forum | 1 | 03-Feb-2005 22:59 |
| Simple question on arrays--please help! | brookeville | C++ Forum | 16 | 18-Nov-2004 00:23 |
| Repetition structure problem and question | brookeville | C++ Forum | 17 | 29-Oct-2004 18:48 |
| question of practice | magiccreative | C++ Forum | 1 | 06-Feb-2004 08:17 |
| a C input question | tmike | C Programming Language | 1 | 16-Sep-2003 03:31 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The