Re: [WSG] PHP Help Again

2011-12-17 Thread Russ Weakley
Ok, as many have suggested, these discussions are definitely off topic. 

Marvin, please confine posts to web standards related topics 

Everyone else, if replying, do it offlist. 

Apologies all for the recent lack of list management!

Thanks
Russ

On 17/12/2011, at 6:50 PM, Marvin Hunkin startrekc...@gmail.com wrote:

 Hi.
 could david please let me know if he received my e-mails the other day.
 if not, then will paste the following message.
 if any one can help me off list.
 Thanks.
 Marvin.
 
 Hi.
 well sorry, forggot about that.
 well if any one can help me with my smtp, and also using windows 7 
 professional 32 bit, and using wamp server 2.2, and using mozilla thunderbird 
 as my mail client.
 also, how to format the message.
 can any one help?
 will paste my html form and the php code and the mozilla firefox browser 
 window below.
 Marvin.
 
 html
 head
 titleStudent Details/title
 /head
 body
 h1Parents And Citizens Student School Survey/h1
 form action=Data.php method=post
 pFirstname: input type=text name=firstname/p
 pLastname: input type=text name=lastname/p
 pDate Of Birth: input type=text name=dateofbirth/p
 pCurrent Year At School: input type=text name=currentyear/p
 pNumber Of Siblings: input type=text name=familynumber/p
 pHome Work: input type=text name=homework/p
 pEntertainment: input type=text name=entertainment/p
 pComputer: input type=text name=computer/p
 pFamily: input type=text name=family/p
 pFriends: input type=text name=friends/p
 input type=submit name=submit value=Submit
 /form
 /body
 /html
 
 ?php
 $firstname=$_POST['firstname'];
 $lastname=$_POST['lastname'];
 $dateofbirth=$_POST['dateofbirth'];
 $currentyear=$_POST['currentyear'];
 $familynumber=$_POST['familynumber'];
 $homework=$_POST['homework'];
 $entertainment=$_POST['entertainment'];
 $computer=$_POST['computer'];
 $family=$_POST['family'];
 $friends=$_POST['friends'];
 $subject=$_POST['$subject'];
 $message=$_POST['$message'];
 echo h1Student Details:/h1;
 echo pGreat! Thanks .$firstname. for responding to our survey./p;
 echo pName: .$firstname. $lastname/p;
 echo pDate Of Birth: $dateofbirth/p;
 echo pCurrent School Year: $currentyear/p;
 echo pNumber Of Siblings: $familynumber/p;
 echo p Subject: $subject = '$firstname, $lastname survey results'/p;
 echo pMessage: $message = '$firstname, $lastname, $dateofbirth, 
 $currentyear, $familynumber, $homework, $entertainment, $computer, $family, 
 $friends'/p;
 $to='startrekc...@gmail.com';
 $subject = $firstname, $lastname;
 mail($to, $subject, $message);
 ?
 
 http://localhost/SixthPHP/Data.php
 
 table with 5 columns and 4 rows
 ( ! ) Notice: Undefined index: $subject in C:\wamp\www\SixthPHP\Data.php on 
 line 12
 Call Stack
 #
 Time
 Memory
 Function
 Location
 1
 0.0006
 379792
 {main}( )
 ..\Data.php:0
 table end
 
 table with 5 columns and 4 rows
 ( ! ) Notice: Undefined index: $message in C:\wamp\www\SixthPHP\Data.php on 
 line 13
 Call Stack
 #
 Time
 Memory
 Function
 Location
 1
 0.0006
 379792
 {main}( )
 ..\Data.php:0
 table end
 
 Student Details:
 
 Great! Thanks Marvin for responding to our survey.
 
 Name: Marvin Hunkin
 
 Date Of Birth: 13/02/1965
 
 Current School Year: 12
 
 Number Of Siblings: 3
 
 Subject: = 'Marvin, Hunkin survey results'
 
 Message: = 'Marvin, Hunkin, 13/02/1965, 12, 3, 30, 88, 95, 33, 102'
 
 table with 5 columns and 5 rows
 ( ! ) Warning: mail() [
 function.mail]:
 Failed to connect to mailserver at localhost port 25, verify your SMTP 
 and smtp_port setting in php.ini or use ini_set() in 
 C:\wamp\www\SixthPHP\Data.php
 on line 24
 Call Stack
 #
 Time
 Memory
 Function
 Location
 1
 0.0006
 379792
 {main}( )
 ..\Data.php:0
 2
 0.0013
 380832
 mail
 ( )
 ..\Data.php:24
 table end
 
 ps: so how to fix the problems, maybe how to get the date for say Febuary 13, 
 1965, can any one help me out. maybe e-mail me off list via 
 startrekc...@gmail.com if not on topic.
 --- In blindwebb...@yahoogroups.com, Parham Doustdar parham90@... wrote:
 
 Marvin,
 
 You cannot attach files to your emails when you're sending an email to
 this list. But regardless of your code:
 
 1. Setting up your SMTP is not a PHP issue, it depends on your operating
 system.
 2. I expect you're using Windows. As far as I know, there is not an easy
 solution about running an SMTP server on Windows. What I did was to find
 someone who would let me play with the SMTP server running on his Linux box.
 
 But of course, if anyone has done this on Windows, I'd appreciate it if
 they could step forward and help you.
 
 Good luck,
 Parham
 
 On 12/16/2011 2:27 PM, Marvin Hunkin wrote:
 
 Hi.
 can some one help me to set up my smtp.
 also, not liking some of my variables.
 new to php and learning this.
 can any one help me to get the script working, and also to format it.
 i need to havea e-mail message in the form, and also need headings, or
 information or labels for each of the information.
 can any one help me?
 will atatch my code, a html file and my php script.
 

