logo-dw

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

Reply
 
Thread Tools Display Modes
Old 03-11-2016, 12:00 AM   #1
Tiger
 
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'];"
?>

<?php
if(isset($_POST['submit'])){
move_uploaded_file($_FILES['file']['tmp_name'],"pictures/".$_FILES['file']['name']);
$con = mysqli_connect("localhost","*******","******","*** ***");
$q = mysqli_query($con,"UPDATE user_db SET pic = '".$_FILES['file']['name']."' WHERE Username = '".$_SESSION['Username']."'");
}
?>

<!DOCTYPE html>
<html>
<head>

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

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
Reply


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 05:24 PM.


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