Vote count:
0
I want to send a user to there profile after registering but I get no input file not sure what I'm doing wrong but I start a session in an els statement not sure if that's write can someone help me out maybe
<?php
// set database connection
require("dbconfig.php");
// lets get our posts //
$email = $_POST['email'];
$pass = $_POST['password'];
$bn = $_POST['bandname'];
$state = $_POST['state'];
$genre = $_POST['genre'];
$description = $_POST['description'];
$image = $_FILES['image'];
/// valid image types ///
$image_type = array("image/jpg","image/jpeg","image/bmp","image/gif","image/png");
/// folder that will hold the image
$imagepath = "images/";
$imagepath .= $image["name"];
// move the file from the tmp folder to the image folder
if (move_uploaded_file($image['tmp_name'], $imagepath)){
$foo = `mogrify -quality 92 -scale 500x $imagepath`;
}
// insert data into mysql
$sql = "insert into dbusers (email, password, bandname, state, genre, description , image)
values ('$email','$pass','$bn ','$state','$genre','$description','".$image['name'] . "')";
if (!mysql_query($sql)){
die('ERROR' . mysql_error());
}else {
$id = $row ['id']; // Get the associated ID number
// Set up a login session
session_start();
$_SESSION ['id' ] = $id;
$_SESSION ['bandname' ] = $bandname;
$_SESSION ['password' ] = $password;
header ("location:ympprofile.php?listid=$id");
}
?>
asked 59 secs ago
redirect to profile after registering for website using php
Aucun commentaire:
Enregistrer un commentaire