help placing a couple lines of code within my script - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-19-2006, 09:02 PM   #1 (permalink)
Junior Member
 
alwaysinit's Avatar
 
Join Date: Aug 2006
Posts: 36
Default help placing a couple lines of code within my script

****THIS POST HAS BEEN EDITED PLEASE USE CORRECT TAGS WHEN POSTING CODE****
Hi, could someone show me where to put these lines of code within my script to make it work?(these few lines are intended to create a folder automatically for my musicians to store thier profiles.) Let me know if I'm doing it right.
Code to be placed:
PHP Code:
<?php 

$userid 
$POST['userid']; 

mkdir("/profiles/$userid"); 

$uploadpath 'profiles/$userid/'

?>
and now the register.php
PHP Code:
<?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 
'<center><font color=red><strong>You did not submit the following required information!</strong></font></center> <br />'
    if(!
$artname){ 
        echo 
"<center><font color=red>Artist Name is a required field. Please enter it below.</strong></font></center><br />"
    } 
    if(!
$password){ 
        echo 
"<center><font color=red>Create Password is a required field. Please enter it below.</strong></font></center><br />"
    }
    if(!
$confirmpassword){ 
        echo 
"<center><font color=red>Confirm Password is a required field. Please enter it below.</strong></font></center><br />"
    }
        if(!
$email){ 
        echo 
"<center><font color=red>Your E-mail is a required field. Please enter it below.</strong></font></center><br />"
    }
        if(!
$country){ 
        echo 
"<center><font color=red>Country is a required field. Please enter it below.</strong></font></center><br />"
    }
        if(!
$province){ 
        echo 
"<center><font color=red>Province(state) is a required field. Please enter it below.</strong></font></center><br />"
    }
        if(!
$city){ 
        echo 
"<center><font color=red>City is a required field. Please enter it below.</strong></font></center><br />"
    }
        if(!
$postalcode){ 
        echo 
"<center><font color=red>Postal Code(Zip code) is a required field. Please enter it below.</strong></font></center><br />"
    }
        if(!
$gender){ 
        echo 
"<center><font color=red>Gender is a required field. Please enter it below.</strong></font></center><br />"
    } 
   include 
'join_form.html';  
    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']) < ) {
     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'"); 
 
  
 if((
$email_check 0)){ 
     echo 
"<h2><center><font color=red><strong>Your email address has already been used by another member  
         in our database. Please submit a different Email address!</strong></font></center></h2>"
;
 if(
$email_check 0){ 
          echo 
"<h2><center><font color=red><strong>Press the back button in your browser to refill the form</strong></font></center></h2> "
         unset(
$email); 
     } 
      
     include 
'join_form.html';  
     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 webjedikungfumaster.'
} else { 
    
$userid mysql_insert_id();
}


    
$subject "Your Membership at Audiopeeps!"
    
$message "Dear $artname
    Thank you for registering at http://www.audiopeeps.com! 
     
    To activate your membership,  
    please click here: http://www.audiopeeps.com./activate.php?id=
$userid&code=$db_password 
     
    Once you activate your memebership, you will be able to login 
    with the following information: 
    Email Address: 
$email 
    Password: 
$password          
     
    Thanks! 
    The Webjedikungfumaster 
     
    This is an auto response, please do not reply!"

     
    
mail($email$subject$message,  
        
"From: audiopeeps Webmaster<Webmaster@audiopeeps.com>\n 
        X-Mailer: PHP/" 
phpversion()); 
    echo 
'<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!</strong></font></center><br>'
;
?>
Thanks you guys, I appreciate your help

Last edited by alwaysinit; 09-19-2006 at 10:06 PM.
alwaysinit is offline   Reply With Quote
Sponsored Links
Old 09-19-2006, 11:48 PM   #2 (permalink)
Junior Member
 
alwaysinit's Avatar
 
Join Date: Aug 2006
Posts: 36
Default Re: help placing a couple lines of code within my script

***this Topic Is Now Closed For Posting***
alwaysinit is offline   Reply With Quote
Old 09-28-2006, 04:20 AM   #3 (permalink)
Member
 
O~Snapple's Avatar
 
Join Date: Jul 2006
Location: Cali Breeze
Posts: 718
Send a message via MSN to O~Snapple Send a message via Skype™ to O~Snapple
Default Re: help placing a couple lines of code within my script

Always,
sorry i havent been around been traveling from coast to coast, do you still need assistance with this???

~Snapple
O~Snapple is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 03:23 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting