Jump to content

ghqwerty

Members
  • Posts

    83
  • Joined

  • Last visited

    Never

About ghqwerty

  • Birthday 06/09/1994

Contact Methods

  • MSN
    rugbyismysoulx@hotmail.co.uk

Profile Information

  • Gender
    Male

ghqwerty's Achievements

Member

Member (2/5)

0

Reputation

  1. thanks mjdamato and dink i will add i lloop when i finish the code so it will do it for a infinite amount of letter/numbers thanks mjdamato although i'd really rather write it myself too learn from it however i will read yours and then try and make mine similiar to yours to see how it works. thanks
  2. well it is supposed to echo what you inputted and how many attempts it took to get this by trial and error so it checks a, if it is not a, it checks b and so on. then say it was z it would echo z and It took 26 attempts to get the correct word however if you try input 1 you get 01 It took 1000 attempts to get the correct word.1 It took 28 attempts to get the correct word. whereas it shoudl just be the bottom one
  3. done that however it is still the same. and im not trying to accomplish anything im just bored and thought it would be a good thing to try and break
  4. you could add your $emails into a session and then justuse $_SESSION['emails'] when you need them edit : can you not read my post ???? just do <?php $_SESSION['email'] = $emails; $_SESSION['cc'] = $cc; $_SESSION['bcc'] = $bcc; ?> and then on your popup page to save you having to write $_SESSION['email'] every time you need it just run $emails = $_SESSION['email'] ; $cc = $_SESSION['cc']; $bcc = $_SESSION['bcc'];
  5. ok so i was bored and decided to write a prgram that will be able to work out what you typed in and then say how many attempts it took to get this answer this is what i have so far <?php $letter = array(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); for($a=0; $a < 36; $a++){ if($letter[$a] == $_POST['text']){ echo $letter[$a]; $time = $a+1; echo "<br>It took ". $time ." attempts to get the correct word."; }else{ for($b=0; $b < 36; $b++){ $stringa = $letter[$a]."".$letter[$b]; if($stringa == $_POST['text']){ echo $stringa; $time1 = (36*($a+1))+($b+1); echo "<br>It took ". $time1 ." attempts to get the correct word."; } } } } ?> however if you check out the site www.blisswars.net23.net/skills.php and enter 1-9 it will come out all funny. as far as i can tell i think most of the rest works fine. can anyone see the problem ??? Edit : the link actually redirects to the right bit now
  6. i used floor() to get the number then took that away from the total to leave me with the decimal to * by 60 thanks
  7. but how would i select that decimal to * it by 60 ? so like 621/ 60 = 10.35. how would i select the .35 to * it by 60 which would = 21
  8. i use this formula for my users page $prev_page = $users - 1; echo "<tr><td colspan='3'>"; if($prev_page >= 1){ echo "<b><< <a href=users.php?users=$prev_page>Prev.</a></b>"; //if you are on page 2 or more display a previous link } if($totalpages <= 3){ //this is the pagination link for($i = 1; $i <= $totalpages; $i++){ echo "<a href='users.php?users=$i'> $i </a>| ";//if there are less than 3 pages just show 1|2|3 } }else{ $twobefore = $users-2; $onebefore = $users-1; $oneafter = $users+1; $twoafter = $users+2; //i prefer using a nested version as i understand it easuier you could just as easily use an elseif formula if($twobefore >= 1){ echo "<a href=users.php?users=1> 1 </a>"; echo "<a href=users.php?users=$twobefore> $twobefore </a>";//if you are on page 3 or more show a link to the previous 2 pages if($onebefore >= 1){ echo "<a href=users.php?users=$onebefore> $onebefore </a>";//if you are on page 2 or more show a link to the previous page echo "<a href=users.php?users=$user> $user </a>"; // show the link for the page you are currently on if($oneafter <= $totalpages){ echo "<a href=users.php?users=$oneafter> $oneafter </a>";// if you are more than 1 page off max pages show link to next page if($twoafter <= $totalpages){ echo "<a href=users.php?users=$twoafter> $twoafter </a>";// if you are more than 2 page off max pages show link to the next 2 pages if($twoafter < totalpages){ echo "...<a href=users.php?users=$totalpages> $totalpages </a>";//show a link to the last page } } } } } $next_page = $users + 1; if($next_page <= $totalpages) { echo"<a href=users.php?users=$next_page><b>Next</b></a> <b>>></b>";//next link } }
  9. i am soo confused. i am trying to devise a formula to work out how many minutes are in a lengthof time and store that in a variable and then store the leftover as a variable eg $timetowait = 621; //work out how many minutes (lots of 60) are in it in this case 10 $minutes = 10; //work out leftover $seconds = 21; however i cant think of a way to do this
  10. changed to $last_time = mysql_query("select last_extortion from members where id = '".$_SESSION['id']."'") or die(mysql_error()); $last_time1 = mysql_fetch_array($last_time); $last_time2 = $last_time1['last_extortion']; $last_time = strtotime($last_time2); $length = 10; $seconds_gap = $length * 60; if((time() - $last_time) > $seconds_gap){ but now whenever i try and extort someone i get 'You can only extort once every 10 minutes. You have to wait 1225107713 seconds.'
  11. now that the servers are back up i now have a 3rd problem lol im getting this error whenever i 'extort' someone Warning: strtotime() expects parameter 1 to be string, resource given in /home/a2350935/public_html/extortion.php on line 95 this is how im using it $last_time = mysql_query("select last_extortion from members where id = '".$_SESSION['id']."'") or die(mysql_error()); $last_time = strtotime($last_time); $length = 10; $seconds_gap = $length * 60;
  12. oo its back up now i also got a message in my database saying too much info needed - will keep an eye on this and change something if it happens again - thanks for the help
  13. yes i am - as i said it worked before and i havent changed anything and now it doesnt
  14. when i go to my login page i get this error Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mysql4.000webhost.com' (4) in /home/a2350935/public_html/conn.php on line 10 however i havent changed it for ages and it has been working fine up to now. this is line 10 $dblink = mysql_connect ("$servername","$dbuser","$dbpassword")or die('CONNECTION ERROR: Could not connect to MySQL'); and this is the whole code <?php //conn.php $servername='mysql4.000webhost.com'; $dbusername='why should i say ?'; $dbpassword='not telling you !'; $dbname='stop being so nosy!'; function connecttodb($servername,$dbname,$dbuser,$dbpassword){ global $dblink; $dblink = mysql_connect ("$servername","$dbuser","$dbpassword")or die('CONNECTION ERROR: Could not connect to MySQL'); mysql_select_db("$dbname",$dblink) or die ('Could not open database'.mysql_error()); } connecttodb($servername,$dbname,$dbusername,$dbpassword); ?>
×
×
  • 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.