Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Social Website Profile Picture HELP!

    So i've been working on a socialw ebsite for a couple of weeks, what i need is that i need the profile picture to be for the user that uploaded it i got the codes for the file upload and file select, what i need is the code for the profile picture...i have a database, filezilla etc..

  • #2
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Are you wanting a user registration form that uploads a photo for the user at the same time? If so the easiest way to do it is to have the name of the photo entered in to the database with the rest of the information.

  • #3
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're near, i want the user the upload profile picture like you do in facebook.

  • #4
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Can you post your code for your user registration?

  • #5
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sure here it is:

    PHP Code:
    <?PHP
    require_once("./include/membersite_config.php");

    if(isset(
    $_POST['submitted']))
    {
       if(
    $fgmembersite->RegisterUser())
       {
            
    $fgmembersite->RedirectToURL("thank-you.html");
       }
    }

    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
    <head>
        <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
        <title>Contact us</title>
        <link rel="STYLESHEET" type="text/css" href="style/fg_membersite.css" />
        <script type='text/javascript' src='scripts/gen_validatorv31.js'></script>
        <link rel="STYLESHEET" type="text/css" href="style/pwdwidget.css" />
        <script src="scripts/pwdwidget.js" type="text/javascript"></script>      
    </head>
    <body>

    <!-- Form Code Start -->
    <div id='fg_membersite'>
    <form id='register' action='<?php echo $fgmembersite->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'>
    <fieldset >
    <legend>Register</legend>

    <input type='hidden' name='submitted' id='submitted' value='1'/>

    <div class='short_explanation'>* required fields</div>
    <input type='text'  class='spmhidip' name='<?php echo $fgmembersite->GetSpamTrapInputName(); ?>' />

    <div><span class='error'><?php echo $fgmembersite->GetErrorMessage(); ?></span></div>
    <div class='container'>
        <label for='name' >Your Full Name*: </label><br/>
        <input type='text' name='name' id='name' value='<?php echo $fgmembersite->SafeDisplay('name'?>' maxlength="50" /><br/>
        <span id='register_name_errorloc' class='error'></span>
    </div>
    <div class='container'>
        <label for='email' >Email Address*:</label><br/>
        <input type='text' name='email' id='email' value='<?php echo $fgmembersite->SafeDisplay('email'?>' maxlength="50" /><br/>
        <span id='register_email_errorloc' class='error'></span>
    </div>
    <div class='container'>
        <label for='username' >UserName*:</label><br/>
        <input type='text' name='username' id='username' value='<?php echo $fgmembersite->SafeDisplay('username'?>' maxlength="50" /><br/>
        <span id='register_username_errorloc' class='error'></span>
    </div>
    <div class='container' style='height:80px;'>
        <label for='password' >Password*:</label><br/>
        <div class='pwdwidgetdiv' id='thepwddiv' ></div>
        <noscript>
        <input type='password' name='password' id='password' maxlength="50" />
        </noscript>    
        <div id='register_password_errorloc' class='error' style='clear:both'></div>
    </div>

    <div class='container'>
        <input type='submit' name='Submit' value='Submit' />
    </div>

    </fieldset>
    </form>
    <!-- client-side Form Validations:
    Uses the excellent form validation script from JavaScript-coder.com-->

    <script type='text/javascript'>
    // <![CDATA[
        var pwdwidget = new PasswordWidget('thepwddiv','password');
        pwdwidget.MakePWDWidget();
        
        var frmvalidator  = new Validator("register");
        frmvalidator.EnableOnPageErrorDisplay();
        frmvalidator.EnableMsgsTogether();
        frmvalidator.addValidation("name","req","Please provide your name");

        frmvalidator.addValidation("email","req","Please provide your email address");

        frmvalidator.addValidation("email","email","Please provide a valid email address");

        frmvalidator.addValidation("username","req","Please provide a username");
        
        frmvalidator.addValidation("password","req","Please provide a password");

    // ]]>
    </script>

    <!--
    Form Code End (see html-form-guide.com for more info.)
    -->

    </body>
    </html>


  •  

    Posting Permissions

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