Re: [WSG] PHP Help Again

2011-12-17 Thread Fabien BENARIAC

Sorry for intrusion... but I think you have a bug with 
$subject=$_POST['$subject'];
$message=$_POST['$message']; 

You have no subject and message variable posted with your form and 
$_POST['$subject'] isn't php valid synthax (quoted variable???).


Your php error message just told you that php doesn't know what you mean 
by $subject and $message just because he don't find them in your code 
before to use it (well he found a buggy stuff).


Try to replace $subject=$_POST['$subject']; 
$message=$_POST['$message']; by '$subject = Testing email; $message = 
This is a test email message!;'. This can help you to test your 
installation if you needed to.


good luck!
Fabien.

Le 17/12/11 08:50, Marvin Hunkin a écrit :

Hi.
could david please let me know if he received my e-mails the other day.
if not, then will paste the following message.
if any one can help me off list.
Thanks.
Marvin.

Hi.
well sorry, forggot about that.
well if any one can help me with my smtp, and also using windows 7 
professional 32 bit, and using wamp server 2.2, and using mozilla 
thunderbird as my mail client.

also, how to format the message.
can any one help?
will paste my html form and the php code and the mozilla firefox 
browser window below.

Marvin.

html
head
titleStudent Details/title
/head
body
h1Parents And Citizens Student School Survey/h1
form action=Data.php method=post
pFirstname: input type=text name=firstname/p
pLastname: input type=text name=lastname/p
pDate Of Birth: input type=text name=dateofbirth/p
pCurrent Year At School: input type=text name=currentyear/p
pNumber Of Siblings: input type=text name=familynumber/p
pHome Work: input type=text name=homework/p
pEntertainment: input type=text name=entertainment/p
pComputer: input type=text name=computer/p
pFamily: input type=text name=family/p
pFriends: input type=text name=friends/p
input type=submit name=submit value=Submit
/form
/body
/html

?php
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$dateofbirth=$_POST['dateofbirth'];
$currentyear=$_POST['currentyear'];
$familynumber=$_POST['familynumber'];
$homework=$_POST['homework'];
$entertainment=$_POST['entertainment'];
$computer=$_POST['computer'];
$family=$_POST['family'];
$friends=$_POST['friends'];
$subject=$_POST['$subject'];
$message=$_POST['$message'];
echo h1Student Details:/h1;
echo pGreat! Thanks .$firstname. for responding to our survey./p;
echo pName: .$firstname. $lastname/p;
echo pDate Of Birth: $dateofbirth/p;
echo pCurrent School Year: $currentyear/p;
echo pNumber Of Siblings: $familynumber/p;
echo p Subject: $subject = '$firstname, $lastname survey 
results'/p;
echo pMessage: $message = '$firstname, $lastname, $dateofbirth, 
$currentyear, $familynumber, $homework, $entertainment, $computer, 
$family, $friends'/p;

$to='startrekc...@gmail.com';
$subject = $firstname, $lastname;
mail($to, $subject, $message);
?

http://localhost/SixthPHP/Data.php

table with 5 columns and 4 rows
( ! ) Notice: Undefined index: $subject in 
C:\wamp\www\SixthPHP\Data.php on line 12

Call Stack
#
Time
Memory
Function
Location
1
0.0006
379792
{main}( )
..\Data.php:0
table end

table with 5 columns and 4 rows
( ! ) Notice: Undefined index: $message in 
C:\wamp\www\SixthPHP\Data.php on line 13

Call Stack
#
Time
Memory
Function
Location
1
0.0006
379792
{main}( )
..\Data.php:0
table end

Student Details:

Great! Thanks Marvin for responding to our survey.

Name: Marvin Hunkin

Date Of Birth: 13/02/1965

Current School Year: 12

Number Of Siblings: 3

Subject: = 'Marvin, Hunkin survey results'

Message: = 'Marvin, Hunkin, 13/02/1965, 12, 3, 30, 88, 95, 33, 102'

table with 5 columns and 5 rows
( ! ) Warning: mail() [
function.mail]:
Failed to connect to mailserver at localhost port 25, verify your 
SMTP and smtp_port setting in php.ini or use ini_set() in 
C:\wamp\www\SixthPHP\Data.php

on line 24
Call Stack
#
Time
Memory
Function
Location
1
0.0006
379792
{main}( )
..\Data.php:0
2
0.0013
380832
mail
 ( )
..\Data.php:24
table end

ps: so how to fix the problems, maybe how to get the date for say 
Febuary 13, 1965, can any one help me out. maybe e-mail me off list 
via startrekc...@gmail.com if not on topic.
--- In blindwebb...@yahoogroups.com, Parham Doustdar parham90@... 
wrote:


 Marvin,

 You cannot attach files to your emails when you're sending an email to
 this list. But regardless of your code:

 1. Setting up your SMTP is not a PHP issue, it depends on your 
operating

 system.
 2. I expect you're using Windows. As far as I know, there is not an 
easy
 solution about running an SMTP server on Windows. What I did was to 
find
 someone who would let me play with the SMTP server running on his 
Linux box.


 But of course, if anyone has done this on Windows, I'd appreciate it if
 they could step forward and help you.

 Good luck,
 Parham

 On 12/16/2011 2:27 PM, Marvin Hunkin wrote:
 
  Hi.
  can some one help me to set up my smtp.
  also, not liking some of my variables.
  new to php and learning this.