Jump to content

cmgmyr

Members
  • Posts

    1,278
  • Joined

  • Last visited

    Never

Everything posted by cmgmyr

  1. www.olm.net www.rackspace.com www.dreamhost.com I use these and they are great, PM if you have any questions
  2. *bump* anyone else?
  3. try <meta http-equiv=\"refresh\" content=\"3; " . $_GET['url'] . "\">
  4. I tried to do this (which i don't know if its right) $_SESSION['customers_id'] = $customers_id; $_SERVER['SSL_SESSION_ID'] = $customers_id; and this for my user checking function getUser(){ if(isset($_SESSION['customers_id'])) return $_SESSION['customers_id']; if(isset($_SERVER['SSL_SESSION_ID'])) return $_SERVER['SSL_SESSION_ID']; } It didn't work with this set up. Any ideas?
  5. even easier then that, you can just write a few lines scanning all of the files in each directory and inserting the data from there.
  6. Ok, i have a site that uses both http and https. I have the login on the http side and once I go to checkout items (in the https side) I get re-directed to the login page (which is supposed to happen when someone isn't logged on). I only get redirected in FF and Opera, IE works fine...go figure. Anyways...how can I use the same session information on both sides? Thanks, -Chris
  7. This should help you out: http://www.glish.com/css/7.asp
  8. haha ok, just figured I would ask since no one else did
  9. so the most important question...Was the girl hot?
  10. isn't the point of email supposed to be fast??? I don't want to play a game and go swimming everytime I want to send an email ...you must have to be pretty bored to use this.
  11. good advise roop. I have some more for you too. What I like to do is to think of what I use all the time. Like clean4DB for example. If I will be using a function a lot, or if it's something fairly complex I will put it into a class. Even something as simple as formatting numbers can help you a lot, and if you design them right they can be pretty helpful. For example I have function curFormat($price, $dec=2){ return number_format($price, $dec); } in that same functions class that I showed you earlier. So whenever I have a number that I want to format I use $func->curFormat($number); So if I do $number = 150; echo $func->curFormat($number); //echos 150.00 Now say I calculate how long a page takes to load. it would look like this $page_time = 0.005653133; echo $func->curFormat($page_time, 6); //echos 0.005653 See how you can easily adapt a simple function to apply to more then one purpose? if so...now you have the idea of OOP!
  12. Here is what I usually do... $rownum = 0; while($row = $db->fetch($result)){ //DB stuff here $tr = $rownum % 2; echo "<tr class=\"tr".$tr."\">"; //out put information echo "</tr>"; $x++; } in the css .tr0{ background-color:red; } .tr1{ background-color:white; } ...something like that, hope it helps
  13. http://www.acunetix.com/vulnerability-scanner/
  14. hmmm, I've always been called boy toy
  15. did you try to echo $site and see if it came up with anything?
  16. isn't it boy toy though?
  17. Then wouldn't you want this: }elseif($count == 1){ while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $site = $row['redirect_url'] ; echo "<META HTTP-EQUIV=Refresh CONTENT=\"2; URL=$site\">"; } } because if you have more then 1 row returned you want a link, not a refresh.
  18. i usually have a "functions" class that I have all of that misc stuff in. Here is a really simple example: <?php //This file holds the main functions class func{ //Clean user input for the DB queries function clean4DB($input){ $output = mysql_real_escape_string($input); return $output; } } $func = new func(); $string = "This is a member's bad input"; $cleaned = $func->clean4DB($string); //Now you can put $cleaned in a DB ?>
  19. }elseif($count == 1){ echo "<META HTTP-EQUIV=Refresh CONTENT=\"2; URL=http://google.com\">"; } you wouldn't want to put that in the else
  20. Here is another good site: http://www.tutorialized.com and there are a TON of other ones out there.
  21. echo "<META HTTP-EQUIV=Refresh CONTENT=\"2; URL=page.php\">"; This will go to page.php after 2 seconds.
  22. take a quick look at: http://www.stargeek.com/php_login_tutorial.php I changed a couple things around (not tested) but I think you will get the idea. <?php class login(){ function MakeTableLogins($database, $host, $db_user, $db_pass) {//create the logins table $linkID = mysql_connect($host, $db_user, $db_pass); mysql_select_db($database, $linkID); mysql_query("create table logins (user char(32), pasword char(32))", $linkID); } function Encrypt($string) {//hash then encrypt a string $crypted = crypt(md5($string), md5($string)); return $crypted; } function AddUser($database, $host, $db_user, $db_pass, $username, $password) { //add user to table logins $linkID = mysql_connect($host, $db_user, $db_pass); mysql_select_db($database, $linkID); $password = $this->Encrypt($password); $username = $this->Encrypt($username); mysql_query("insert into logins values ('$username', '$password')", $linkID); } function Login($database, $host, $db_user, $db_pass, $user, $password) { //attempt to login false if invalid true if correct $auth = false; $user = $this->Encrypt($user); $linkID = mysql_connect($host, $db_user, $db_pass); mysql_select_db("$database", $linkID); $result = mysql_query("select password from logins where user = '$user'", $linkID); $pass = mysql_fetch_row($result); mysql_close($linkID); if ($pass[0] === ($this->Encrypt($password))){ $auth = true; } return $auth; } } $l = new login(); $password = 'test12345'; $new_password = $l->Encrypt($password); echo "This is your new password: ".$new_password; ?> then you can apply it pretty much to anything else. Obviously you should clean up the functions alot, there's no reason to pass DB login information that many times...but I think you'll get it. hope that helps
  23. when you are using numbers you should usually do this: if($x == 0)... for the redirect use: header() or a meta refresh. Those might work a little better.
  24. This is a pretty good tutorial: http://www.tutorialspoint.com/php/php_object_oriented.htm and it's a little more involved then talking about dogs
  25. Yeah, you can check this out: http://www.phpfreaks.com/tutorial_cat/25/Page-Number--Pagination.php
×
×
  • 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.