Jump to content
Larry Ullman's Book Forums

milo99

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by milo99

  1. Thanks for your replies everyone. I did manage to get it working. I have decided to step back from the Yii side for a little while as I work my way through Larry's PHP book first. I will be back at it soon and am sure I will have a million questions for you when I do :-)
  2. Hmm still no luck... this is what it says on the yii site: % cd WebRoot on my computer I think that is... % cd Library/WebServer/Documents but it says '-bash: fg: %: no such job' when I hit enter % php YiiRoot/framework/yiic.php webapp testdrive on my computer I think this is... % php Applications/MAMP/htdocs/yii/framework/yiic.php webapptestdrive but it says '-bash: fg: %: no such job' when I hit enter I have tried this in so many variations now that I think I am going to go insane. Nothing works.
  3. Hi Larry, I bought your book PHP and MYSQL for dynamic websites and have found it very easy to follow. I am completely new to PHP so that was important. I am actually a graphic designer but my company is working on a huge project that is built on the yii framework so they want us ALL to learn it. I am having a problem right from the get go with the terminal command. Nothing I type in seems to work. I am having trouble even understanding why I need to use terminal. I am not sure if this helps but I have installed MAMP on my Macbook Pro. I ran this after I installed yii and it passed: http://localhost:8888/yii/requirements/ My yii is installed here: /Applications/MAMP/htdocs/yii Please someone tell what I need to type into terminal to continue with yii. I won't be able to learn it I don't think if I can't get past this first step.
  4. So yes turning on the display errors has already worked for me as when I first ran this script I had an error on line 73 which I easily found. I also had another issue and I posted a big long speel about it here but I did figure it out I had $REQUEST instead of $_REQUEST. I am actually finding this PHP fun to work on now.
  5. Thanks again Edward my host has done this. Now I just need to make another error to test it out ;-)
  6. Again here are the urls (I know I could just cut and paste the code from the book but I am trying to type it out myself so I can spot the problems later on but again I just don't see anything wrong) http://canucklist.co...book/form2.html http://canucklist.co...andle_form2.php
  7. hmm here is another one. How do you paste her with the colors Edward? When I paste my code here it is just black. Anyway can you see a problem here? <!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" xml:lang="en"lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Feedback Form</title> </head> <body> <?php $name = $_REQUEST['name']; $email = $_REQUEST['email']; $comments = $_REQUEST['comments']; /* Not Used: $_REQUEST['age'] $_REQUEST['gender'] $_REQUEST['submit'] */ //Create the $gender variable: if (isset($_REQUEST['gender'])) {$gender = $_REQUEST['gender']; } else { $gender = NULL; } //Print the submitted information: echo "<p>Thank You, <b>$name</b>, for the following comments:<br /> <tt>$comments</tt></p> <p> we will reply to you at <i>$email</i>.</p>\n"; //Print a message based upon the gender value: if($gender = = 'M') { echo '<p><b>Good day, Sir!</b> </p>'; } elseif ($gender = = 'F'){ echo'<p><b> Good day, Madam! </b></p>'; } else { //No gender selected. echo '<p><b>You forgot to enter your gender!</b></p>'; } ?> </body> </html>
  8. Ah yes that worked nicely thanks. Yikes one missing " can throw a wrench in your whole day can't it. Thanks again
  9. Hi Margaux thanks I am actually using Text Wrangler as well I just copied the code above from text edit though sorry.
  10. No I am affraid that is not the problem. This is making me a little nuts because it is so simple. These are the actual pages... http://canucklist.com/php/php-book/handle_form.php http://canucklist.com/php/php-book/form.html
  11. Sorry I know this is a super simple script but I just can't see the error. I get Server Error HTTP Error 500. I have tried removing bits, tweaking, re-writing and I cannot believe this won't work. It is not my server as I have several hundred php scripts running on it without issue... HTML... <!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" xml:lang="en"lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Simple HTML Form</title> <style type="text/css" title="text/css" media="all"> label {font weight: bold; color:#300ACC;} </style> </head> <body> <form action="handle_form.php" method="post"> <fieldset><legend> Enter Your Information in the form below:</legend> <p> <label> Name:<input type="text" name="name" size="20" maxlength="40" /></label></p> <p> <label> Email Address:<input type="text" name="email" size="40" maxlength="60" /></label></p> <p> <label for="gender"> Gender:</label><input type="radio" name="gender" value="M" />Male <input type="radio" name="gender" value="F" />Female</p> <p> <labe>Age: <select name="age"><option value="0-29">Under 30</option> <option value="30-60">Between 30 and 60</option> <option value="60+">Over 60</option> </select></label></p> <p><label>Comments:<textarea name="Comments" rows="3" cols="40"></textarea></label></p> </fieldset> <p align="center"><input type="submit" name="submit" value="Submit My Information" /></p> </form> </body> </html> 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" xml:lang="en"lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Feedback Form</title> </head> <body> <?php $name = $_REQUEST['name']; $email = $_REQUEST['email']; $comments = $_REQUEST['comments']; /* Not Used: $_REQUEST['age'] $_REQUEST['gender'] $_REQUEST['submit'] */ //Print the submitted information: echo "<p>Thank You, <b>$name</b>, for the following comments:<br /> <tt>$comments</tt></p> <p> we will reply to you at <i>$email</i>.</p>\n; ?> </body> </html>
×
×
  • Create New...