jblack
Members-
Posts
48 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by jblack
-
The solution was to set the parent element containing the drop down menu to position: relative and then use left: 0 on the .dropMenu class. In the HTML above I denoted where everything was pushed down.
-
Well, I fixed it through other means, cleaned up a lot of junk that was lying around from numerous failed attempts. In the end I changed to using <div> and <span> and cleared everything up.
-
Essentially what's going on is I've created 2 drop down menus and the drop down menu with the most items pushes the content I want to put in the body of my table down. I've thrown various things at it and am yet to succeed in correcting this problem. I've read around and, though I may be totally off, what I understand is that the z-index of the parent element is affecting this. I am at a loss as of now and have finally come to ask the question. Here's what I've got for you: <style> body { background-color: #000000; color: #8c8c8c; margin: 0; } table.main { background-color: #0a0a0a; border: 0px; padding: 0px; width: 960px; height: 100%; border-spacing: 0px; } td.banner { height: 175px; } td.navbg { background-image: url("images/ccNavBG.gif"); height: 32px; } table.nav { border: 0px; padding: 0px; border-spacing: 0px; margin-left: auto; margin-right: auto; position: relative; } .dropMenu { background-color: #0a0a0a; width: 98px; visibility: hidden; z-index: 5; color: 8c8c8c; border-left: 1px solid #141414; border-right: 1px solid #141414; border-bottom: 1px solid #141414; display: block; position: absolute; } a { text-decoration: none; } table.adminBar { position: fixed; z-index: 3; right: -128px; width: 160px; height: 192px; padding: 0px; border-spacing: 0px; top: 25% } td.adminBarBG { width: 32px; background-image: url("http://crimsoncourt.hollosite.com/design2/images/adminBarBG.gif"); background-repeat: repeat-y; } td.adminNav { background-color: #0a0a0a; width: 128px; } span.adminHead { text-align: center; width: 128px; padding: 0px; font-size: 110%; } ul.adminFunc { list-style-type: none; padding: 0px; } table.content { padding: 0px; width: 900px; } span.contentHeader { margin-left: 32px; width: 300px; font-size: xx-large; } table.container { border: 1px solid #8c8c8c; border-radius: 10px; position: relative; z-index: 1; } td.news { width: 350px; padding: 32px; height: 200px; } td.poll { width: 200px; padding: 32px; } span.tags { font-size: x-small; } </style> And the HTML: <table class="main" align="center"> <tr> <td class="banner"><img src="images/ccBanner.gif"/></td> </tr> <tr> <td class="navbg" align="center"> <table class="nav"> <tr> <td><a href="index.php"><img src="images/navHome.gif" /></a></td> <td onmouseover="menuShow(1)" onmouseout="menuHide(1)" style="position: relative;"><a href="clan.php"><img src="images/navClan.gif" /></a> <table class="dropMenu" id="1"> <tr> <td><a href="clan.php?action=about">About</a></td> </tr> <tr> <td><a href="clan.php?action=members">Members</a></td> </tr> <tr> <td><a href="clan.php?action=mypage">My Page</a></td> </tr> <tr> <td><a href="clan.php?action=myfiles">My Files</a></td> </tr> <tr> <td><a href="clan.php?action=rules">Rules</a></td> </tr> </table> </td> <td onmouseover="menuShow(2)" onmouseout="menuHide(2)" style="position: relative;"><a href="events.php?action=current"><img src="images/navEvents.gif" /></a> <table class="dropMenu" id="2"> <tr> <td>- <a href="events.php?action=new">New</a></td> </tr> <tr> <td>- <a href="events.php?action=current">Current</a></td> </tr> <tr> <td>- <a href="events.php?action=auction">Auctions</a></td> </tr> </table> </td> <td><a href="chat.php"><img src="images/navChat.gif" /></a></td> <td><a href="forums/"><img src="images/navForums.gif" /></a></td> <td><a href="games.php"><img src="images/navGames.gif" /></a></td> <td><a href="contact.php"><img src="images/navContact.gif" /></a></td> <td><a href="gallery.php"><img src="images/navGallery.gif" /></a></td> </tr> </table> </td> </tr> <tr><td> here is where all the content is pushed down <table class="content" align="center"> <tr> <td><span class="contentHeader">News</span></td> </tr> <tr> <td> <table class="container"> <tr> <td class="news"> <b>Update: Site Status</b><br /> <span class="tags">Posted 11/14/2013</span><br /><br /> Content going in here </td> <td class="poll"> stuff going in here </td> <td class="news"> stuff going in here </td> </tr> </td> </table> </table> </td></tr> </table>
-
*Edit -- After working at it I figured my problem out. I made a terrible mistake.
-
LOL its the city council... I was thinking of making it semi transparent anyway...Thanks, I'll see what I can do.
-
Ok, so my town's Chamber of Commerce website is crappy and I get to fix it up. I have no I dea how to make this work, sincethey're requiring me to use this image as a background image on the first page:What should I do?
-
Alright, it only downloads in IE for me. In Fire Fox I get: Fatal error: Call to undefined function: mysql_connect() in /home/www/etherea.obliviousrealms.com/includes/db.php on line 7Which I shouldn't get, because I've never had any problem with it in a .html file or a .php file.
-
Now it just makes it download the file...how do I fix this?
-
I want to use php in .eae file extensions, but I can't figure this out. I was told to use an htaccess AddHandler command and this is what I did, but it doesn't work:AddHandler cgi-script .eaeAnd yes, I do have htaccess on my server. Is htaccess the way to go, or is there a different way to do this?
-
...But how does the actual "->" work?
-
I have seen -> in many online scripts and I'm just wondering how that works, I'm not all that new to php, but I haven't been able to figure this out.
-
its just in a text file
-
Ok, so I want to know how I would use a person's recorded IP address with $REMOTE_ADDR to authenticate in cooperation with sessions. I know how to insert data and update with php into Mysql databases, but how would I auth people based on their IP recorded in the database?
-
Alright...I don't quite understand what your saying. You shouldn't even need php to popup an error box. you could do something like this: <HTML> <HEAD> <TITLE>Register</TITLE> <script> function doCheck() { int username = document.forms[0].elements[0].value; int password = document.forms[0].elements[1].value; int email = document.forms[0].elements[2].value; if(username == '' || password == '' || email == '') { alert("All fields are required!"); } else { document.forms[0].submit(); } } </SCRIPT> </HEAD> <BODY> <TABLE ALIGN="center" WIDTH="50%"> <TR> <TD> <FORM ACTION="doRegister.php" METHOD="Post"> Username: </TD> <TD> <INPUT TYPE="text" name="username"> </TD> </TR> <TR> <TD> Password: </TD> <TD> <INPUT TYPE="text" name="password"> </TD> </TR> <TR> <TD> Email: </TD> <TD> <INPUT TYPE="text" name="email"> </TD> </TR> <TR> <TD colspan=2 align="center"> <INPUT TYPE="button" VALUE="Register" onClick="doCheck()"> </TD> </TR> </TABLE> </BODY></HTML> I wouldn't recommend using this though. It's not always secure and can be edited and changed and used from a person's desktop. A good thing to do with this is check your referrer on the doRegister.php page.
-
Alright, I'm trying to find out how to do this, I can't figure it out though. It has to unscrable 10 words and put it in the order like: word1, word2, word3... It comes from a wordlist.*Also unrelated: how to make it so a url like http://www.mysite.com/dir/2/ would be redirected to thispage.php? or would I just have to make thispage.php=index.php?
-
Alright, so I cut out everything that isn't important.What happens here is that it doesn't send the email, I've echoedthe script out to see whats up with it, but I still can't find out whyit won't email. I do have my own email to be sent from also, sodon't crit me about that. It worked fine a little bit ago, but it stoppedall the sudden and I can't figure out why... <?$from = "no-reply@etherea.obliviousrealms.com";$subject = "Etherea Web Activation"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "From: Web Master $from \n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";$message = "Thank you for registering at Etherea Web, $username.<br>";$message .= "The following is the information you registered with: <br>";$message .= "<b>Username:</b> $username <b>Password:</b> $password <br><br>";$message .= "Your account is not currently activated. Click the following link to activate your account:<br>";$message .= "<a href='http://etherea.obliviousrealms.com/activation.php?name=$username&code=$code'>http://etherea.obliviousrealms.com/activation.php?name=$username&code=$code</a>";if(mail($email,$subject,$message,$headers)) {echo "You have successfully registered. An email is being sent to you for activation of this account.<br>";}}?>
-
here's a little better example...Use this to create your table: CREATE TABLE `members` (`id` INT( 5 ) NOT NULL AUTO_INCREMENT ,`username` VARCHAR( 20 ) NOT NULL ,`password` VARCHAR( 20 ) NOT NULL ,PRIMARY KEY ( `id` ) ) TYPE = MYISAM; Here's the registration code: <?php// Made by Jeremy Black. Put my name in this if you use it.$mysql_user = 'user';$mysql_pass = 'pass';$mysql_host = 'host';$connect = mysql_connect($mysql_host,$mysql_user,$mysql_pass) or die("Could not connect. " . mysql_error());$db_select = mysql_db_select($mysql_user, $connect) or die("Could not select database. " . mysql_error());$page = $_POST['page'];if($page != 1) {?><html> <head> <title>Registration</title> </head> <body> <table align="center" width='50%'> <th><center><b>Register</b></center></th> <tr> <td> <pre><form method="POST">Username: <input type="text" name="username">Password: <input type="password" name="password">Verify Password: <input type="password" name="vpassword"></form><input type="hidden" name="page" value="1"> </pre><?php}else {?><html> <head> <title>Registration</title> </head> <body> <table align="center" width='50%'> <th><center><b>Register</b></center></th> <tr> <td><?php$username = $_POST['username'];$password = $_POST['password'];$vpassword = $_POST['vpassword'];if($username == '' || $password == '' || $vpassword == '') { echo "All fields are required!"; echo " <a href=java script:history.go(-1)>Click Here</a> to go back.";}if($password != $vpassword) { echo "Passwords do not match!"; echo " <a href=java script:history.go(-1)>Click Here</a> to go back.";}else { $query = "INSERT into members id,username,password VALUES ('','$username','$password'); $result = mysql_query($query) or die("Could not run query. " . mysql_error()); echo "You have successfully registered! <a href='login.php'>Click here</a> to login.";}?> </td> </tr> </table> </body></html>
-
Alright... so here's my full code, now the other stuff works, but what doesn't work is the updating ofthe database to give you xp. here's the code (look at near the bottom); <?phpinclude('database.php');$page = $_REQUEST['page'];if($page == "login") { $username = $_POST['username']; $password = $_POST['password']; if($username == '' || $password == '') {?><table align="center" width="75%" style="border: #8D6D4D 1px solid;"> <tr> <td bgcolor="#d2b038" align="center"><b>ERROR!</b></td> </tr> <tr> <td bgcolor="#e3cc80" align="center">You must enter a username and password!</td> </tr></table><?php die; } $q = "SELECT username FROM Arena WHERE username = '$username' AND password = '$password'"; $result = mysql_query($q); if(mysql_num_rows($result) == '1') { setcookie('user',$username,84000); header('location: index.php?file=mfront'); } else {?><table align="center" width="75%" style="border: #8D6D4D 1px solid;"> <tr> <td bgcolor="#d2b038" align="center"><b>ERROR!</b></td> </tr> <tr> <td bgcolor="#e3cc80" align="center">Your username/password is nonexistent or invalid!</td> </tr></table><?php }}if($page == 'logout') {setcookie('user',null,-1);header('location:index.php?file=front');}if($page == 'fight1') {$usercookie = $_COOKIE['user'];$rmonster = mt_rand(1,2);$q = "SELECT name,hits,strength,accuracy,defense,xp FROM Arena_Monsters WHERE id = '$rmonster'";$fight = mysql_query($q);$row = mysql_fetch_row($fight);$monster = $row[0];$mhits = $row[1];$mstrength = $row[2];$maccuracy = $row[3];$mdefense = $row[4];$mxp = $row[5];?><table align="center" width="75%" style="border: #8D6D4D 1px solid;"> <tr> <td bgcolor="#d2b038" align="center"><b>FIGHT!</b></td> </tr> <tr> <td bgcolor="#e3cc80" align="center"><?php echo "Monster name: " . $monster . "<p />";echo "Hits: " . $mhits . "<p />";echo "Strength: " . $mstrength . "<p />";echo "Accuracy: " . $maccuracy . "<p />";echo "Defense: " . $mdefense . "<p />";echo "XP: " . $mxp . "<p />";echo "<hr>";$q2 = "SELECT username,hits,strength,accuracy,defense,xp FROM Arena WHERE username = '$usercookie'";$character = mysql_query($q2);$row2 = mysql_fetch_row($character);$fighter = $row2[0];$hits = $row2[1];$strength = $row2[2];$accuracy = $row2[3];$defense = $row2[4];$xp = $row2[5];echo "Username: " . $fighter . "<p />";echo "Hits: " . $hits . "<p />";echo "Strength: " . $strength . "<p />";echo "Accuracy: " . $accuracy . "<p />";echo "Defense: " . $defense . "<p />";echo "<hr>";while($hits > 0 && $mhits > 0) {if($strength < 5) {$rndhit = mt_rand(1, 2);$rndhit = $rndhit + round(($accuracy / 2));}elseif($strength > 4 && $strength < 10) {$rndhit = mt_rand(1, 4);$rndhit = $rndhit + round(($accuracy / 2));}elseif($strength > 9 && $strength < 20) {$rndhit = mt_rand(1, 7);$rndhit = $rndhit + round(($accuracy / 2));}elseif($strength > 19 && $strength < 40) {$rndhit = mt_rand(1, 11);$rndhit = $rndhit + round(($accuracy / 2));}elseif($strength > 39 && $strength < 80) {$rndhit = mt_rand(1, 16);$rndhit = $rndhit + round(($accuracy / 2));}else {$rndhit = mt_rand(1, 22);$rndhit = $rndhit + round(($accuracy / 2));}$mon1hit = mt_rand(1, 3);echo $usercookie . " hits a " . $rndhit . " on " . $monster . ".<p>";$mhits = $mhits - $rndhit;echo $monster . " hits a " . $mon1hit . " on " . $usercookie . ".<p>";$hits = $hits - $mon1hit;echo "<b>" . $usercookie . "</b>: " . $hits . " <b>" . $monster . "</b>: " . $mhits;echo "<hr>";}if($hits < 1) {echo "The " . $monster . "has killed you!";echo "You have died. You will be automatically revived when you<p>";echo "go <a href='index.php?file=mfront'>here</a>";}if($mhits < 1) {echo "You have killed a " . $monster . ". You have gained " . $mxp . " experience.<p>";echo "You have also earned " . $rndgold = mt_rand(1,13) . " gold.";$q3 = "UPDATE Arena SET xp = 'xp + $mxp',gold = '$rndgold' WHERE 'username' = '$fighter'";$run = mysql_query($q3) or die("Could not run query.");}?></td> </tr></table><?php } ?>
-
Thanks...I'll try that, though I have no doubt that is what it is.EDIT -> Now the monster dies, but I still hit high numbers, even with the quotes gone.
-
Ok... so I'm making a huge arena type script to deal with levels and monsters and xp and such... The registration and logging in works fine... The members list works fine. But I can't get the core of it down. The fighting comes out with really wierd things...Ok so my strength in this program is 1, just use that as a variable and remember it. The problem I have with it though is that I hit really obscenely high numbers and the enemy monster can have like -58 hp and the fight still will not end. The fight only ends when your own fighter dies...Also, I hit the high numbers as 21...Anyway lets get on with the show here's the code, minus some things that deal with the login, registration, logout, etc...*One more thing, the mysql database looks like this:FIELD TYPE NULL DEFAULTid int(5) No username varchar(15) No password varchar(20) No email varchar(30) No hits int(3) No 10 strength int(100) No 0 accuracy int(100) No 0 defense int(100) No 0 race varchar(20) No faction varchar(20) No rank varchar(50) No gold int(11) No 0 xp int(5) No 0 <?phpinclude('mydatabaseinfo.php');if($page == 'fight1') {$usercookie = $_COOKIE['user'];$rmonster = '1';$q = "SELECT name,hits,strength,accuracy,defense FROM Arena_Monsters WHERE id = '$rmonster'";$fight = mysql_query($q);$row = mysql_fetch_row($fight);$monster = $row[0];$mhits = $row[1];$mstrength = $row[2];$maccuracy = $row[3];$mdefense = $row[4];$mxp = $row[5];?><table align="center" width="75%" style="border: #8D6D4D 1px solid;"> <tr> <td bgcolor="#d2b038" align="center"><b>FIGHT!</b></td> </tr> <tr> <td bgcolor="#e3cc80" align="center"><?php echo "Monster name: " . $monster . "<p />";echo "Hits: " . $mhits . "<p />";echo "Strength: " . $mstrength . "<p />";echo "Accuracy: " . $maccuracy . "<p />";echo "Defense: " . $mdefense . "<p />";echo "<hr>";$q2 = "SELECT username,hits,strength,accuracy,defense,xp FROM Arena WHERE username = '$usercookie'";$character = mysql_query($q2);$row2 = mysql_fetch_row($character);$fighter = $row2[0];$hits = $row2[1];$strength = $row2[2];$accuracy = $row2[3];$defense = $row2[4];$xp = $row2[5];echo "Username: " . $fighter . "<p />";echo "Hits: " . $hits . "<p />";echo "Strength: " . $strength . "<p />";echo "Accuracy: " . $accuracy . "<p />";echo "Defense: " . $defense . "<p />";echo "<hr>";while($mhits > '0' || $hits > '0') {if($strength < '5') {$rndhit = rand(1, 2);}if($strength > '4' && $strength < '10') {$rndhit = rand(1, 4);}if($strength > '9' && $strength < '20') {$rndhit = rand(1, 7);}if($strength > '19' && $strength < '40') {$rndhit = rand(1, 11);}if($strength > '39' && $strength < '80') {$rndhit = rand(1, 16);}else {$rndhit = rand(1, 22);}$mon1hit = rand(1, 3);echo $usercookie . " hits a " . $rndhit . " on " . $monster . ".<p>";$mhits = $mhits - $rndhit;echo $monster . " hits a " . $mon1hit . " on " . $usercookie . ".<p>";$hits = $hits - $mon1hit;echo "<b>" . $usercookie . "</b>: " . $hits . " <b>" . $monster . "</b>: " . $mhits;echo "<hr>";}?></td> </tr></table><?php } ?>