Jump to content

dalerex

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dalerex's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi guys, thanks for the help so far. i've tried the above suggestions but it unfortunately did not work. any other things i should try? thanks.
  2. Hi All, I was wondering if anyone here can help me out. I'm in the process of creating a simple social networking website with some very basic code. I'm currently stuck at a point where if my users log in, I am not able to pass their credentials from one page to another. The session doesn't pass properly. I have attached the codes for your review. Please let me know what I'm doing wrong. Any and all help is appreciated. Thanks, dalerex [attachment deleted by admin]
  3. i'm sorry CV, but can you please provide more detail to your response? i'm a bit lost at what you said. thanks.
  4. hi all, as requested, i've attached the register-form.php for you guys. again, please bear with me since i am still new to the php game. thanks again for your help. [attachment deleted by admin]
  5. hi there, php noob here. i was wondering if someone could help me out of a jam here. i have a script that checks my form if my fields are properly filled or not. while it does indeed check the form, it does not return the errors back to the user so that he/she knows what was wrong. all the script does is it resets the form without telling the user what happened. any ideas? any and all help will be greatly appreciated. the code is below. please tell me what i did wrong. thanks. <?php session_start(); require_once('config.php'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } function clean($str) { $str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysql_real_escape_string($str); } $fname = clean($_POST['fname']); $lname = clean($_POST['lname']); $login = clean($_POST['login']); $password = clean($_POST['password']); $cpassword = clean($_POST['cpassword']); $city = clean($_POST['city']); $country = clean($_POST['country']); $month = clean($_POST['month']); $day = clean($_POST['day']); $year = clean($_POST['year']); $sex = clean($_POST['sex']); $designers = clean($_POST['designers']); $brands = clean($_POST['brands']); $mags = clean($_POST['mags']); $store = clean($_POST['store']); $have = clean($_POST['have']); $icon = clean($_POST['icon']); $style = clean($_POST['style']); $pants = clean($_POST['pants']); $shirts = clean($_POST['shirts']); $dress = clean($_POST['dress']); $shoe = clean($_POST['shoe']); if($fname == '') { $errmsg_arr[] = 'First name is missing'; $errflag = true; } if($lname == '') { $errmsg_arr[] = 'Last name is missing'; $errflag = true; } if($city == '') { $errmsg_arr[] = 'City is missing'; $errflag = true; } if($country == '') { $errmsg_arr[] = 'Country is missing'; $errflag = true; } if($sex == '') { $errmsg_arr[] = 'Sex is missing'; $errflag = true; } if($month == '') { $errmsg_arr[] = 'Month is missing'; $errflag = true; } if($day == '') { $errmsg_arr[] = 'Day is missing'; $errflag = true; } if($year == '') { $errmsg_arr[] = 'Year is missing'; $errflag = true; } if($designers == '') { $errmsg_arr[] = 'Designers missing'; $errflag = true; } if($brands == '') { $errmsg_arr[] = 'Brands missing'; $errflag = true; } if($mags == '') { $errmsg_arr[] = 'Magazines missing'; $errflag = true; } if($store == '') { $errmsg_arr[] = 'Favorite store missing'; $errflag = true; } if($have == '') { $errmsg_arr[] = 'Must Have missing'; $errflag = true; } if($icon == '') { $errmsg_arr[] = 'Icon missing'; $errflag = true; } if($style == '') { $errmsg_arr[] = 'Your Style missing'; $errflag = true; } if($pants == '') { $errmsg_arr[] = 'Pants size missing'; $errflag = true; } if($shirts == '') { $errmsg_arr[] = 'Shirt size missing'; $errflag = true; } if($shoe == '') { $errmsg_arr[] = 'Shoe size missing'; $errflag = true; } if($login == '') { $errmsg_arr[] = 'Login ID missing'; $errflag = true; } if($password == '') { $errmsg_arr[] = 'Password missing'; $errflag = true; } if($cpassword == '') { $errmsg_arr[] = 'Confirm password missing'; $errflag = true; } if( strcmp($password, $cpassword) != 0 ) { $errmsg_arr[] = 'Passwords do not match'; $errflag = true; } if($login != '') { $qry = "SELECT * FROM members WHERE login='$login'"; $result = mysql_query($qry); if($result) { if(mysql_num_rows($result) > 0) { $errmsg_arr[] = 'Login ID already in use'; $errflag = true; } @mysql_free_result($result); } else { die("Query failed"); } } if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; session_write_close(); header("location: register-form.php"); exit(); } $qry = "INSERT INTO members(login, passwd, firstname, lastname, month, day, year, sex, city, country, designers, brands, mags, store, have, icon, style, pants, shirts, dress, shoe) VALUES('$login','".md5($_POST['password'])."','$fname','$lname','$month','$day','$year','$sex','$city','$country','$designers','$brands','$mags','$store','$h ave','$icon','$style','$pants','$shirts','$dress','$shoe')"; $result = @mysql_query($qry); if($result) { header("location: register-success.php"); exit(); }else { die("Query failed"); } ?> added code tags ~ CV
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.