Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 2 of 5 FirstFirst 12345 LastLast
Results 11 to 20 of 49
  1. #11
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    To be honest, I'd be tempted to just end the PHP tag and use standard HTML. It's much cleaner, and if you're using an IDE, you're going to be able to see your variables much easier.

  2. #12
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    // We haven't pressed edit profile, so lets edit it!
        
            // Get some information out of the database
            
    $getuser mysql_query("SELECT * FROM members WHERE id = '$_SESSION[user_id]' ") or die(mysql_error());
            
    // Get the information into an array
            
    $profile mysql_fetch_array($getuser);
            
            
    // Spit all the information we grabbed from the database out
            // and enter it into the fields.
            
    echo("<form method=\"post\">
            <p>E-mail: <input type=\"text\" name=\"email\" value=\"
    $profile[email]\" /><br />
            Location: <input type=\"text\" name=\"location\" value=\"
    $profile[location]\" /><br />
            MSN address: <input type=\"text\" name=\"MSN\" value=\"
    $profile[MSN]\" /><br />
            Password:<font color=\"#FF0000\">*</font> 
            <input type=\"password\" name=\"password\" value=\"\" /><br />
            Confirm Password: <input type=\"password\" name=\"cpassword\" value=\"\" /><br />
            <input type=\"submit\" name=\"update\" value=\"Update password\"><br />
            <font color=\"#FF0000\" size=\"2\">* Leave empty if you do not wish to change</font> </p>
            </form>"
    ); 
    That is what I use to edit my profile :s

  3. #13
    Join Date
    Jul 2008
    Posts
    535
    Tokens
    75

    Default

    Blinger when I use your idea I get:

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/x/public_html/test/editprofile.php on line 43

  4. #14
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Quote Originally Posted by BOX! View Post
    Blinger when I use your idea I get:

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/x/public_html/test/editprofile.php on line 43
    Post your code.

  5. #15
    Join Date
    Jul 2008
    Posts
    535
    Tokens
    75

    Default

    PHP Code:
    echo "<form action=\"?do=update\" method=\"post\">
    first name: <input type=\"text\" name=\"firstname\" value=\"
    $value['firstname']\" /><br />
    last name: <input type=\"text\" name=\"lastname\" /><br />
    nick name: <input type=\"text\" name=\"nickname\" /><br />
    location: <input type=\"text\" name=\"location\" /><br />
    email: <input type=\"text\" name=\"email\" /><br />
    gender: <input type=\"checkbox\" name=\"male\" /> male <input type=\"checkbox\" name=\"female\" /> female<br />
    bio: <input type=\"text\" height=\"200px\" width=\"300px\" name=\"bio\" /><br />
    fav movies: <input type=\"text\" height=\"200px\" width=\"300px\" name=\"favmovies\" /><br />
    fav music: <input type=\"text\" height=\"200px\" width=\"300px\" name=\"favmusic\" /><br />
    fav books: <input type=\"text\" height=\"200px\" width=\"300px\" name=\"favbooks\" /><br />
    <input type=\"submit\" value=\"update profile\" />
    </form><br />
    <br />
    want to change your password?
    <form action=\"?do=updatepw\" method=\"post\">
    current password: <input type=\"password\" name=\"currentpassword\" /><br />
    new password: <input type=\"password\" name=\"newpassword\" /><br />
    <input type=\"submit\" value=\"update password\" />
    </form>"

    I only did the value on the first input.

  6. #16
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    Is that what it is in your database?

  7. #17
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    PHP Code:
    echo "<form action=\"?do=update\" method=\"post\">
    first name: <input type=\"text\" name=\"firstname\" value=\"
    {$value['firstname']}\" /><br />
    last name: <input type=\"text\" name=\"lastname\" /><br />
    nick name: <input type=\"text\" name=\"nickname\" /><br />
    location: <input type=\"text\" name=\"location\" /><br />
    email: <input type=\"text\" name=\"email\" /><br />
    gender: <input type=\"checkbox\" name=\"male\" /> male <input type=\"checkbox\" name=\"female\" /> female<br />
    bio: <input type=\"text\" height=\"200px\" width=\"300px\" name=\"bio\" /><br />
    fav movies: <input type=\"text\" height=\"200px\" width=\"300px\" name=\"favmovies\" /><br />
    fav music: <input type=\"text\" height=\"200px\" width=\"300px\" name=\"favmusic\" /><br />
    fav books: <input type=\"text\" height=\"200px\" width=\"300px\" name=\"favbooks\" /><br />
    <input type=\"submit\" value=\"update profile\" />
    </form><br />
    <br />
    want to change your password?
    <form action=\"?do=updatepw\" method=\"post\">
    current password: <input type=\"password\" name=\"currentpassword\" /><br />
    new password: <input type=\"password\" name=\"newpassword\" /><br />
    <input type=\"submit\" value=\"update password\" />
    </form>"

    Last edited by Trinity; 17-11-2008 at 12:27 AM.

  8. #18
    Join Date
    Jul 2008
    Posts
    535
    Tokens
    75

    Default

    Beau I've tried what you said to do:

    PHP Code:
        echo ( ?>
    <form action="?do=update" method="post">
    first name: <input type="text" name="firstname" value="echo /><br />
    last name: <input type="text" name="lastname" /><br />
    nick name: <input type="text" name="nickname" /><br />
    location: <input type="text" name="location" /><br />
    email: <input type="text" name="email" /><br />
    gender: <input type="checkbox" name="male" /> male <input type="checkbox" name="female" /> female<br />
    bio: <input type="text" height="200px" width="300px" name="bio" /><br />
    fav movies: <input type="text" height="200px" width="300px" name="movies" /><br />
    fav music: <input type="text" height="200px" width="300px" name="movies" /><br />
    fav books: <input type="text" height="200px" width="300px" name="movies" /><br />
    <input type="submit" value="update profile" />
    </form><br />
    <br />
    want to change your password?
    <form action="?do=updatepw" method="post">
    current password: <input type="password" name="currentpassword" /><br />
    new password: <input type="password" name="newpassword" /><br />
    <input type="submit" value="update password" />
    </form>
    <?php
    );
    }
    ?>
    however I get an error: Parse error: syntax error, unexpected ';' in /home/kolzy/public_html/test/editprofile.php on line 42 42 is the echo line. "echo ( ?>". There is no ';'.

    EDIT: Thanks Trinity.

  9. #19
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Why echo all that out? Just end your PHP tag

    ?>

    and then do that.. and then restart it...

    <?php

    PHP Code:
    ?>
    <form action="?do=update" method="post">

        first name: <input type="text" name="firstname" value="<?php echo $value['firstname']; ?>" />
        <br/>
        last name: <input type="text" name="lastname" />
        <br/>
        nick name: <input type="text" name="nickname" />
        <br/>
        location: <input type="text" name="location" />
        <br/>
        email: <input type="text" name="email" />
        <br/>
        gender: <input type="checkbox" name="male" />male <input type="checkbox" name="female" />female
        <br/>
        bio: <input type="text" height="200px" width="300px" name="bio" />
        <br/>
        fav movies: <input type="text" height="200px" width="300px" name="favmovies" />
        <br/>
        fav music: <input type="text" height="200px" width="300px" name="favmusic" />
        <br/>
        fav books: <input type="text" height="200px" width="300px" name="favbooks" />
        <br/>
        <input type="submit" value="update profile" />
        
    </form>

    <br/>
    <br/>

    want to change your password?

    <form action="?do=updatepw" method="post">
        current password: <input type="password" name="currentpassword" />
        <br/>
        new password: <input type="password" name="newpassword" />
        <br/>
        <input type="submit" value="update password" />
    </form>
    <?php

  10. #20
    Join Date
    Dec 2007
    Posts
    132
    Tokens
    0

    Default

    Nothing wrong with putting a form in an echo. I personally like to put my form in a variable and every time there's an error it says.

    echo "Error: Wrong username or password. <br /> $form";

    Thats the way I do it. But you can do it anyway you want really.

    Waz ;]


Page 2 of 5 FirstFirst 12345 LastLast

Posting Permissions

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