Need help this is prob easy!

Discussion in 'Web Programming' started by ddg31, Dec 17, 2009.

Need help this is prob easy!
  1. Unread #1 - Dec 17, 2009 at 7:14 PM
  2. ddg31
    Joined:
    Nov 23, 2009
    Posts:
    19
    Referrals:
    0
    Sythe Gold:
    0

    ddg31 Newcomer

    Need help this is prob easy!

    Alright, im trying to figure out how to make a box when u click a generate button. In that box I want to play a url using a post method so like... "http://www.google.com/user= . $POST["user"]";

    This is kinda what i want it to look like:


    Code:
    Gamertag: "Box to type" Generate
    
    ~Picture Generates Here~
    
    Direct Link: http://www.google.com/h3.php?u= "What they typed here"

    So here is some of my code,

    Code:
    {source}
    [[p]][[center]]Type your gamertag here! If your using Internet Explorer You might have to wait a few seconds for the signature to appear once you click generate.
        [[form action="" method="post"]]
    Gamertag: [[input type="text" name="u" /]]
    [[input type="submit" value="Generate" /]]
    [[/form]]
    [[br /]]
    [[?php
    
    // If form submitted isn't blank
    if (isset($_POST["u"])) {
        $pattern = '/(\A[a-z][a-z0-9 ]+)/i';
        preg_match($pattern, $_POST["u"], $matches);
        if ($_POST["u"] == NULL || $matches[0] != $_POST["u"] || strlen($_POST["u"]) > 15) {
            echo "[[b]]Invalid gamertag[[/b]][[br /]]\n";
        } else {
            echo "<image src=\"/Signatures/Halo3/h3.php?u=" . $_POST["u"] . "\" alt=\"\">";
    
        }
    }
    
    ?]]
    [[/center]][[/p]]
    
    {/source}
    
    So now, I want it so when u click generate the box comes up with a url with the "u" in it... Any 1 know how?
     
  3. Unread #2 - Jan 1, 2010 at 11:45 AM
  4. Rdogg999
    Joined:
    Jan 16, 2008
    Posts:
    215
    Referrals:
    0
    Sythe Gold:
    0

    Rdogg999 Active Member

    Need help this is prob easy!

    change
    PHP:
     echo "<image src=\"/Signatures/Halo3/h3.php?u=" $_POST["u"] . "\" alt=\"\">";
    Too
    PHP:
     echo "<image src=\"/Signatures/Halo3/h3.php?u=" $_POST["u"] . "\" alt=\"\">
    <br />
    <input type='text'>http://www.url.com/Signatures/Halo3/h3.php?u=
    {$_POST['u']}</input>
    "
    ;
     
  5. Unread #3 - Jan 1, 2010 at 12:49 PM
  6. Pain Killer
    Joined:
    Nov 16, 2009
    Posts:
    629
    Referrals:
    0
    Sythe Gold:
    0

    Pain Killer Apprentice
    Banned

    Need help this is prob easy!

    Hey, I'm trying to learn how to design too..
    But I just need some help...What is this program basically?
     
  7. Unread #4 - Jan 1, 2010 at 4:59 PM
  8. Draucia
    Referrals:
    0

    Draucia Guest

    Need help this is prob easy!

    Hm? What do you mean? It's not really a program. It's a web programming language (is it a programming language?), called php. I don't know much in it, but I know it is good for making scripts to do stuff (contact forms, ptc scripts, etc).
    You can just use notepad and save it as a .php file, but I think people prefer to use a typing thing (IDE, I think) which is easier I think.

    I don't know much either, but I hope that helped you.
     
< [php] Need Help Please Easy [php] | Need help please. (PHP) >

Users viewing this thread
1 guest


 
 
Adblock breaks this site