Jump to content

interpim

Members
  • Posts

    303
  • Joined

  • Last visited

    Never

Everything posted by interpim

  1. with the "Select One" listed it will always read it as having a value... perhaps leaving that out and not setting a selected value to the form will fix your problem
  2. if(!isset($_POST['favorite_entree[]'])){ error; } i think lol
  3. OK... the output is working again... but still showing current user in the table.... It would probably be easier to just to have the script I link to at the end check if it is current user and kick it back with "You cannot attack yourself" LOL.
  4. I did it both ways... with and without the if... still no output.
  5. try <form action='<?php echo $PHP_SELF; ?>'>
  6. If you want it to pop up while it's being typed... you will need some fancy Javascript or something... If you want it to have a "more..." when someone is reading it, then you could probably do something similar with pagination... maybe just a go to article link that will take you to the full article, and only read in the first x number of characters for the current page...
  7. in the last post I made... in the line for ($i=1970;$i<=2010;$i++) you can change those numbers to the limits of the years you want available. you could even make them dynamic by assigning variables pulling those from current date +3 years or something like that.
  8. breaking the output with that... code now is <?php include('config.php'); include('includes/functions.php'); loggedin_check(); $user=$_COOKIE['user']; mysql_connect($server,$username,$password); mysql_select_db($database) or die("unable to select database because ".mysql_error()); $query="SELECT * FROM main WHERE level > 0 ORDER BY level"; $result=mysql_query($query) or die("Problem with the query: <pre>$query</pre><br>" . mysql_error()); $num=mysql_num_rows($result); if ($num > 0) { echo "<center><table border='2'><tr><td>ID</id><td>NAME</td><td>LEVEL</td><td>WINS</td><td>LOSSES</td></tr>"; while ($row = mysql_fetch_assoc($result)) { if (($row['id'] == $user) ? ("")); echo '<tr><td>' . $row['id'] . '</td><td>' . $row['toon_name'] . '</td><td>' . $row['level'] . '</td><td>' . $row['win'] . '</td><td>' . $row['loss'] . '</td><td><a href="battle.php?atk=' . $row['id'] . '">ATTACK!</a></td></tr>'; } echo "</table></center>"; } ?>
  9. Add in something that will redirect the user back to the original form... then exit() the script...
  10. maybe Pagination will work? would require the user to click a next page or the like link, but would probably work if I understand your problem correctly
  11. Great that worked for not showing the less than 0 fields... Now, is there a way to keep the current user from being displayed? I tried putting an if statement that checked the cookie variable and not print that data... but it didn't work. <?php include('config.php'); include('includes/functions.php'); loggedin_check(); $user=$_COOKIE['user']; mysql_connect($server,$username,$password); mysql_select_db($database) or die("unable to select database because ".mysql_error()); $query="SELECT * FROM main WHERE level > 0 ORDER BY level"; $result=mysql_query($query) or die("Problem with the query: <pre>$query</pre><br>" . mysql_error()); $num=mysql_num_rows($result); if ($num > 0) { echo "<center><table border='2'><tr><td>ID</id><td>NAME</td><td>LEVEL</td><td>WINS</td><td>LOSSES</td></tr>"; while ($row = mysql_fetch_assoc($result)) { // THIS IS WHERE I PUT THE IF STATEMENT... BUT IT DIDN'T WORK echo '<tr><td>' . $row['id'] . '</td><td>' . $row['toon_name'] . '</td><td>' . $row['level'] . '</td><td>' . $row['win'] . '</td><td>' . $row['loss'] . '</td><td><a href="battle.php?atk=' . $row['id'] . '">ATTACK!</a></td></tr>'; } echo "</table></center>"; } ?>
  12. This is how I do it... mysql_connect($server,$username,$password); mysql_select_db($database) or die("unable to select database"); $query="SELECT * FROM main WHERE user_name='$user'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); if ($num!=0) { echo "That username has already been taken, please try again<br> <a href='register.php'>Register</a>"; exit(); }
  13. after mail($to,$subject,$body) add a semicolon ; and where does the $info[] array get filled?
  14. thanks for the input... I will have to try again later though... looks like my host just nuked my server... getting HTTP 400 error for several of my site folders.
  15. OK, basically I want to display everyone in the database, but only if the 'level' field is larger than 0. Well, this works fine for most of the database... but if the last entry in the database is 0, then it prints it anyways. Is there anyway around this? I tried adding an if statement before the last bit where I echo out the table rows, but it was killing the entire table, or still showing the same results... <?php include('config.php'); include('includes/functions.php'); loggedin_check(); mysql_connect($server,$username,$password); mysql_select_db($database) or die("unable to select database because ".mysql_error()); $query="SELECT * FROM main ORDER BY level"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); while ($row = mysql_fetch_assoc($result)) { echo "<center><table border='2'><tr><td>ID</id><td>NAME</td><td>LEVEL</td><td>WINS</td><td>LOSSES</td></tr>"; $i=0; while ($i < $num) { if (mysql_result($result,$i,'level')== 0) { $i++; } $id=mysql_result($result,$i,'id'); $name=mysql_result($result,$i,'toon_name'); $level=mysql_result($result,$i,'level'); $wins=mysql_result($result,$i,'win'); $loss=mysql_result($result,$i,'loss'); echo "<tr><td>$id</td><td>$name</td><td>$level</td><td>$wins</td><td>$loss</td><td><a href='battle.php?atk=$id'>ATTACK!</a></td></tr>"; $i++; } echo "</table></center>"; } ?>
  16. lol... i don't know what your code is, therefore have no help for you... google search for a help forum on your particular software.
  17. search your code for $_COOKIE and see if you can figure out what is wrong with that bit of code... then if you can't figure it out, post some of the code here for help, along with a description of what it is doing.
  18. you can change the last bit to give you more than just 2 years on the year select also... <select name="syear"> <?php for ($i=1970;$i<=2010;$i++) {?><?php echo "<option value=\"$i\""; if ($i == $year) echo " selected"; echo ">" .$i. "</option>"; } ?> </select></td>
  19. Is this what you are looking for? <?php $today = getdate(); $day = $today['mday']; // I have my personal ones default to yesterday, so $day -= 1; $month = $today['mon']; $mtharr = array("January","February","March","April","May","June","July","August","September","October","November","December"); ?> <table cellpadding="3" cellspacing="2" border="0"> <tr> <td valign="top"> <select name="sday"> <? for ($i=1;$i<=31;$i++) {?><? echo "<option value=\"$i\""; if ($i == $day) echo " selected"; echo ">$i</option>"; } ?> </select></td> <td valign="top"> <select name="smonth"> <? for ($i=1;$i<=12;$i++) {?><? echo "<option value=\"$i\""; if ($i == $month) echo " selected"; echo ">" . $mtharr[$i-1] . "</option>"; } ?> </select></td> <td valign="top"> <select name="syear"> <option value="2004">2004</option> <option value="2003">2003</option> </select></td> </tr> </table>
  20. why are you assigning data to an auto incrementing field?
  21. I don't see any header in the code you posted... is this the index.php file? You can't send ANY output to the page before a header file... if you do, you get that error.
  22. hmmm 50k+ queries every 60 seconds... you think it will get done with the first set before it has to start over from the beginning again?
  23. I am pretty sure that is a security setting built into some browsers nowadays... most people that have it, know how to see what they want to see.
  24. any help on the spacing out of an email? /n in the string didn't work LOL
  25. OK... i atleast fixed that first problem, i had double quotes in an echo statement instead of single quotes and it was killing the entire script... It is giving me an error now, saying that there is an undefined variable on line 41... which is $af=0; One more quick question... how would I echo new lines in an email body... the /n's I put into the body actually displayed in the email.
×
×
  • 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.