Jump to content

Deadmeat

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    csman8604
  • MSN
    Joestetz@comcast.net
  • Website URL
    http://www.teamredux.com

Profile Information

  • Gender
    Not Telling
  • Location
    va

Deadmeat's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yeah, uhm... why would you need to know this? Not to be rude or anything, but since they do not change unless added upon, the one you put there should be there 24/7
  2. $result = mysql_query(\"SELECT * FROM dvd WHERE title LIKE \'%title%\'\");
  3. i just use good ol\' notpad. I\'ll type all my code in, or what I know I want to change, then save the file. Then I refresh the browser page that shows the content locally.
  4. when posting the dir for a link, use ereg_replace(\" \", %20, $dir) [php:1:bfc4aa609f]<?php $result = mysql_query(\"SELECT url,dir,file FROM music WHERE singerid=5\"); while($singer=mysql_fetch_array($result)){ echo \'<a href=\'.$singer.\'/\'.ereg_replace(\" \", %20, $singer[dir].\'/\'.$singer[file].\'>\'.$singer[file].\'</a>\'; } ?>[/php:1:bfc4aa609f] What this does is replace all \" \" spaces with \"%20 in the given variable. %20 is the HTML code for space.
  5. I\'ll give it a shot, mind you I\'m a beginner still. [php:1:c5b8530f50]<?php $result = mysql_query(\"SELECT url,dir,file FROM music WHERE singerid=5\"); while($singer=mysql_fetch_array($result)){ echo \'<a href=\'.$singer.\'/\'.$singer[dir].\'/\'.$singer[file].\'>\'.$singer[file].\'</a>\'; } ?>[/php:1:c5b8530f50] I think this should work, if not, best of luck finding it out.
  6. my guess is use mt_rand(min, max) either use mt_rand() for each of the 7 digits, then combine them together, or use 1 mt_rand() for the whole thing (ie. mt_rand(1000000,9999999), if it allows numbers that large). I\'m a n00b myself, so don\'t assume this is the best way, because most likely it isnt. This should work though: [php:1:c904f12a77]<?php $array = array(mt_rand(1, 9), mt_rand(1, 9), mt_rand(1, 9), mt_rand(1, 9), mt_rand(1, 9), mt_rand(1, 9), mt_rand(1, 9)); $random = implode(\"\",$array); echo $random; ?>[/php:1:c904f12a77]
  7. Ahh, thanks. That helped a bunch.
  8. I don\'t understand.. I have input, my problem is that when I do not enter data, it will send NULL to the database. If it has something to do with \"value=$password\" then it will not work for me because my input page is an html file, separate from the php code.
  9. I have been stuck trying to fix my \"profile.php\" page for hours. I\'ve tried so many things, all with no luck. What I have is a login page. From there, users can change their passwords to whatever they\'d like. The script works just fine, except when they enter no data. I would like it to revert to the old password (ie. no changes occur to the database upon submitting) if they do not wish to make a change. Another option of this feature is allowing them to change one field (username only, not password), but without giving the field they leave blank a null value. My Code: if(!isset($_SESSION[\'username\'])){ echo "You must be logged in to change your profile."; include \'login_form.html\'; exit(); } $username = $_POST[\'username\']; $password = $_POST[\'password\']; $check_password = $_POST[\'check_password\']; $id = $_SESSION[\'id\']; if($password != $check_password){ echo "Your passwords do not match. Please enter them again."; include \'profile.html\'; exit(); } if((!isset($username)) || (!isset($password)) || (!isset($check_password))){ if(!isset($username)){ $username = $_SESSION[\'username\']; } if(!isset($password) && !isset($check_password)){ $password = $_SESSION[\'password\']; } } $password = md5($password); mysql_query("UPDATE users SET username=\'$username\' WHERE id=\'$id\'"); mysql_query("UPDATE users SET password=\'$password\' WHERE id=\'$id\'"); If I cannot get this to work, I suppose I could 1) fill in the current username for them, and 2)require a minimum password length (I should have anyway). I\'de rather try my first idea out though, so if you could, please help. Thanks so much.
×
×
  • 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.