Jump to content
Larry Ullman's Book Forums

milo99

Members
  • Posts

    12
  • Joined

  • Last visited

Posts 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. Thanks again Edward my host has done this. Now I just need to make another error to test it out ;-)

     

    One thing i forget to add, it would be a good idea to turn on display error's in your php.ini files on the server or ask your host to switch it on for you while you need to test your good. That way for yourself and for others here we would receive an error message and know which line of the script that the problem was present.

  5. 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>

  6. Ah yes that worked nicely thanks. Yikes one missing " can throw a wrench in your whole day can't it. Thanks again

     

    Okay i found another error, other than changing Comments to comments for the text area name, you have a double quote missing from the handle_form.php echo statement. Correct code for handle_form.php is:

     

    <!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:
    [b][color=#008000]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";[/color][/b]
    ?>
    </body>
    </html>
    

  7. 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...