Forum Moderators: coopster
I'm building a musician community. I joined, went and got my email verification, loged in, changed my photo and info,logged out. Joined as my wife, and did all the same for her profile.
The trouble is that I have a button "Your Profile" on homepage, and this is all I know to give to let members see their profile info.
Now when it comes time to build my search script I'm screwed because I cannot figure out how to use "makdir" in the script that signs my members up. Upon member sign-up I know I have to do something with "makdir" to give them an area of their own. And I know I have to use a unique field in the database to assign member to their area.(was thinkin' bout using "userid",<---good? or bad idea?)
But that's about it, that is all I know to do and have no idea how to code that bunch of mess and not many other folks do either. I've been asking in various forums for one week now. So now I come here to try.
Questions:
(1) Is it possible for me to put my 'user sign_up' script here, and have someone show me how to code the "MAKDIR" function into it where it does what I need?(make folder in directory for user)
(2) Is it a good idea for me to use the "userid" field as my unique for "makdir"?
Basically my goal is to search profiles, find the two dummies I created then click either thumbnail and it would take me to their profile to view. But in order to make that possible I need different folders for different members.("MAKDIR") I don't know how to code the "MAKDIR" for my script or where to put it in the 'Sign_up' .php
I will owe whomever helps me a great deal because this last thing is all I need to figure out in order to finish the project by myself. Instead of paying someone $3000-$5000 to build my site.
Thanks a million ~Adam
The directory I want on my root is- [/users/profiles/]
And now "register.php"(user sign-up)
--------------------------------------------------------
<?php
include 'db_connect.php';
$artname = $_POST['artname'];
$password = $_POST['password'];
$confirmpassword = $_POST['confirmpassword'];
$email = $_POST['email'];
$country = $_POST['country'];
$province = $_POST['province'];
$city = $_POST['city'];
$postalcode = $_POST['postalcode'];
$gender = $_POST['gender'];
$info = $_POST['info'];
$artname = stripslashes($artname);
$password = stripslashes($password);
$email = stripslashes($email);
$country = stripslashes($country);
$province = stripslashes($province);
$postalcode = stripslashes($postalcode);
$gender = stripslashes($gender);
if((!$artname) ¦¦ (!$password) ¦¦ (!$confirmpassword) ¦¦ (!$email) ¦¦ (!$country) ¦¦ (!$province) ¦¦ (!$city) ¦¦ (!$postalcode) ¦¦ (!$gender)){
echo '<h2><center><font color=red><strong>You did not submit the following required information!</strong></font></center></h2><br />';
if(!$artname){
echo "<h1><center><font color=red>Artist Name is a required field. Press back and enter it in.</strong></font></center></h1><br />";
}
if(!$password){
echo "<h1><center><font color=red>Create Password is a required field. Press back and enter it in.</strong></font></center></h1><br />";
}
if(!$confirmpassword){
echo "<h1><center><font color=red>Confirm Password is a required field. Press back and enter it in.</strong></font></center></h1><br />";
}
if(!$email){
echo "<h1><center><font color=red>Your E-mail is a required field. Press back and enter it in.</strong></font></center></h1><br />";
}
if(!$country){
echo "<h1><center><font color=red>Country is a required field. Press back and enter it in.</strong></font></center></h1><br />";
}
if(!$province){
echo "<h1><center><font color=red>Province(state) is a required field. Press back and enter it in.</strong></font></center></h1><br />";
}
if(!$city){
echo "<h1><center><font color=red>City is a required field. Press back and enter it in.</strong></font></center></h1><br />";
}
if(!$postalcode){
echo "<h1><center><font color=red>Postal Code(Zip code) is a required field. Press back and enter it in.</strong></font></center></h1><br />";
}
if(!$gender){
echo "<h1><center><font color=red>Gender is a required field. Press back and enter it in.</strong></font></center></h1><br />";
}
exit();
}
if($_POST['password']!= $_POST['confirmpassword']) {
die('<center><font color=red><strong>Error: The passwords do not match.</strong></font></center>');
}
if(strlen($_POST['password']) < 6 ) {
die('<center><font color=red>Error: Your password is too short. Must be 6 or more characters in length.</strong></font></center>');
}
$sql_email_check = mysql_query("SELECT email FROM peepsignup
WHERE email='$email'");
$email_check = mysql_num_rows($sql_email_check);
if(($email_check > 0)){
echo "<h1><center><font color=red><strong>Your email address has already been used by another member
in our database. Press back and submit a different Email address!</strong></font></center></h1>";
unset($email);
}
exit();
$db_password = md5($password);
$info2 = htmlspecialchars($info);
$sql="INSERT INTO peepsignup
(artname, email, country, province, city, postalcode, gender, password, info, signupdate)
VALUES
('$artname','$email','$country',
'$province', '$city', '$postalcode','$gender','$db_password','$info2', now())"
or die (mysql_error());
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
if(!$sql){
echo 'There has been an error creating your account. Please contact the webmaster.';
} else {
$userid = mysql_insert_id();
}
$subject = "Your Membership at!";
$message = "Dear $artname,
Thank you for registering at
To activate your membership,
please click here: [#*$!#*$!x.com....]
Once you activate your memebership, you will be able to login
with the following information:
Email Address: $email
Password: $password
Thanks!
The Webmaster
This is an auto response, please do not reply!";
mail($email, $subject, $message,
"From: me Webmaster<Webmaster@#*$!x.com>\n
X-Mailer: PHP/" . phpversion());
echo '<h2><center><font color=red><strong>You must activate your account before you can login.<br>
Your membership information has been mailed to your email address!<br>
Go to your Email in-box and follow the directions to activate your account!<br />
You should now close this window.</strong></font></center></h2><br>';
?>