Jump to content

BillyBoB

Members
  • Posts

    630
  • Joined

  • Last visited

    Never

Everything posted by BillyBoB

  1. um session load on the sever side so that would be like accessing a page wouldn't it if im wrong just call me stupid and we will be even:)
  2. do u have the folder that u want to move it too set to 777 if not u need to CHMOD that folder to 777
  3. wouldn't sessions like kill your bandwidth?
  4. i noticed there is no way to logoff are you building that?
  5. in the tutorials is a way to do the unique thing  too
  6. you dont have to make a database u can do it by a .txt file so installing mysql isnt absolutely necessary
  7. i think u scripted that weird try [code] <?php // we must never forget to start the session session_start(); if (!$link = mysql_connect('localhost', 'davessonicsite', 'password')){   echo 'Could not connect to mysql';   exit; } if (!mysql_select_db('davessonicsite', $link)){   echo 'Could not select database';   exit; } $errorMessage = ''; if (isset($_POST['txtUserId']) && isset($_POST['txtPassword'])) {     // first check if the number submitted is correct     $number  = $_POST['txtNumber'];         if (md5($number) == $_SESSION['image_random_value']) {       //  include 'library/config.php';       //  include 'library/opendb.php';                 $userId  = $_POST['txtUserId'];         $password = $_POST['txtPassword'];                     // check if the user id and password combination exist in database         $sql = mysql_query("SELECT * FROM chaoworld_b WHERE username = '$userId' ") or die(mysql_error()); //second change         $sql = mysql_fetch_array($sql);         if ($sql['password']==$password) { // I don't really know wat the PASSWORD($password) thing did so i left it out u can add it tho             // the user id and password match,              // set the session             $_SESSION['image_is_logged_in'] = true;             // remove the random value from session                        $_SESSION['image_random_value'] = '';                         // after login we move to the main page             header('Location: login.php');             exit;         } else {             $errorMessage = 'Sorry, wrong user id / password';         }               //  include 'library/closedb.php';     } else {         $errorMessage = 'Sorry, wrong number. Please try again';     }    } ?> <html> <head> <title>Basic Login</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php if ($errorMessage != '') {  // first change i dont like coding practice u used echo("<p align=\"center\"><strong><font color=\"#990000\">"); echo $errorMessage; echo("</font></strong></p> "); } ?> <form action="" method="post" name="frmLogin" id="frmLogin"> <table width="500" border="1" align="center" cellpadding="2" cellspacing="2">   <tr>   <td width="150">User Id</td>   <td><input name="txtUserId" type="text" id="txtUserId"></td>   </tr>   <tr>   <td width="150">Password</td>   <td><input name="txtPassword" type="password" id="txtPassword"></td>   </tr>   <tr>   <td width="150">Enter Number</td>   <td><input name="txtNumber" type="text" id="txtNumber" value="">     &nbsp;&nbsp;<img src="randomImage.php"></td>   </tr>   <tr>   <td width="150">&nbsp;</td>   <td><input name="btnLogin" type="submit" id="btnLogin" value="Login"></td>   </tr> </table> </form> </body> </html> [/code]
  8. say u wanted only usa to be allowed then dl usa database import it and then code a page like [code] <? function iptocountry($ip) {      $numbers = preg_split( "/\./", $ip);      include("ip_database.php");     $code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);      foreach($ranges as $key => $value){         if($key<=$code){             if($ranges[$key][0]>=$code){$two_letter_country_code=$ranges[$key][1];break;}             }     }     if ($two_letter_country_code==""){$two_letter_country_code="unkown";}     return $two_letter_country_code; } $IPaddress=$_SERVER['REMOTE_ADDR']; $two_letter_country_code=iptocountry($IPaddress); if ($two_letter_country_code=="US"){     echo("Access granted");     }else{     echo("Access Denied");       die();     } ?> [/code]
  9. http://www.phpfreaks.com/tutorials/62/0.php that starts but there are tutorials on http://www.phpfreaks.com/tutorials.php
  10. can i ask why you want to ban all people except for a few countries i dont really know how to ban all except a few tho
  11. um i dont really get your question but are u trying to ban ips from ur whole site if so are you using php and mysql (you dont need mysql but php) ?
  12. maybe try [code] <?php $dir = 'pending/apps/' . date('l \\t\h\e jS \of F Y g:i:s a').'/'; mkdir($dir); $file1 = $dir.basename($_FILES['snapshot']['name']); $file2 = $dir.basename($_FILES['userfile']['name']); $comments = $_POST['comments']; $commentsfile = fopen($dir . 'comments.txt','a+'); if (  (move_uploaded_file($_FILES['snapshot']['tmp_name'], $file1 )) && (move_uploaded_file($_FILES['userfile']['tmp_name'], $file2))  )         {             if  (    (filesize($file1) <= 20480) && (filesize($file2) <= 26214400 ) && fwrite($commentsfile,$comments)    )  {echo ("All your information has been uploaded successfully. One of our staff members will look it over and if it passes our inspection, it will be on as soon as possible. Thank you.");}else{echo("The File is too big or somthing");} } else { echo 'Something went wrong during the upload please go to our contact page and tell us what happened.';           unlink($file1);           unlink($file2); } ?> [/code] there that should work
  13. replace [code] @unlink($upload_dir."/$file"); [/code] with [code] @unlink($upload_dir."/".$file); [/code] i think that should work and don't post all the code of your page its in a sticky
  14. do you want them to display ordered by lastest or starting from 5 then to the end and then 1-4 ???
  15. nope that part works good please read the first post
  16. are you trying to make the numbers behind the decimal go away like if the number was 1.1111111111 and u want 1.11 thats called the float might look that up i havnt touched that in php before if thats not wat u need please inform me more :)
  17. can u inform me on wat an sms is ?
  18. well i cant find one for this exact script thing but here is a script to one in ajax http://bluga.net/projects/uploadProgressMeter/ PS: USE http://google.com its good :)  ;D
  19. so u want the registration and login on the same page if so this would be like an example: [code] <form method="POST"> <input type="text" name="name" size="10" /> <br /> <input type="password" name="pass" size="10" /> <br /> <input type="submit" name="login" Value="LOGIN" /> <br /> <br /> <input type="text" name="rname" size="10" /> <br /> <input type="password" name="rpass" size="10" /> <br /> <input type="password" name="rcpass" size="10" /> <br /> <input type="text" name="remail" size="10" /> <br /> <input type="submit" name="reg" value="REGISTER" /> </form> <?php if($_POST[login]) {   // then do this with the $_POST[name] and $_POST[pass] } if($_POST[reg]) {   // then do this with the $_POST[rname], $_POST[rpass], $_POST[rcpass], and $_POST[remail] { ?> [/code] plz notefy me if this helped i dont want to stay up all night thinking i didnt help u and your goin to reply :) :)
  20. ok let me see if i get this a little do u want to do the reg. and the login at the same time ? or do you want a pagnation ? with the get so that when they click it then it shows them the reg and by default it shows the login ? srry i typed that confusing .. :(
  21. ok heres the part of code that's giving me an error [code] <?php if($_GET[name]) //line 119 { $name = $_GET['name']; $query = mysql_query("SELECT * FROM programs WHERE programname = $name") or die(mysql_error()); $qarray = mysql_fetch_array($query); $count = $qarray['count']; $count = $count + 1; $update = mysql_query("UPDATE programs SET count = '$count' WHERE id = $qarray['id']") or die(mysql_error()); //line 126 echo(" <meta http-equiv=\"Refresh\" content=\"0; URL=http://dreamshowstudios.net/programs/$name.exe \" /> "); exit(); } //line 131 ?> [/code] but heres the error [code] Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/dreamsh/public_html/programs.php on line 126 [/code] Now this code is built on my programs page where if they click a program the url would be like http://dreamshowstudios.net/programs.php?name=PROGRAMNAME then i want it to add a number to the counter and send it to the database and then finally pop the download up :)
  22. i didnt ask for a reason just for ansers ;D
  23. thats not wat i mean i want to ban isps like dial up isps is there a way to ban isps?
×
×
  • 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.