Go Back   Dreamweaver Club Forums > Dreamweaver forums > Dreamweaver General
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 03-11-2016, 12:00 AM   #1
Join Date: Sep 2015
Posts: 15
Question Profile Picture Upload Problem

Hey, I'm using this script, It work's if i replace "['Username']" with my username manually, how can i get it to auto echo the username that's logged in? Thanks

<?php session_start();
$_SESSION['Username'] = "['Username'];"

$con = mysqli_connect("localhost","*******","******","*** ***");
$q = mysqli_query($con,"UPDATE user_db SET pic = '".$_FILES['file']['name']."' WHERE Username = '".$_SESSION['Username']."'");

<!DOCTYPE html>

<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" name="submit">
Tiger is offline   Reply With Quote
Old 03-12-2016, 03:08 AM   #2
edbr's Avatar
Join Date: Aug 2005
Location: Bali
Posts: 11,203

Rename the file when you upload it
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:46 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com