943,655 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2395
  • PHP RSS
You are currently viewing page 5 of this multi-page discussion thread; Jump to the first page
Feb 28th, 2009
0

Re: PHP

i post my code , can u check it..
Reputation Points: 6
Solved Threads: 0
Junior Poster in Training
rohnni is offline Offline
58 posts
since Feb 2009
Feb 28th, 2009
0

Re: PHP

shouldn't your code be like this:
php Syntax (Toggle Plain Text)
  1. if(isset($_COOKIE['tntcon'])){
  2. // if verification code was correct send the message and show this page
  3. mail("you@email.com", 'Online Form: '.$subject, $_SERVER['REMOTE_ADDR']."\n\n".$message, "From: $from");
  4. // delete the cookie so it cannot sent again by refreshing this page
  5. setcookie('tntcon','',time()-1800);
  6. } else {
  7. // if verification code was incorrect then return to contact page and show error
  8. header("Location:".$_SERVER['HTTP_REFERER']."?subject=$subject&from=$from&message=$message&wrong_code=true");
  9. exit;
  10. }
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Feb 28th, 2009
0

Re: PHP

Notice: Undefined variable: subject in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\requirements-form\mail.php on line 16

Notice: Undefined variable: message in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\requirements-form\mail.php on line 16

Notice: Undefined variable: from in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\requirements-form\mail.php on line 16

Warning: mail() [function.mail]: SMTP server response: 554 <you@email.com>: Recipient address rejected: Relay access denied in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\requirements-form\mail.php on line 16

Notice: Undefined variable: subject in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\requirements-form\mail.php on line 20

Notice: Undefined variable: message in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\requirements-form\mail.php on line 20

Notice: Undefined variable: from in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\requirements-form\mail.php on line 20

Warning: mail() [function.mail]: SMTP server response: 554 <you@email.com>: Recipient address rejected: Relay access denied in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\requirements-form\mail.php on line 20
Thanks - Email Send - Done
Reputation Points: 6
Solved Threads: 0
Junior Poster in Training
rohnni is offline Offline
58 posts
since Feb 2009
Feb 28th, 2009
0

Re: PHP

Again you need the following at the top of your page:
php Syntax (Toggle Plain Text)
  1. error_reporting(E_ALL ^ E_NOTICE);
And also make sure there is a valid email address in the email function.
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Mar 1st, 2009
0

Re: PHP

hi...
can anyone tell me how to print title on every page.. i want to recieve a title of everypage but only in email that titile only will display on my email that i will get not anywhere else....
Reputation Points: 6
Solved Threads: 0
Junior Poster in Training
rohnni is offline Offline
58 posts
since Feb 2009
Mar 1st, 2009
0

Re: PHP

Are you talking about the email title/subject or webpage titlebar? Below is an example of both cases:
php Syntax (Toggle Plain Text)
  1. mail($1, $title, $3); //mail title
  2. echo "<head><title>$title</title></head>";//html title bar
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Mar 1st, 2009
0

Re: PHP

u know i m using 5 html forms so i want when i will get the output of 5 pages on my email how can i identify which ifromation is realted to which form thats y i need to display a title that will breakup the pages like :-
YOUR DETAILS(title)

title : MR
name :
lname :
address : LONDON
pin :
country : UK
contact :
email :


YOUR BUSINESS(title)

business :
type :
product :
staff : UJFYHDD
checkbox : a
checkbox2 :
checkbox3 : c
checkbox4 :
checkbox5 : e

YOUR WEBSITE(title)

radio : 1
color : 1
webpage : NA
hosting : 1
account :
web1 : HTTP://WWW.YAHOO.COM
like :
web2 : HTTP://WWW.YAHOO.COM

like2 :
brand : 1
images : 1
text : 1

lang : 0

want to display like above..any idea?
Reputation Points: 6
Solved Threads: 0
Junior Poster in Training
rohnni is offline Offline
58 posts
since Feb 2009
Mar 1st, 2009
0

Re: PHP

Simply add them manually (script wise) to the $message variable. If you like, you can post what you have assigned to the $message variable and I shall correct it to the above design for you!
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Mar 1st, 2009
0

Re: PHP

php Syntax (Toggle Plain Text)
  1. <?php
  2. $body = "";
  3. foreach($_POST as $key => $value) {
  4. $body .= "$key : $value \n";
  5. }
  6. mail("yourmail.com", "Enquiry", $body, "From: [email]webmaster@yahoo.co.uk[/email]");
  7.  
  8.  
  9. ?>
Thanks - Email Send - Done

this is my final script that get information from all 5 html forms
where i put $mesaage?
Last edited by peter_budo; Mar 1st, 2009 at 6:48 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 6
Solved Threads: 0
Junior Poster in Training
rohnni is offline Offline
58 posts
since Feb 2009
Mar 1st, 2009
0

Re: PHP

below is a way of assigning each value to the variable but replace the term html_field_name with the name of the html field.
php Syntax (Toggle Plain Text)
  1. $message="YOUR DETAILS
  2.  
  3. title : ".$_SESSION['html_field_name']."
  4. name : ".$_SESSION['html_field_name']."
  5. lname : ".$_SESSION['html_field_name']."
  6. address : ".$_SESSION['html_field_name']."
  7. pin : ".$_SESSION['html_field_name']."
  8. country : ".$_SESSION['html_field_name']."
  9. contact : ".$_SESSION['html_field_name']."
  10. email : ".$_SESSION['html_field_name']."
  11.  
  12.  
  13. YOUR BUSINESS
  14.  
  15. business : ".$_SESSION['html_field_name']."
  16. type : ".$_SESSION['html_field_name']."
  17. product : ".$_SESSION['html_field_name']."
  18. staff : ".$_SESSION['html_field_name']."
  19. checkbox : ".$_SESSION['html_field_name']."
  20. checkbox2 : ".$_SESSION['html_field_name']."
  21. checkbox3 : ".$_SESSION['html_field_name']."
  22. checkbox4 : ".$_SESSION['html_field_name']."
  23. checkbox5 : ".$_SESSION['html_field_name']."
  24.  
  25. YOUR WEBSITE
  26.  
  27. radio : ".$_SESSION['html_field_name']."
  28. color : ".$_SESSION['html_field_name']."
  29. webpage : ".$_SESSION['html_field_name']."
  30. hosting : ".$_SESSION['html_field_name']."
  31. account : ".$_SESSION['html_field_name']."
  32. web1 : ".$_SESSION['html_field_name']."
  33. like : ".$_SESSION['html_field_name']."
  34. web2 : ".$_SESSION['html_field_name']."
  35.  
  36. like2 : ".$_SESSION['html_field_name']."
  37. brand : ".$_SESSION['html_field_name']."
  38. images : ".$_SESSION['html_field_name']."
  39. text : ".$_SESSION['html_field_name']."
  40.  
  41. lang : ".$_SESSION['html_field_name'];

Also if that doesn't work, make sure the following code is in tack on all pages that receive the $_POST.
php Syntax (Toggle Plain Text)
  1. foreach($_POST AS $keyzz => $valzz) {
  2. $_SESSION[$keyzz]=$valzz;
  3. }
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Contact form
Next Thread in PHP Forum Timeline: Pizza ordering system





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC