HELP! Notice: Undefined variable: ip

A

Anonymous

Guest
Hi I am running winserver 2003 IIS and just installed PHP, myscripts work fine on linux servers but ont his windows box I get the Error,
Notice: Undefined variable: ip in E:\websites\prototype\sendemail.php on line 39
Oops
Notice: Undefined variable: notes in E:\websites\prototype\sendemail.php on line 45

Notice: Undefined variable: email in E:\websites\prototype\sendemail.php on line 45

Notice: Undefined variable: name in E:\websites\prototype\sendemail.php on line 45

Notice: Undefined variable: ip in E:\websites\prototype\sendemail.php on line 45

Date: Thursday, March 10, 2005, 10:22 am

Thank you for your time
Notice: Undefined variable: name in E:\websites\prototype\sendemail.php on line 61
your message has been sent.

I think I can get the code to work if i turn register_globals=On , but that is a big no no. Below is the code

Code:
<?php 

$myemail = "nosuchemail@test.com";
                                                      
                                                      if (!isset($email))
                                                      echo "Oops $ip" ;
                                                      
                                                      $todayis = date("l, F j, Y, g:i a") ;
                                                      
                                                      $subject = "Questions for the President" ;
                                                      
                                                      $message = " $todayis [EST] \n Message: $notes \n From: $email ($name)\n Additional Info : IP = $ip \n ";
                                                      
                                                      $from = "From: $myemail\r\n";
                                                      
                                                      if ($myemail != "")
                                                      mail($myemail, $subject, $message, $from);
                                                  
                                                  ?>
                                                  
                                                  <p align="top">
                                                  	 
													 Date: <?php echo $todayis ?>
                                                  	 
													 <br>
												     <br>
                                                  	 
													Thank you for your time <?php echo $name ?> your message has been sent.
                                                  	 
													<br>
													 <br>
														<a href="javascript:window:close()">Close Window</a>

Thanks ahead of time for your help
 
With register_globals off (as it should be), you access form values using $_POST or $_GET (depending on your form method). So if you want to get the value in the email field, for example, you would use $_POST['email'].
 
FIrst thank you, but I should of prefaced by saying I barely know any PHP so in what instance on the script would $_POST or $GET_ go I tried replacing the $email, $notes field with it but I got
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in E:\websites\prototype\sendemail.php on line 47

Thanks Again
 
jackdirt said:
FIrst thank you, but I should of prefaced by saying I barely know any PHP so in what instance on the script would $_POST or $GET_ go I tried replacing the $email, $notes field with it but I got
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in E:\websites\prototype\sendemail.php on line 47

Thanks Again
first: In last PHP version before you call some variable to you need declare it first. Like in C++ or Delfi.....
than you get this error: Undefined variable....
to you need firstly define this fariable......
second:
Parse error oyu get then you have a sintax error in function definition....
carefuly with quotes and what you set in function....
Good luck newbie :eek:)
 
Back
Top