Jump to content

unidox

Members
  • Posts

    557
  • Joined

  • Last visited

    Never

Everything posted by unidox

  1. unidox

    While

    I have this code now: <?php $mysql_table = "cp_roster"; require_once ("inc/required.inc.php"); $result = MYSQL_QUERY("SELECT * FROM $mysql_table ORDER BY type ASC") or die (mysql_error()); $rows = mysql_num_rows($result); if ($rows == "0") { echo "<b>No Members in the roster database table.</b>"; } else { echo '<table border="0" align="center" cellpadding="0" cellspacing="3">'; $i = 0; while ($mysql=mysql_fetch_array($result)) { $i++; if ($i == 1) echo '<tr bgcolor="#2A3133">'; if ($mysql[image] !== "0") { ?> <td style="border: 1px solid rgb(42,49,52)"><a href="index.php?id=roster&roster_id=<?=$mysql[roster_id]?>"><img src="<?=$imagefilepath . 'rosterpic' . $mysql[roster_id] . '.' . $mysql['imagetype']?>" width="45" height="45" border="0" onmouseover="swapOnRoster('<?=$mysql[first]?>','<?=$mysql[last]?>','<?=$mysql[alias]?>')" onmouseout="swapOffRoster()"></img></a></td> <? } else { ?> <td style="border: 1px solid rgb(42,49,52)"><a href="index.php?id=roster&roster_id=<?=$mysql[roster_id]?>"><img src="pics/roster.gif" width="45" height="45" border="0" onmouseover="swapOnRoster('<?=$mysql[first]?>','<?=$mysql[last]?>','<?=$mysql[alias]?>')" onmouseout="swapOffRoster()"></img></a></td> <? } if ($i == 4) { echo '</tr>'; $i = 0; } } if ($i != 0) echo '</tr>'; echo '</table><div id="handleDivision"> <div align="center" id="rosterHandle">Select to view profile</div> <div class="clearBoth"></div></div>'; } ?> In the cp, I have added a divisions page so people can add like 1.6 and stuff, but I was wondering how I can go about doing that. In the table(cp_divisions) I have 2 rows, one for image, and one for name. I am trying so if there is no image it echos the text, but if there is an image, it echos the image. The problem is how will I manage the pagination and I think I would need another while in order to echo the images for the divisions. Can anyone help? Thanks in advance
  2. unidox

    Select

    My Code: if ($fieldtype[$i] == "selectb") { $r = mysql_fetch_array(mysql_query("SELECT * FROM `cp_divisions` ORDER BY division_id DESC")); $divis[] = $r['division']; echo "<select name=\"" . $field[$i] . "\">"; for ($o = 0; $o < count($r); $o++) { ?> <option value= "<?=$divis[$o]?>"> <?=$divis[$o]?> </option> </select> <? } } Works, but I have more than 1 in the table, how do I echo more than one?
  3. unidox

    Array

    This is my drop down code: if ($fieldtype[$i] == "select") { echo "<select name=\"" . $field[$i] . "\">"; $options = explode("&",$selectb); for ($o = 0; $o < count($options); $o++) { echo "<option value=\"" . $options[$o] . "\""; if ($mysql_values != '') { if ($mysql[$i] == $options[$o]) { echo " selected"; } } echo ">" . $options[$o] . "</option>"; }
  4. unidox

    Array

    My code: require_once ("files/roster.php"); $selecta = "Member&Co-Leader&Leader&Recruit"; $selectb = mysql_fetch_array(MYSQL_QUERY("SELECT * FROM cp_divisions ORDER BY division ASC")); The select b goes in a drop down, and I would like it to drop as many divisions are in the db, but theres only 1 and it says array. How do I echo the right thing?
  5. Well, I made a new page, heres the code: if ($_REQUEST['m'] == "1") { getHeader(); createJSValid($checkfields,$errors); createForm($titles,$fields,$type,$size,$maxlength,'2'); } if ($_REQUEST['m'] == "2") {; $div = remslash($_POST['div']); $image = remslash($_POST['image']); $check = MYSQL_QUERY("SELECT * FROM $mysql_table WHERE div='$div' || image='$image'") or die (mysql_error()); $rows = mysql_num_rows($check); if ($rows != 0) { showError('This division already exists!'); } else { MYSQL_QUERY("INSERT INTO $mysql_table (div,image) VALUES ('$div','$image')") or die (mysql_error()); showSuccess('Link Added'); header ("Location: index.php?page=admin_divisions"); } I am getting this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div='cs' || image='cs'' at line 1
  6. The error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''div') VALUES ('')' at line 1 The line of code: if ($_REQUEST['m'] == "16") { $div = remslash($_POST['div']); MYSQL_QUERY("INSERT INTO $mysql_table ('div') VALUES ('$div')") or die (mysql_error()); header ("Location: index.php?page=admin_roster");
  7. My code: if ($mysql[rosterpic] !== "0"){ ?> <td style="border: 1px solid rgb(42,49,52)"><a href="index.php?id=csroster&roster_id=<?=$mysql[roster_id]?>"><img src="<?=$imagefilepath . 'rosterpic' . $mysql[roster_id] . '.' . $mysql['imagetype']?>" width="45" height="45" border="0" onmouseover="swapOnRoster('<?=$mysql[first]?>','<?=$mysql[last]?>','<?=$mysql[alias]?>')" onmouseout="swapOffRoster()"></img></a></td> <? } else { ?> <td style="border: 1px solid rgb(42,49,52)"><a href="index.php?id=csroster&roster_id=<?=$mysql[roster_id]?>"><img src="pics/roster.gif" width="45" height="45" border="0" onmouseover="swapOnRoster('<?=$mysql[first]?>','<?=$mysql[last]?>','<?=$mysql[alias]?>')" onmouseout="swapOffRoster()"></img></a></td> <? } Works for the if part fine, but when I add someone to the roster without an image, it appears for like a second, then goes away. Whats wrong? Thanks in advance.
  8. Well, I got it to echo properly. But in ps I used the smooth option. How do I set that in css?
  9. So whats the script to do that?
  10. NO!@ I have the bg in a gif, with no text, but now I want to use the custom Bebas font in a table.
  11. No, what I have right now is a psd with a background and a text layer(Custom Bebas Font). WHat I want is to in a table use the psd background as the table bg, and echo the text with correct font. How do I do that?
  12. Yea, it works, but its all jagged. I used smooth in photoshop. How do I do that in css?
  13. I have an image .gif, with text in it, but I want there to be no text, and echo the text in php. Like say I have a .gif and it says Hello. I want to remove the Hello, so its just the bg. But the bg into a table, and echo out the text with correct font. The font is Bebas, so everyone might not have it. How can I do this?
  14. I did, and nothing worth wile came up.
  15. there is no error except it just forwards a bunch of times. Want my whole source?
  16. I have this in one of the includes: if(isset($_POST['reset'])) { mysql_query("UPDATE `cp_layout` SET info = 'roster,sponsors:matches,servers' WHERE type='layout';"); header("location: http://www.clanspage.net/index.php?page=admin_layout"); } else { $l1 = ($_POST['l1'] == "none" || $_POST['l1'] == "") ? "" : $_POST['l1'] . ","; $l2 = ($_POST['l2'] == "none" || $_POST['l2'] == "") ? "" : $_POST['l2'] . ","; $l3 = ($_POST['l3'] == "none" || $_POST['l3'] == "") ? "" : $_POST['l3'] . ","; $l4 = ($_POST['l4'] == "none" || $_POST['l4'] == "") ? "" : $_POST['l4'] . ","; $l5 = ($_POST['l5'] == "none" || $_POST['l5'] == "") ? "" : $_POST['l5'] . ","; $l6 = ($_POST['l6'] == "none" || $_POST['l6'] == "") ? "" : $_POST['l6'] . ","; $lc = substr("$l1$l2$l3$l4$l5$l6",0,strlen("$l1$l2$l3$l4$l5$l6")-1); $r1 = ($_POST['r1'] == "none" || $_POST['r1'] == "") ? "" : $_POST['r1'] . ","; $r2 = ($_POST['r2'] == "none" || $_POST['r2'] == "") ? "" : $_POST['r2'] . ","; $r3 = ($_POST['r3'] == "none" || $_POST['r3'] == "") ? "" : $_POST['r3'] . ","; $r4 = ($_POST['r4'] == "none" || $_POST['r4'] == "") ? "" : $_POST['r4'] . ","; $r5 = ($_POST['r5'] == "none" || $_POST['r5'] == "") ? "" : $_POST['r5'] . ","; $r6 = ($_POST['r6'] == "none" || $_POST['r6'] == "") ? "" : $_POST['r6'] . ","; $rc = substr("$r1$r2$r3$r4$r5$r6",0,strlen("$r1$r2$r3$r4$r5$r6")-1); $type = $lc . ":" . $rc; mysql_query("UPDATE `cp_layout` SET info = '$type' WHERE type='layout';"); header("location: http://clanspage.net/index.php?page=admin_layout"); But I dont think it will make much of a difference
  17. Thats what I dont get at all.
  18. I have some code: <?php if ($_COOKIE['uniqueid']) { ?> <?php global $levels; $a = $_COOKIE['access']; $pass = $_COOKIE['key']; $user = $_COOKIE['uniqueid']; $result = MYSQL_QUERY("SELECT * FROM cp_users ORDER BY user_id ASC") or die (mysql_error()); $rows = mysql_num_rows($result); $b = $mysql[access]; while ($mysql=mysql_fetch_array($result)) { if (($a == $mysql[access]) && ($pass == $mysql[password]) && ($user == $mysql[username])) { if ($a <= $levels[links]) { but I keep getting an error: The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. But I changed to: <?php if ($_COOKIE['uniqueid']) { ?> <?php if ("1" == "1") { if ("1" == "1") { So its obviously not the code underneath. Please help
  19. unidox

    Security

    If you want the code, look at the 1st post, I reverted everything back, cause it wasnt working. It redirects to the login page
  20. unidox

    Security

    I tried it, but it keeps redirecting. grrr. what am I doing wrong?
×
×
  • 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.