Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: making an url with text and buttons?

  1. #11
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    A couple of things wrong with that one, "id" should be "name":

    Code:
    <?php 
    if ($_POST['name'] && $_POST['pass']) {
    $url = 'http://'.$_POST['name'].':'.$_POST['pass'].'@my.com';
    } else { ?>
    <form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
    
                    <div class="form_field">
                    <strong>Username:</strong>
                    <input type="text" id="name">
                    </div>
    
                    <div class="clearthis">&nbsp;</div>
    
                    <div class="form_field">
                    <strong>Password:</strong>
                    <input type="password" id="pass">
                    </div>
    
                    <div class="clearthis">&nbsp;</div>
    
                    <div class="form_field">
                    <input type="image" src="/images/loginBtn.gif" class="button">
                    </div>
    
                </form>
    <?php } ?>
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  2. #12
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Thanks thanks thanks. I will look into the sprintf thing in a bit. I really need to get on and learn this language. So much to do so much to do.

    This part is just saying to do a header redirect to the location http://$_POST['username']:$_POST['password']@my.com/page/ just in the form of sprintf. Basically, the %s is a string that is passed through the sprintf method. The first %s is the username and the second is the password. For a better picture, look at the colored code below.
    Aye, thanks for that, it is a new one to me, but I shall look at it
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #13
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    You know what? I used every example in this thread, most of them twice... and I couldn't get any of them to work!

    I am going to try again in a little bit, and if I can't do it I will post a link to a page with text areas showing the php used and maybe someone can see what I am doing wrong...
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

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
  •