Jump to content

only one

Members
  • Posts

    437
  • Joined

  • Last visited

    Never

Everything posted by only one

  1. On the random image try restricting the height/width depending on which is bigger rather than having it set to a fixed size. Check the http://php.net/getimagesize manual.
  2. 100% Self taught myself everything i know about computers.
  3. It isn't impossible, there are more than one ways of doing it. The easiest would be to use crontab.
  4. Because I wanted to be better at making websites than my brother .
  5. mysql_query("'DELETE FROM `members` WHERE `members`.`name` = '$user' LIMIT 1;") or die(mysql_error());
  6. Hi, I've been looking around and I can't seem to find a function that will allow me to open a folder and read all the folders inside it. Any help is apreciated, Thanks O1R.
  7. while ($hitpoints >= 1 and $ehitpoints >= 1) Change too: while ($hitpoints >= 1 && $ehitpoints >= 1) For the i don't see much point in adding the $eagility with the variable that it is set to. It is impossible for your variables to be losing their values. ---------- Try echoing the $ag1, $ag2 variables. Are they even set further up the code?
  8. mysql_query("SELECT * FROM `table` WHERE `date` < '$curdate'");
  9. Can we see your 'get_producthistory' function?
  10. Try something like: <?php $contents = file_get_contents("filename.sql"); mysql_query("$contents"); ?>
  11. What did you want to include? A complete pages contents? try something like this: <?php $message = file_get_contents("page.html"); mail('to@domain.com', 'Subject', $message); ?>
  12. If all of their email adresses are on seperate lines: <?php $message = 'message here..'; $lines = file('file.txt'); foreach ($lines as $line_num => $line) { mail('$line', 'subject', $message); } ?>
  13. if(isset($_POST['checkbox1'])) { setcookie("checkbox1", true) } if(isset($_POST['checkbox2'])) { setcookie("checkbox2", true) } etc.
  14. Try something like this: <?php $lines = file('test_read.txt'); foreach ($lines as $line_num => $line) { list($type, $value) = explode(" = ", $line); if($type == checkbox) { echo "<input type=\"checkbox\" name=\"userbox\" value=\"$value\" /> $value"; } } ?>
  15. <?php if (isset($_SESSION['player'])) { $player = $_SESSION['player']; if(isset($_POST['submit'])) { echo "<center>"; $userstats = "SELECT * FROM `ac_users` WHERE `playername` = '$player'"; $userstats2 = mysql_query($userstats) or die(mysql_error()); $userstats3 = mysql_fetch_array($userstats2); $heal = $_POST[heal]; echo "$heal"; if($userstats3['wood'] < 1) { echo "Not enough wood to produce that."; } else { if ($_POST['spell'] == 'Bows') { if($userstats3['numturns'] < 1) { echo "<center><font color=#FFFFF face=Verdana size=1>You need 1 Turns to produce that.<a href=index.php> Back</a>"; } else { $gain = rand(1,5); $sql = "UPDATE `ac_users` SET `bows`= bows+'$gain', `numturns` = numturns-1, `wood` = wood-1 WHERE `playername` = '$player'"; mysql_query($sql) or die("Can't Create Bows"); $totalgold = $gain + $userstats3['bows']; echo "<font color=#FFFFF face=Verdana size=1>You produced $gain bows"; } } } } } ?> <form action="../production/bows.php" method="post"> <select name="spell" length="20"> <option>Bows</option> </select> <p> <input type="submit" name="submit" value="Cast"> </p> </form> Don't forget PHP is case sensitive, you had bows instead of Bows in your if statment.
  16. $time = time() + 4500; //time + 75 minutes in seconds.
  17. I'll write it for you, maybe i wasn't clear with what i meant. $form = "<head><title>:::Subjects:::</title></head> <script src='ajax_files/prototype.js'></script> <script src='ajax_files/getSecond.js'></script> <body> <form action='subjects.php' method='get' enctype='multipart/form-data'> <table width='394' border='1' align='center' cellpadding='5' cellspacing='5'> <tr> <td>Programe Name:</td>"; $sql = "select programe_name from programmes"; $result = mysql_query($sql, $conn) or die (mysql_error()); while ($row = mysql_fetch_array($result)){ $add .="<option value='$row[programe_name]'>$row[programe_name]</option>"; } $form .= "<td> <select name='prog_name' id='prog_name' onchange='getSecond(this.value)'> <option value=''>--Select--</option> $add </select> </td> </tr> <tr> <td>Semester:</td> <td><span id=\"comboHint\">"; include('ajax_files/sublist.php'); // include "ajax_files/sublist.php"; $form .= "</span> </td></tr></table></form></body></html>"; sublist.php: <?php include "connection.php"; $prog_name = $_GET['prog_name']; $form .= "$prog_name"; $sql = "SELECT `programmes.no_of_semesters` FROM `programmes` WHERE `programmes.programe_name` = '$prog_name'"; $result = mysql_query($sql, $conn) or die (mysql_error()); while ($row = mysql_fetch_array($result)){ $semester .="<option value='$row[no_of_semesters]'>$row[no_of_semesters]</option>"; } $form .= "<select name='semester'> <option value=''>--Select--</option> $semester </select>"; ?>
  18. Why don't you rand and then strip the string, check the substr() manual: http://php.net/substr
  19. check the file() function: http://uk.php.net/file , there's a good example there.
  20. Yea, the date manual is actually very straight forward: http://uk.php.net/date $today = date("Y-m-d");
  21. Here's a quick solution: if ((empty($_POST['username'])) || (strtolower($_POST['username']) == 'admin')){
×
×
  • 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.