SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am new to php and need help with something. I found a script i want to use but I think there is an error in it. It's the wu-name name generator located at http://www.blazonry.com/scripting/wuname.php

    The script they have published seems to have an error, if you look at it you'll see what i mean. Unfortunatley, I dont know what I'm doing and can't figure out how to fix it.

    If anyone would take a peek at it and help me, I would greatly appreciate it.

    thanks!

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunately there are several mistakes in this script. The one that is keeping it from working properly is this one
    PHP Code:
     if ($request_method == "POST") { 
    should be:

    PHP Code:
     if ($REQUEST_METHOD == "POST") { 
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for looking at this for me! It still isn't working though, I can't figure this out. Their demo works, and I think others have applied the script before.

    Is there anything else wrong in there that you can see?

    Thanks

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay I changed the whole script around and it works now, just make sure that the text files for the nouns and adjectives exist and are in the same folder as the script I used the demos at

    adjectives:
    http://www.blazonry.com/scripting/wu_adjs
    nouns:
    http://www.blazonry.com/scripting/wu_nouns


    PHP Code:
    <html>
    <head>
    </head>
    <body bgcolor="#FFFFFF">


      <form action="<?=$PHP_SELF?>" METHOD="POST">
            <p><b>Enter your Name: </b><br>
            <input type="text" name="realname" size=25> &nbsp; &nbsp;
            <input type="submit" value="Submit">
            </p>
      </form>

    <p><hr size=1 noshade></p>

    <?
      
    if ($realname != "") {
            
    $displayname $realname;
            
    $realname strtolower($realname);

            
    // read in the two files into the arrays
            
    $adj_array file("adjective.txt");
            
    $noun_array file("noun.txt");

            
    // set random seed
            
    srand((double)microtime()*1000000);    

            
    //get the random numbers for each
            
    $arnd rand(0,count($adj_array)-1);
            
    $nrnd rand(0,count($noun_array)-1);

            
    // create name from random numbers
            
    $wuname "$adj_array[$arnd] $noun_array[$nrnd]";

            echo(
    "<P><font size=4><b>$displayname</b> from this day forward you <br>you will also be known as ");
            echo(
    "<font size='+1'><b> $wuname </b></font></font></p>");

      }

    ?>


    </body>
    </html>
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much for this!!! I really appreciate it. I hope to learn more soon so I can do things such as this on my own, but it's so nice to know that there is a helpful place I can turn to in the meantime.

    Thanks again!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •