Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. [code] <? function get_ip(){ if(!$ip=@$REMOTE_ADDR) $ip=$_SERVER['REMOTE_ADDR']; return $ip; } $ip=get_ip(); $result=mysql_query("SELECT * FROM bannedips WHERE `ip`='$ip' LIMIT 1"); if(mysql_num_rows($result)!=0) die("You Were Banned!"); ?> [/code]
  2. something to that effect maybe? [code] <?php foreach ($_FILES[images][name] as $img) { $ext123  = substr(strrchr($img, "."), 1); if(!($ext123 == "jpg") || ($ext123 == "jpeg") || ($ext123 == "gif")) $error[] = "ERROR"; else{   if(move_uploaded_file($_FILES["images"]["tmp_name"], $img)){   echo "Magazine Updated!";   }else $error[] = "ERROR"; } } ?> [/code]
  3. \n breaks the source code onto another line(right click, view source, you'll see...) br breaks the line itself thats shown on the webpage.
  4. try print_r($pictures); is the array got anything in it?
  5. try this... :-P thought that would happen... [code]echo "<META HTTP-EQUIV=\"refresh\" content=\"3; URL=?folder=".$folder."&num=".$num+1."\"></td></tr></table>";[/code]
  6. yup... ie reads <meta> tags top down, ff reads bottom up... scrap this [code] while($num < $total){ $num++; print "<META HTTP-EQUIV=\"refresh\" content=\"3; URL=?folder=".$folder."&num=".$num."\"></td></tr></table>"; } [/code] use this in its place [code] echo "<META HTTP-EQUIV=\"refresh\" content=\"3; URL=?folder=".$folder."&num=".$num."\"></td></tr></table>"; [/code]
  7. when in ff, go to the first picture, quickly right click the page, go to view source, what do you have in there for the [code] <META HTTP-EQUIV=\"refresh\" content=\"3; URL=?folder=".$folder."&num=".$num."\"> [/code] ? that'll tell you if its an issue with the redirecting, or where its a math issue... i also cleaned up your code a little :-) [code] <?php $folder = ("../cane-corso/images/gallery/"); $num = $_GET["num"]; if (empty($num)) $num=="1"; $dir = opendir($folder); print"<HTML><HEAD><TITLE>Cane Corso Slide Show</TITLE><META NAME=\"Author\" CONTENT=\"Ashley Byrne\"><META NAME=\"Keywords\" CONTENT=\"Image Gallery Slideshow\"><META NAME=\"Description\" CONTENT=\"\"><link rel=\"stylesheet\" href=\"style2.css\"></HEAD><BODY bgcolor=\"#FF99CC\"><center><table border=\"5\" cellspacing=0 cellpadding=0 width=\"100%\" height=\"100%\" bgcolor=\"#FF99CC\"><table bgcolor=\"#FF99CC\">"; $dir=opendir($folder); while ($a = readdir($dir)) if($a != "." && $a != ".." && $a != "text") $files[] = $a; $total = count($files)-1; $maxwidth="600"; list($width, $height, $type, $attr) = getimagesize($gallery.$folder.$files[$num]); if($width>$maxwidth){ $widthpc = round(($maxwidth/$width)*100); $width = round(($width*$widthpc)/100); $height = round(($height*$widthpc)/100); $attr="width=".$width." height=".$height; }else $attr="width=".$width." height=".$height; print "<tr><td><center><b>".substr($files[$num],0,-4)."</b>&nbsp;&nbsp;&nbsp;&nbsp;(". $num. " of ". $total.")</b></td></tr>"; print "<tr><td><center><img src=\"".$gallery.$folder.$files[$num]."\" ".$attr." border=1><br></td></tr>"; print "<tr><td><br><center><a href=\"javascript:parent.window.close()\"><font color=\"white\">--| End slideshow |--</a></td></tr>"; while($num < $total){ $num++; print "<META HTTP-EQUIV=\"refresh\" content=\"3; URL=?folder=".$folder."&num=".$num."\"></td></tr></table>"; } ?> [/code]
  8. $pictures=glob('images/*.jpg'); echo $pictures[rand(0,count($pictures)-1)];
  9. yes... you can md5 the password, use that... however... i suggest against that... putting the password out there only tells the users what type of encryption your using... and the less information you put out there about your encrypted passwords, the better.
  10. yes... confirm boxes are done in javascript, but php is server side... by the time the user see's the confirm box, the php has already finished its work. if you split the code up onto seperate pages, then php can have a confirm box. now if you used ajax, you can do that, because its javascript loading php, however the confirm box would be at the front of your script, [code]<script language="JavaScript"> function Confirmation() { var message = confirm("so you want to add customer"); if(message){   #ajaxcommand() } } </script>[/code] not in the middle. meaning you would want to break up your php anyways.
  11. if your wanting active content on one page, you will need ajax/js. php will not help here.
  12. i'd say it'd be something automatic from the mail server, not from the php itself...
  13. you can do that... or just use a random keygen [code] <? function randomkeys($length){ $pattern = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; for($i=0;$i<$length;$i++) $key .= $pattern{rand(0,62)}; return $key; } ?> [/code]
  14. 1) send them an email with a link to activatepage.php?key=biglongrandomhardtoguesskey, also put that key into the database, when they click on the link in the email, it takes them to that page, finds the random key from the database, and activates the account.
  15. php is preprocessed... meaning it will add anything/everything you tell it, before it goes to the browser. meaning a javascript confirm box is useless... if you want a prompt, you'd want something like this... [code] swicth($_GET[stage]){ case "1":   #first code here break; case "2":   #prompt break; case "3":   #continue here break; } [/code]
  16. you had "AS a " in the wrong spot... [code]$sql_actions = "SELECT SUM(a.goal) AS goals, COUNT(a.game_ID) as games, SUM(a.yellow_card) AS yellow, SUM(a.red_card) AS red, SUM(a.mins) AS mins, a.season_ID AS a FROM actions WHERE `players_ID`='$_GET[id]';[/code]
  17. i know i've done this before... and the error looks the same [code] require('../ktrack_inclusion.php'); #you must have the ' [/code] and if it is just an included file, you prolly wanna require_once(); ;-)
  18. no php would do that... maybe js?
  19. sure... thats up to you... using randomkeys() is just as easy :-)
  20. yes, md5 gives you 32 character cypher, if you want more/less/more secure, use this... [code] function randomkeys($length){ $pattern = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; for($i=0;$i<$length;$i++) $key .= $pattern{rand(0,62)}; return $key; } $key=randomkeys(rand(32,40)); echo $key; #display purposes [/code]
  21. its easier to just put it into the login form ;-) [code] $password=md5($_POST['password']); $result = mysql_query("SELECT * FROM users WHERE `username`='$_POST['username']' AND `password`='$password' LIMIT 1"); $row=mysql_fetch_array($result); if($active==0) die("Account Not Yet Active"); [/code]
  22. in your database, put a field for "active" varchar(1) default(0), and another "activekey" varchar(40) then when you sign up, you put in info into database [code] <? $key=randomkeys(40); mysql_query("INSERT INTO users(`activekey`) VALUES('$key')"); mail();#have $key link sent to the user function randomkeys($length){ $pattern = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; for($i=0;$i<$length;$i++) $key .= $pattern{rand(0,62)}; return $key; } ?>[/code] then on your activate page [code] mysql_query("UPDATE users SET active='1' WHERE key='$key'"); [/code]
  23. "this->" is for "class"es http://us2.php.net/manual/en/ref.classobj.php
  24. 1) they sign up, puts info into the database, deactivated, should also have an activation key 2) you'd want to look into the mail() function for the sending of emails. have a link in the email that uses the activation key to activate the account
×
×
  • 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.