Jump to content

Lamez

Members
  • Posts

    1,686
  • Joined

  • Last visited

    Never

Everything posted by Lamez

  1. Are you getting errors? If you are using sessions, I don't see anything related to sessions. You also need to remember to add session_start();
  2. Easy. Take the input URL and make a hash out of it, md5();, store it in a database with a ID, URL, and md5 column. Then use a $_GET[] variable check the table for the same URL, if not, add it. Then pull the raw URL and pass it to the proxy. Make sense?
  3. no you need a and clause. SELECT * FROM $table WHERE col = 'val' AND col2 = 'val2' I think that is right.
  4. SELECT * FROM $table WHERE col = 'val'
  5. Oh sorry, the output of people, as expected, is "people". Thanks for fixing that function. I am still confused on why this is not working.
  6. Thanks for the advice, if you notice anything like that, please post it. Also, I thought I echoed out that variable. Should I include in the function variables?
  7. Okay I am getting slightly frustrated. It has been a long time, but I really think I am doing this right. If I was doing this right, then the code would compile. Here is another error I am getting: Here is the query: <?php $id = mysql_query("SELECT * FROM $_people")or die ("ID Query: ".mysql_error()); $id = mysql_num_rows($id) or die (mysql_error()); ?> Here is all of my code: <?php include($path."core/includes/db-config.php"); include($path."core/includes/wide-variables.php"); function clean($var){ $var = htmlspecialchars($var); $var = strip_tags($var); $var = mysql_escape_string($var); $var = trim($var); $var = mysql_real_escape_string(trim(strip_tags($var))); $var = htmlspecialchars($var,ENT_QUOTES); return $var; } function checkExist($table, $col, $var){ $q = mysql_query("SELECT * FROM $table WHERE $col = '$var' LIMIT 1")or die("Function Check Exist: ".mysql_error()); $n = mysql_num_rows($q); if($n == 0){ $return = false; }else if($n > 0){ $return = true; } return $return; } function RegisterUser($email, $first, $last, $pass1, $pass2){ $email = clean($email); $first = clean($first); $last = clean($last); $pass1 = clean($pass); $pass2 = clean($pass2); $check = checkEmail($email); $error = "Reg:"; if($pass1 === $pass2){ $error .= "0"; }else{ $error .= "1"; } if($check == true){ $check = checkExist($_people, "email", $email); if($check == false){ $error .= "0"; }else if($check == true){ $error .= "1"; } }else if($check == false){ $error .= "2"; } $first = strtolower($first); $last = strtolower($last); $pass = md5($id).sha1($pass).md5($first.$last); $id = mysql_query("SELECT * FROM $_people")or die ("ID Query: ".mysql_error()); $id = mysql_num_rows($id) or die (mysql_error()); if($error == "Reg:"){ mysql_query("INSERT INTO ".$_people." (id, email, first, last, password) VALUES ('".$id."', '".$email."', '".$first."', '".$last."', '".$pass."')")or die("Function Check Register: ".mysql_error()); return 0; }else{ return $error; } } function checkEmail($email){ if(preg_match("/[.+a-zA-Z0-9_-]+@[a-zA-Z0-9-]+.[a-zA-Z]+/", $email) > 0){ $pass = true; }else{ $pass = false; } return $pass; } ?> Any ideas? Oh ya, as you can see, I did use mysql_real_escape_string() -Thanks Guys, maybe I am just overlooking something
  8. Hello All, I am running a local server with MySQL and PHP 5. I am trying to do something like this: <?php function checkExist($table, $col, $var){ $q = mysql_query("SELECT * FROM $table WHERE $col = $var")or die("Function Check Exist: ".mysql_error()); $n = mysql_num_rows($q); if($n == 0){ $return = false; }else if($n > 0){ $return = true; } return $return; } ?> However I get errors like this: Maybe I am rusty, or there is a unclear error in my syntax. Any ideas? Thanks!
  9. Press F5, if the folder actually exists, it will still be there. Open the command prompt with admin privileges, then delete it that way. (del foldername)
  10. Lamez

    wtf???

    Turn off the television, shut the door, close the window, and shutoff any noise making annoyance excluding the sound on your laptop. Plug some headphones into the headphone jack on the machine, and see if you can still hear it. If so, save all work and restart. Run a virus scan, if a virus is found, do as follows: 1.Turn off laptop 2.Grab nearest bottle of gas and match 3.Find a metal waste bin (or anything of that nature) 4.Toss laptop into bin, and spray the gas over it and light the match and add it to the concoction. 5.Buy cheap IBM Thinkpad, format the HDD and install a form of Linux. 6.Done!
  11. The Answer
  12. Lamez

    Mac Vs PC

    I think that Mac and Microsoft make two decent operating systems. I have played around with both, and I think both of them needs tons of work. Microsoft being widely know, is the most bashed on. However they do contain a lot of security flaws. The only secure OS out there that I know of is Linux. If it becomes popular like windows, you might see some more security flaws within (just because someone is looking), and viruses will be more common. But, if you are using Linux, chances are you know a little about PCs, and you keep yourself protected. I think that all three Operating Systems have some good things, and some bad things. I just prefer Ubuntu 9+\Debian
  13. or porn.
  14. lol, I love this blog. I like the one with duck.
  15. When I first saw the billboard, I noticed the small ad first. I am not too why, but in the end that was funny.
  16. Lol, I wonder if that guy got fired, I doubt it. They probably promoted him.
  17. I use to use SMF, and I loved it. I tried tons of different forum software, and I did not like any of them. They did not have the features I wanted, and I ran into compatibility problems. Simple Machine Forums is the way to go!
  18. You can do that, or you can install dd-wrt: http://www.dd-wrt.com/dd-wrtv3/dd-wrt/hardware.html
  19. Lamez

    Whacky HTML !

    Ha I read this post way back, then last night I was on reddit and I found this: http://b3ta.com/links/355881 That is really cool
  20. Lamez

    Whacky HTML !

    lol, I like scrolling really fast.
  21. Um, to make things simpler. I do this all the time at work, teachers change the administrator account, and us Technology guys need it so I change it back through the command prompt. Open the Command Prompt, Start > RUN (or Windows Key + R) and type CMD Then type, net user account_name_here * Then it will ask you for your password, then type it in, it will not show anything, just keep typing then push enter. Then re-type it. and Bam, logout and log back in. Okay so I just re-read your post, and you cannot login at all. You can also try re-booting and before the windows loading screen, press F8 and go into safe mode with command prompt. Also, you need to burn the ISO with a special ISO program. Also make sure in your boot priorities you have CDROM before your HDD. That way during the bootstrapping process the BIOS finds the CD's MBR before it finds the Hard Drive's. Hoped I could help!
  22. Oh man. I have: 2 servers 1 Laptop 2 Desktops That is 5 total. That is just mine. In the entire house we have: 2 servers 2 laptops 3 desktops That is 7 total. And this does not include the ones I have set aside for spare parts, and experiments. I also am buying another laptop for my dad.
  23. Okay, so you are saying I should add the row, then get the ID from the database?
  24. Okay I am doing some finishing touches on this script. It is a review script. Here is how it works: 1.User Types a Review 2.Script sends out a email verification to user 3.After email is verified, Review goes into pending, and sends a email to admin 4.Admin either accepts review, or denies it. 5.Script sends out a email to the user telling them they have been accepted or denied. Telling you guys how this works, might help you help me. In the script, after step 1 it adds a record to the database, but I need to know the id before it is added for the URLs, so I made a function that generates the ID from getting the last entry plus one. Here is that function: <?php function getId(){ $q = mysql_query("SELECT MAX(id) FROM `reviews`"); $f = mysql_fetch_array($q); return $f['0']+1; } ?> Does my systems with the IDs sound stable, or should I go a different route of some sorts?
  25. Awesome, that did the trick! -Thanks
×
×
  • 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.