Jump to content

zeusthegreat

Member
  • Posts

    86
  • Joined

  • Last visited

Everything posted by zeusthegreat

  1. zeusthegreat

    php email

    in lesson 7 functions part 2 begining php videos i followed the code !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4loose.dtd"> <html> <head> <meta http-equiv="Content-Type" Content="text/html; charset=iso-8859-1"> <title></Title> </head> <body> <h4>Functions - The Users Perspective</h4> <?php $words = " many words in this sentence...."; $result = str_word_count($words); echo $result . "<br><br>"; $did_send = mail('stefan@killerphp.com','killerphp.com Test Email', "The body message."); echo "Email Sent: " . $did_send; ?> and viewed in browser and got back Functions - The Users Perspective 5 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\email.php on line 25 Email Sent: i wondered if this is a problem or not because i have not stipulated a mailserver and have not verified my smtp can somebody clarify please thankyou
  2. yes is works thanks guys, we got there in the end !!!!! :clap#] and by the way guys how would i do an upload buuton to upload to my site so people can browse and in turn download it as soon as it has been uploaded....... thanks again
  3. so what you are saying is i only have to change killerphp.com to //KILLERPHP.COM and it will work because it is not part of the code then. shll try it tommorow now as it is rest time now but thanks
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">'>http://www.w3.org/1999/xhtml">'>http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> body { background-color: #FFC; } </style> </head> <body> <br> <form method="post" action="form_response.php"> <div class="form_element_div"> First Name: <br> <input name="name_first" type="text" size="50" maxlength="200"/> </div> <div class="form_element_div"> Email: <br><input name="email" type="text" size="50" maxlength="200" /> </div> <div class="form_element_div"> Favorite colour: <INPUT type=radio value="red" name="colour"/> red <INPUT type=radio CHECKED value="yellow" name="colour"/> yellow <INPUT type=radio value="blue" name="colour"/> blue </div> <br> <div class="form_element_div"> Favorite Website: <select name="favorite-website"> <Option value="" selected>Please Select</Option> <Option value="www.killerstes.com">killersites.com </Option> <Option value="www.killerphp.com">killerphp.com </Option> <Option value="www.google.com">google.com </Option> </select> </div> <br> <div class="form_element_div"> Comments: <br> <textarea name="comments" cols="50" rows="2" id="description" ></textarea> </div> <br> <div class="form_element_div"> <input type="submit" name="submit_button" value="Submit Request >>" class="submit" /> </div> </form> </div> <div style="margin-top:25px;"> <a href="form_query.php?email=videos&name_first=stefan" >Query String</a> </div> </body> </html> copied this pasted it like you said named the file afterwards talos_form.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> body { background-color: #FFC; } </style> </head> <body> <div id="topbar"></div> <div id="navigation" class="container"></div> <div id="centerDoc" class="container"> <div style="margin-top:25px; margin-bottom:20px; "> </div> <div> <?php if(isset($_POST['submit_button'])) { // FORM PROCESSING CODE - USING 'SUPER GLOBALS' - KILLERPHP.COM $first_name = $_POST['name_first']; $email = $_POST['email']; $colour = $_POST['colour']; $website = $_POST['favorite-website']; $comments = $_POST['comments']; print "<p>First Name: $first_name with an email of: $email and Favorite Colour: $colour and Favorite Website: $website and Comments: $comments</p>"; } ?> </div> </body> </html> then copied this and renamed the file form_response .php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> body { background-color: #FFC; } </style> </head> <body> <div id="topbar"></div> <div id="navigation" class="container"></div> <div id="centerDoc" class="container"> <div style="margin-top:25px; margin-bottom:20px; "> </div> <div> <?php $first_name = $_GET['name_first']; $email = $_GET['email']; print "<p>First Name: $first_name with an email of: $email</p>"; ?> </div> </body> </html> the copied this and named it form_query.php and as has happened all the way through the talos_form page loads the submit button comes up with Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\form_response.php on line 28 and the third page when clicked on the query link works fine I have been using your code ever sinc e you posted it and still no joy!!!! I am using wamp by the way if that has any significance
  5. I have done this both ways downloaded code and applied your names to the particular pages and applied my names to the pages and i get the same error! I am wondering if there is something in the php settings panel that i need to change as i am not thick by any means and usually when i follow a training lesson i plough through it no worries... Please can somebody help as this lesson has held me up all week now!!! thankyou...
  6. how come i have have tryed to customise these pages names and for some reason the button page does not work Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\form_response.php on line 28 the rest works i called the first page talos_form.php and it works fine the second page i called form_response.php and i get the above error when the button is pressed but it works ok on your link the third page i called form_query.php and the query link on the form works fine sorry to bother but the more mistakes i make the more i learn...... thankyou
  7. sorry wickham tryed customizing the names of the files and changing were they are sent in the code what have you called the 2nd and third pages so i know what to look for! sorry buddy!
  8. thankyou wickham you are a star!!! Is there ant chance i could have your email to keep up my learning curve! I will totally understand if you say no! once again thankyou!
  9. is there something i have to change in the php settings
  10. error message has now changed to Notice: Undefined index: email in C:\wamp\www\form_response.php on line 20 Notice: Undefined variable: first_name in C:\wamp\www\form_response.php on line 22 First Name: with an email of: i corrected the code as below <div id="topbar"></div> <div id="navigation" class="container"></div> <div id="centerDoc" class="container"> <div style="margin-top:25px; margin-bottom:20px; "> </div> <div> <?php if(isset($_POST['submit_button'])) // FORM PROCESSING CODE - USING 'SUPER GLOBALS' - KILLERPHP.COM $first_name = $_POST['name_first']; $email = $_POST['email']; print "First Name: $first_name with an email of: $email" ?> </div>
  11. thankyou wickham have done all you said the error messages are still there when i click on the string link
  12. hi everyone need some help to start php

  13. zeusthegreat

    beginners php

    do not know what i have done wrong here, i have gone through the lesson 3 times now. lesson 6 video 2- 12mins 17 seconds i keep getting this error when i click on the Query string link to capture email the error Undefined index: name_first in C:\wamp\www\form_response.php on line 18 <br /> <b>Notice</b>: Undefined index: email in C:\wamp\www\form_response.php</b> on line 19 First Name: with an email of: below is my code firstly for the form <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> body { background-color: #FFC; } </style> </head> <body> <br> <form method="post" action="form_response.php"> <div class="form_element_div"> First Name: <br> <input name="name_first" type="text" size="50" maxlength="200"> </div> <div class="form_element_div"> Email: <br><input name="email" type="text" size="50" maxlength="200" </div> <div class="form_element_div"> Favorite colour: <INPUT type=radio value="red" name="colour"> red <INPUT type=radio CHECKED value="yellow" name="colour"> yellow <INPUT type=radio value="blue" name="colour"> blue </div> <br> <div class="form_element_div"> Favorite Website: <select name="favorite webite"> <Option value="" selected>Please Select</Option> <Option value="www.killerstes.com">killersites.com </Option> <Option value="www.killerphp.com">killerphp.com </Option> <Option value="www.google.com">google.com </Option> </select> </div> <br> <div class="form_element_div"> Comments: <br> <textarea name="comments" cols="50" rows="2" id="description" ></textarea> </div> <br> <div class="form_element_div"> <input type="submit" name="submit_button" value="Submit Request >>" class="submit" </div> </form> </div> <div style="margin-top:25px;"> <a href="form_response.php?email=videos&name=stefan">Query String</a> </div> </body> </html> and then the form response php page <div id="topbar"></div> <div id="navigation" class="container"></div> <div id="centerDoc" class="container"> <div style="margin-top:25px; margin-bottom:20px; "> </div> <div> <?php // FORM PROCESSING CODE - USING 'SUPER GLOBALS' - KILLERPHP.COM $first_name = $_POST['name_first']; $email = $_POST['email']; print "First Name: {$first_name} with an email of: {$email}"; ?> </div> can anybody please give me some advice
×
×
  • Create New...