Jump to content

Jarod

Members
  • Posts

    70
  • Joined

  • Last visited

    Never

Everything posted by Jarod

  1. that did not work before, I tried that same exact thing the first time I tried to fix this problem (and you forgot to return it btw).
  2. Okay in my script I am getting the same output sometimes (the $_GET['script'] and $random_num) that match each other. I don't want them to match, so I'm trying to fix this so that $random_num doesnt match $_GET['script']. private function getRandomScriptId() { $sql = mysql_query("SELECT id FROM script"); $maximum = mysql_num_rows($sql); $minimum = ($maximum-$maximum)+1; // starts at 1 $random_num = rand($minimum, $maximum); if($_GET['script'] == $random_num) { // I tried in here, but it didnt work either, I got a error sometimes new $random_num; } else { return $random_num; } }
  3. Well I give up on this... Even though I learned a lot about regex, but forget it... Anyways, I've been trying to figure out how I would handle my inputs so that it only looks at the numbers and nothings else. Check out 900,000,000,000 for example (900 billions btw). I enter it exactly as, but when it comes down for processing it I only want the numbers to go through, which would be 900000000000. I've heard of regex before, but never actually understood its purpose and how its suppose to be used. So anyways I used the expressions /[0-9]{1,3}[^,]*/, but the problem of that is I cant get it to only look at the numbers (omitting the commas and only using the numbers). Its array would output Array [0] ( $match[0] = 900; $match[1] = 000; $match[2] = 000; $match[3] = 000; ) Any way I can get it to look at the string like this??? (900000000000)
  4. 7.78% is not smaller than 0.778% I know it's bigger, which is why i mention manipulation. I want to manipulate it as 7.78, basically make it into a collusion. EDIT: I think substr() might be of use, should be, ill try it.
  5. Okay I've done the math, but I want to turn it around to a smaller number, this is how my math goes though: Basically I have the number 0.778%, I want to turn that around to 7.78% though, is this possible? To get 0.778 I want did 309 divided by 397.
  6. Oooo! Sure wasn't! Sorry for that, I'm still getting the hang of the session_start() thing .
  7. Okay I'm not sure but I don't think I understand how to keep my users logged in anymore, anyways... I log in with my administrator account from the www directory and when I tried to access the admin area, which is in another directory called admin, I'm not logged in still, any reason why this is happening? My file structure is like this Website WWW ---Admin ------JS ------Images ------Index.php ---Images ---Includes ---Index.php Im logged in on the WWW directory, but not in the Admin directory, I'm using sessions by the way.
  8. OK wut did I do wrong in this??? Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\wamp\www\practices\test\index.php on line 1 eval(" if( !isset($_SESSION['server']) ) { $_SESSION['server'] = \"Direct TV\"; echo $_SESSION['server']; } else { echo \"<b>Server</b> already set! (\". $_SESSION['server'] .\")\"; } ");
  9. OK wut did I do wrong in this??? Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\wamp\www\practices\test\index.php on line 1 eval(" if( !isset($_SESSION['server']) ) { $_SESSION['server'] = \"Direct TV\"; echo $_SESSION['server']; } else { echo \"<b>Server</b> already set! (\". $_SESSION['server'] .\")\"; } ");
  10. How do I use eval()? Man it's so confusing, I thought I had it at first. It work, but not until I really needed... I used it with a function and it's not doing so! // set_session("username", "user1"); function set_session($session, $username) { eval($_SESSION['$session'] = $_POST['$username']); }
  11. I guess, but I'm still having a buggy issue here :'(, any reason why the login is doing this?? (I changed them for true/false by the way)
  12. In my functions I always used 0 as true and -1 as false, maybe I should change up on that consider what you just said. I never thought of values being true or false that way to be honest.
  13. Okay I have a site im working on for the login, http://jarodsworld.ismywebsite.com/trookine/index.php You can log in using test for the username and password. When you log out the Member Access Feature is empty, but if you refresh page one more time it shows you are logged in. Any reason why it does that empty box content after redirect (when you successfully log in)? Here is my PHP code: <?php $login_message = "<p>Login with your existing account to access more features.</p>\n"; if(isset($_POST['islogging'])) { // User is attempting to login $username = mysql_real_escape_string($_POST['user1']); $password = mysql_real_escape_string($_POST['pass1']); $verification_result = $member_handler->verify_member($username, $password); if($verification_result == 0) { // User details are verified $username = $_POST['user1']; $_SESSION['username'] = $username; $_SESSION['islogged'] = true; } else { $login_message = '<p class="red_text">The submitted username and/or password is incorrect, please try again.</p>'."\n"; } } else { // Not attempting to login if(isset($_SESSION['islogged']) == true) { // Check if user is logged in if(isset($_GET['option']) == "logout") { // User is logging out --- See if they have clicked the logout button header("Location: logout.php"); } ?> <h4 class="hello_member">Hey there, <a href="#" title="Click here to view your profile"><?php print($_SESSION['username']); ?></a>! (<a href="?option=logout">Logout</a>)</h4> <p>An announcement was made while you were away. <a href="#">Check it out</a>!</p> <h4>Account Statistics</h4> <ul class="stats"> <li><b>Account type:</b><span class="list_info"><?php print($member_handler->member_type($_SESSION['username'])); ?></span></li> <li><b>New messages:</b><span class="list_info">0</span></li> <li><b>Total messages:</b><span class="list_info">0</span></li> <li><b>Total news comments:</b><span class="list_info">0</span></li> <li><b>Total guide comments:</b><span class="list_info">0</span></li> </ul> <h4>Runescape Statistics</h4> <ul class="stats"> <li><b>In-Game Name:</b><span class="list_info"><?php print($member_handler->rs_name($_SESSION['username'])) ?></span></li> <li><b>Quests Complete:</b><span class="list_info">0</span></li> </ul> <?php } else { // User is not logged in ?> <?php print($login_message); ?> <p><b>If you don't have an account yet, consider joining TrooKine today!</b></p> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <label for="user1">Username:</label> <input type="text" name="user1" id="user1" class="field" /> <label for="pass1">Password:</label> <input type="password" name="pass1" id="pass1" class="field" /> <input type="hidden" name="islogging" /> <input type="submit" value="Login" /> </form> <?php } } ?>
  14. still not working <style> a.category { background: url("images/button_slide.png") no-repeat top right; } a.category span { background: url("images/button_door.png") no-repeat top left; display: inline-block; padding: 8px 15px; } </style> <a class="category" href="#"><span>Category</span></a> btw I uploaded the images, maybe u can fix them?? <style> a.category { background: url("http://i47.tinypic.com/2zsp93m.png") no-repeat top right; } a.category span { background: url("http://i48.tinypic.com/1440a3c.png") no-repeat top left; display: inline-block; padding: 8px 15px; } </style> <a class="category" href="#"><span>Category</span></a>
  15. how do I make a button without using unordered lists or inputs? I am using the sliding doors technique, which seems to not be working at all... I get a weird image like this: here is the code I used: <style> .category { background: url("images/button_slide.png") no-repeat top right; } .category a { background: url("images/button_door.png") no-repeat top left; display: inline-block; padding: 8px 15px; } </style> <span class="category"><a href="#">Link</a></span> Any reason why it's looking like the image above???
  16. any reason why my code is looking like this? http://i50.tinypic.com/2h87l3o.png here is my html and css code: <div id="header"> <!-- start of header --> <div id="logo_span"><!-- Making space for logo (1000 x 144) --></div> <div id="top_menu-gd"> <div id="top_menu-left"> <div id="top_menu-right"> <span id="date">Dec.14.2009</span> <ul> <li><a href="#">Home</a></li> <li><a href="#">About TrooKine</a></li> <li><a href="#">Community</a></li> <li><a href="#">Play Runescape</a></li> </ul> </div> </div> </div> </div> <!-- end of header --> #header { background: url("images/logo_2.png") no-repeat; } #header > #logo_span { height: 144px; min-height: 144px; max-height: 144px; } #header #top_menu-gd { background: url("images/top_nav_gd.png") repeat-x; color: #181818; } #header #top_menu-left { background: url("images/top_nav_left_p.png") no-repeat top left; } #header #top_menu-right { background: url("images/top_nav_right_p.png") no-repeat top right; padding: 45px 15px; } #header #top_menu-gd #date { float: right; } #header #top_menu-gd ul { margin: 0; padding: 0; list-style: none; display: inline; } #header #top_menu-gd ul li { display: inline; } #header #top_menu-gd ul li a { display: inline-block; padding: 0 15px; font-weight: 700; color: #181818; text-transform: uppercase; } #header #top_menu-gd ul li a:hover { color: #919191; } #header #top_menu-gd ul li a:first-child { padding-left: 0px; }
  17. I dont see the problem with this, I always get Parse error: parse error in C:\wamp\www\logs\pages\members.php on line 16 , what did I do wrong?? <?php $sql = "SELECT * FROM members ORDER BY id DESC LIMIT 0, 30"; $query = mysq_query($sql); while($row=mysql_fetch_assoc($query)) { $member_id = row['id']; // Parse error: parse error in C:\wamp\www\logs\pages\members.php on line 16 $member_firstname = row['firstname']; $member_lastname = row['lastname']; $member_position = row['position']; echo ' <div class="row"> <div class="cell"><span class="link"><a href="' . echo HOME_URL . "?p=profile&u=" . $member_id; . '"><img src="' . echo HOME_URL . "pages/img/icons/info_white_16x16.png"; . '" alt="' . $member_username . ' Info" title="View ' . $member_username . ' info" /></a></span> ' . $member_firstname . '</div> <div class="cell">' . $member_lastname . '</div> <div class="cell">' . $member_position . '</div> <div class="cell"><div class="member-num">#' . $member_id . '</div></div> </div>'; } ?>
  18. SELECT username,password FROM `members` WHERE username=`Jarod B` AND password=`1234` I dont see my problem, phpmyadmin returns #1054 - Unknown column 'Jarod B' in 'where clause', any reasons why?
  19. I fixed it now, I've never done this and didn't look at any tutorial (still didnt cuz I didnt know where to look for one at o.O). The problem was that for some reason the li tag wouldn't show the image, so I just made another base for the sliding image to stand on. It's working now.
  20. I've completed it a bit, but not entirely because I cant get the rounded corners to work the way they're suppose to. Here are the images I am using: http://i45.tinypic.com/2z4wvaq.png http://i50.tinypic.com/1zyx4oy.png This is how they would look if working: AND here is the code I used (HTML) <div id="main_menu"> <ul> <li><a href="#"><span class="side" id="selected">Home<span class="mm_desc">welcome!</span></span></a></li> <li><a href="#"><span class="side">About<span class="mm_desc">up and personal</span></span></a></li> <li><a href="#"><span class="side">Portfolio<span class="mm_desc">all the workpieces</span></span></a></li> </ul> </div> And here is the CSS code: @charset "utf-8"; /* CSS Document */ #main_menu { float: right; } #main_menu ul { margin: 30px; padding: 0; } #main_menu ul li { display: inline; margin: 0 5px; } #main_menu ul li a { background: url(../img/menu_button_ext.png) no-repeat left; padding: 13px 15px; display: inline-block; color: #808080; text-decoration: none; text-shadow: 1px 1px 0 #e9e9e9; font-weight: 700; } #main_menu ul li a:hover { color: #404040; text-shadow: 1px 1px 0 #d9d9d9; } #main_menu ul li #selected { color: #404040; text-shadow: 1px 1px 0 #d9d9d9; } #main_menu ul li a side { background: url(../img/menu_button_side.png) no-repeat right; } #main_menu ul li a span.mm_desc { display: block; font-weight: normal; } Any reason why it isn't working???
  21. I need help on making a footer stick to the bottom, anyone help please???? :'( I designed a website that I'm ready to code into a markup but I cant get it to stick to the bottom
  22. Well, I didnt know how lol. I JUST started some days ago and about to convert my psd file into an html file now . Would you help me by the way? My msn/email is thejaydawg@gmail.com
×
×
  • 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.