Jump to content

deadlyp99

Members
  • Posts

    124
  • Joined

  • Last visited

Everything posted by deadlyp99

  1. Try removing the float:left from ".panel div", since you are using absolute positioning anyway.
  2. To me this screams packet sniffer. http://www.wireshark.org/ Pretty good one, though I have not personally used it in a few years. It's worth noting though, that since your application sends and receives data, you could just have it log all data it sends and receives...
  3. It sounds to me, like you do not have a web server installed yet are trying to run php scripts.
  4. Your using the same images repeatedly. Your while loop repeats, and keeps using the static image url. You can restructure your database to also contain the image url for a specific team. echo "<td><image src ='".$record['teamOneImageUrl']."'/></td>"; //problem here echo "<td><image src ='".$record['teamTwoImageUrl']."'/></td>"; //problem here
  5. Hello, wasn't quite sure where I should have posted this, or if appropriate for this forum. I know my web design mechanics fairly well, but i'm not really the best art designer. I've created a calender for a site i'm working on. Click on a day, and you can share what your doing on said day. Simple project, but I feel its ugly. I use a "checkmark" image to show a day has an entry. When the owner clicks a day, they are presented with a pop-in (in-page popup?) that allows them to create or edit. Still need to make a delete control, not hard. When a viewer clicks a day, they get an even more lack-luster view without the text-area. Anyway, this feels really awkward when using it. Any tips for bringing it up to 2012? Attached images for it, thanks in advanced for any advice.
  6. The dbTitle class holds the value of the div's title in the database. That title is used to manage the div's content in the CMS. I could have bypassed all of this by not naming it. But then in the future I could have many divs with no names, which makes determining what's what messy. But any divs created through the cms get that class to conform to the site's template. Adding an id to it would require me to recode the cms to allow me to add a unique id. Ideally that is what I would want right, but I'm not familiar enough with the very large script to properly do it in a timely manner... It requires restructuring the database, updating all the divs that don't have id's, updating all the backend php for add, editing, and removing said content, as well as possibly needing to modify code that needs to interact with the structure or content of the div's. So I can do that, or throw a simple edit and put the long and hard on my to-do list. I had been throwing various functions at jQuery because I don't know it 100% yet. Thanks for helping out, I have gotten this working, and I got the parent function working ... more cleanly. It appears this will do what I want it to and I don't foresee problems with it so far. $('#motivationals').parents('.disignBoxFirst').find('.dbTitle:first').html(''); Thanks a ton.
  7. The script I'm working with allows easy content to be added. Throw it a title and a body of content and it throws a div on the page. I'd really rather avoid editing the base script for this, because I don't know how it may effect the rest of the site.
  8. Hello, i've been working on a site, and there is a specific element I wish to edit. The trouble I have is there are many instances of the class, so I've been using .parent() in jquery, and I feel I am just doing it wrong. The markup looks like this <div class="disignBoxFirst bx-def-margin-top bx-def-border"> <div class="boxFirstHeader bx-def-bh-margin"> <div class="dbTitle">Ad_Rotator</div> <div class="clear_both"></div> </div> <div class="boxContent"> <div class="dbContentHtml"> <p id="motivationals"></p> <script type="text/javascript">// <![CDATA[ /**buildAdRotator();**/ // ]]></script> </div> </div> </div> I am trying to edit the innerHTML of dbTitle. The div is the first instance of the class on the site, but I don't want code to break if I place new ones before it in the future. So I wish to use the motivationals id as a handle or reference point since there will only be one instance of that. I've tried $('#motivationals').parent().parent().parent().first('.dbTitle').html('aasdf'); This doesn't behave as I want it to, and I really feel i'm using bad code just looking at that. Due to the nature of the script I am working on, editing the markup isn't really an option outside of the dbContentHtml div. Any insight on how to properly hop up to the parent, and then down to dbTitle would be much appreciated.
  9. Hey everyone at php freaks I have not touched programming a while and recently did, with intent on tackling perl, as well as playing around with AI type applications... perhaps more threads to come on that note! Picking up perl, I'd always associated it with python (which I decided the syntax is rubbish) but after actually trying it I am really liking how things are done for the most part. Anyway, I'm at a point where I want my application to have certain functions only accessible by me, its one and only master . Typically I like to create a DES cipher of my username and password, then use the key as a salt for an md5 hash to be stored in a database. Md5 looks a lot more pleasant when you look at your database, and at less risk of escaping code and whatnot, just my oppinion. The problem I am having is that, well for some reason Crypt:DES requires input, and keys to be exactly 8 bits. This is fine for now as I am not using any username:passwords longer than this. They are actually shorter, though I do imagine switching over to (using) CBC. So I need to be able to tag on a "\0" null to the variable, and I planned to have the program add or substring a string depending. When it hits the CheckLength function for checking that the variable is 8 bits, it runs for a bit then dies with a "Out of Memory!" error. I've got 3 gigs, and by reading I found that hashing is a bit wonky in perl. However I'm pretty convinced this is an error in method on my behalf and choose to not blame perl. Any help, hints, and tips would be appreciated, have a great day everyone AuthenticateUser.pm package Functions::AuthenticateUser; use Functions::Database; use Functions::HandleException; use Crypt::DES; use Digest::MD5 qw(md5_hex); $fHExc = Functions::HandleException; $fDbCon = Functions::Database; sub UserLogin; sub CheckLength; sub UserLogin { print "\n\nIn order to continue you need authenticate yourself!\nUsername: "; my $user = <>; Functions::AuthenticateUser -> CheckLength($user); print "\nPassword: "; my $pass = <>; $pass = CheckLength($pass); my $key = pack("H16", "2568647ff7468652"); my $cipher = new Crypt::DES $key; my $user = $cipher->encrypt($user); my $pass = $cipher->encrypt($pass); my $today = time(); $user = md5_hex($user.$key); $pass = md5_hex($pass.$key); print 'Login:'.$user.':'.$pass;exit; $fDbCon -> DbConnect('Login:'.$user.':'.$pass); } sub CheckLength() { my($class, $var) = @_; my $varlength = length($var); if ($varlength < 9) { $var += "\0"; CheckLength($var); } elsif ($varlength > 9) { $var = substr($var, 0, ; } return $var; } 1;
  10. Well my question just turned my goal into a monster I wasn't trying to communicate To be more clear: One or the other join needs to be run per query, based on the MapType and Oasis Type. Which if you re-look at my code with that in mind: SELECT * FROM MapSquares IF MapType > 0 THEN JOIN Cities ON MapSquares.SquareID = Cities.SquareID ELSEIF OasisType > 0 THEN JOIN Oasises ON MapSquares.SquareID = Oasises.SquareID ENDIF WHERE X = '39' AND Y = '-4' That's my ultimate goal in this. I'm hoping to be able to shorten my code. If it is not possible, then thanks for your time, i'll just use php
  11. Is there a way I would be able to have it select fields from other tables? SELECT IF (MapType > 0, SelectFields , IF (OasisType > 0!='',Oasises.OasisID,Cities.CityID) ) FROM MapSquares WHERE X = '39' AND Y = '-4'
  12. So I have to use nested sql statements in my php to achieve what I am trying to, or is there a different route I can go?
  13. So, I've never had to use an IF statement in mysql before, but a recent project forced me to learn the JOIN function, which causes me an error trying to pull a few types of information from the same table As far as I know I have the syntax wrong... but I can't figure out what it needs to be, because an IF statement in mysql is just a really foreign thing for me. SELECT * FROM MapSquares IF MapType > 0 THEN JOIN Cities ON MapSquares.SquareID = Cities.SquareID ELSEIF OasisType > 0 THEN JOIN Oasises ON MapSquares.SquareID = Oasises.SquareID ENDIF WHERE X = '39' AND Y = '-4' Any help would be appreciated... IF statements in sql are a rather new concept to me, and I'm very unsure of the context it needs to be in. I'm trying to have the sql join 2 tables based on whether it has a 'MapType' or an 'OasisType'. The use of 0 basically is going to mean "no it doesn't have this type", and not 1 row has both types, but it will have 1 of the two. Thanks in advance for any advice
  14. It's possible you have a data type mismatch. Try instead of $i<"20", using $i<20. It just depends on how it's stored in the database though.
  15. What I told him to do worked just fine, and I know because I actually tested it. Please don't make snide remarks when you've not tested the changes yourself, thank you. The first change, would not effect the output but its good structure. Second change was his first problem, the submitted data wasn't in the form and was therefore not being sent to the second page. The third change was the font tag was not closed
  16. This is going to be psuedo code, so you'll need to adapt it a bit As far as mailing, take a look at this: http://us3.php.net/manual/en/function.mail.php $connect =mysql_connect("localhost","Master","password"); mysql_select_db("Login"); //select database //generate random number for activation process $sql = "SELECT * FROM `Users` WHERE user='$fullname'"; $result = mysql_query($sql) or die(mysql_error()); if (mysql_fetch_row($result) > 0) { echo "Username in use, please select another"; } else { $random = rand(23456789,98765432); $queryreg = mysql_query(" INSERT INTO Users VALUES ('','$fullname','$username','$password','$email','$date','$random','0','') "); $lastid = mysql_insert_id(); }
  17. Try these changes: name = "user"> change to name="user"> Add your "choices" to be within your form tags echo "'>"; echo $_SESSION['inputtext']; Change to echo "'>"; echo $_SESSION['inputtext']; echo "</font>";
  18. What this code is designed to do, is to seperate my map, and use different images based on population. Currently, it is outputting the same image every time "images/mapsquares/d00.gif". Does a for loop only call the function one time and use the result every time, or is there an error in my code I cannot find? Also, will converting "GetCitySquareIcon" to a class rather then a function help at all? Because other parts of my code are not producing this error from what I've seen. Thanks for any replies <?php function GetCitySquareIcon($CityID, $OasisType, $CityPoP, $Relation) { $MapDIR = "images/mapsquares/"; $Type = ".gif"; $MapTypeImages = array('d00','d01','d02','d03','d04','d05','d10','d11','d12','d13','d14','d15','d20','d21','d22','d23','d24','d25','d30','d31','d32','d33','d35'); $BlankMapImages = array('t0','t1','t2','t3','t4','t5','t6','t7','t8','t9'); $OasisTypeImages = array('o1','o2','o3','o4','o5','o6','o7','o8','o9','o10','o11','o12','o99'); if ($CityID >= 1) { if ($CityPop < 100) { return $MapDIR.$MapTypeImages[0].$Type; } elseif (($CityPoP > 100) && ($CityPoP < 250)) { return $MapDIR.$MapTypeImages[6].$Type; } elseif (($CityPoP > 250) && ($CityPoP < 500)) { return $MapDIR.$MapTypeImages[12].$Type; } elseif ($CityPoP > 500) { return $MapDIR.$MapTypeImages[18].$Type; } } } for ($Y = $StartY; $Y >= $EndY; $Y--) { echo "<div id=\"row".$Y."\">"; array_push($Yarray, $Y); for ($X = $StartX; $X <= $EndX; $X++) { echo "<div class=\"". $CssClass.$CssClassNum."\" alt=\"".$X.",".$Y."\" style=\"z-index:5;width:74px;height:74px;background:url('".GetCitySquareIcon($CID, $OType, $Pop, 0)."');\"></div>\n"; array_push($Xarray, $X); $CssClassNum++; } echo "</div><br />"; } ?>
  19. I'm an idiot lol. I was completly over-doing it <area shape="poly" coords="304,112,267,131,305,152,340,132" alt="1,0" onmouseover="document.getElementById("x").innerHTML="'.$Xarray[0].'";document.getElementById("y").innerHTML="'.$Yarray[0].'";" href="?x='.$Xarray[0].'&y='.$Yarray[0].'" /> <area shape="poly" coords="304,112,267,131,305,152,340,132" alt="1,0" onmouseover="document.getElementById("x").innerHTML="'.$Xarray[1].'";document.getElementById("y").innerHTML="'.$Yarray[0].'";" href="?x='.$Xarray[1].'&y='.$Yarray[0].'" /> So simple -.-
  20. Well now that I have thought of it I made more then one error in my logic, but it doesnt bring me to a solution. In my head I want my Javascript, followed by the link to print out like so: JS 36 -4, Link 36 -4 JS 37 -4, Link 37 -4 JS 38 -4, Link 38 -4 JS 39 -4, Link 39 -4 But I just realized this error how following the logic it should be printed $Xarray = (36, 37, 38, 39, 40, 41, 42); $Yarray = (-4, -5, -6, -7, -8, -9, -10); JS 36 -4, Link 36 -4 JS 37 -4, Link 38 -4 JS 39 -4, Link 40 -4 JS 41 -4, Link 42 -4 Since the first item in teh array is 36, the first $x++ should bring it to 37, and the second $x++ 38 correct? I can fix the second by removing the "++", but the code isnt operating how i'm thinking it should I guess To be as clear as I can, I want the javascript event, and the href, to have the same value per line, so that the link matches the javascript coordinate being displayed.
  21. Well I've posted a lot of questions lately, and I try to give back by helping others. But today I have another question I have a image map with coordinates, and it also updates a <span> with the #'s I assign via php. $x and $y both have an initial value of 0. <area shape="poly" coords="304,112,267,131,305,152,340,132" alt="1,0" onmouseover="document.getElementById("x").innerHTML="'.$Xarray[$x].'";document.getElementById("y").innerHTML="'.$Yarray[$y].'";" href="?x='.$Xarray[$x].'&y='.$Yarray[$y].'" /> <area shape="poly" coords="304,112,267,131,305,152,340,132" alt="1,0" onmouseover="document.getElementById("x").innerHTML="'.$Xarray[$x++].'";document.getElementById("y").innerHTML="'.$Yarray[$y].'";" href="?x='.$Xarray[$x++].'&y='.$Yarray[$y].'" /> Now when I print_r($Xarray), I get the correct stuff (36, 37, 38, etc). In addition, the link of the image on the second area does increase like it should, to 37. However the javascript mouse over does not increment. So when I look at the source code on the page I see: <area shape="poly" coords="267,91,230,111,269,131,303,112" alt="0,0" onmouseover="document.getElementById('x').innerHTML='36';document.getElementById('y').innerHTML='-4';" href="?x=36&y=-4" /> <area shape="poly" coords="304,112,267,131,305,152,340,132" alt="1,0" onmouseover="document.getElementById('x').innerHTML='36';document.getElementById('y').innerHTML="-4';" href="?x=37&y=-4" /> Notice the "36" and the "37" on the bottom area? That's my problem. I'm not sure what's causing it, but help would be greatly appreaciated. Thanks for your time. If it becomes needed, I'll fill more area map fields to see if it is an ongoing problem. But I really don't want to have to go through mass amounts of fixing line by line with the same repetive change so I started with just these 2 boxes.
  22. So... A friend and I are trying to mimic a game we both like, and while hes doing the design, I'm mostly doing the "engine" so to speak. But while creating my world map "section" that users see, I came across a big error. I created a javascript method to change the X and Y coordinates displayed as a user hovers over a specific map square, however because my DIV is a square and my image a polygon (specifically a turned square...) I'm finding that an error is being created, and a serious one. Lower on the map, because the div is a square, it covers parts of the other divs, and that causes read errors in the javascript making one square appear as another, as illustrated (as best I can), in this screen shot taken with firebug that I attached. The real site uses an area map over an image, but I'm finding it way too complex (my coding is a lot better then my web design :/). So I am wondering how I can specifically fine tune the javascript to only fire on the bounds of the image itself (relative to the div it is in preferably). Even by shortening the div so it does not overlap at the top, I will still have a problem with the corners of the divI thought I might be able to create a complex network of z-index's, but that sounds like a very crappy hack job so I haven't sat and worked out the logic (stacking paper on top of each other xD). Some help, insight, suggestions, etc into this would greatly be appreciated. Each square is spat out from php with specific data from my database, which is why the area map is just too complex for me to figure out. Thanks for any help [attachment deleted by admin]
  23. Possibly, I'm no expert at coding security, but there are certain techniques to poison(inject code) forms to gain control and use it to send emails. I do have to point out one obvious error though. You jump right into using the variables received from POST without filtering them. http://www.webreference.com/programming/php/DataFiltering/ SQL isn't at risk here, but the formatting (including destination address) are data you don't want to be edited. You'll have to find ways to get interested in security to learn a lot about it. I'm majoring in it, and always looking up things on the light and dark sides. I found this interesting: http://www.google.com/search?q=ylMS24&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a Tell me the first result! There were only 4, just crazy. Based on that, the person who sent the email could have tracked you here. Scary stuff eh?
  24. Try moving the "session_start()" to the top of the php on your login page, and try echo-ing the $_SESSION variable on admin.php check if it is even being set. Hell you could null out the redirect on login.php and check if it is being set. If the data is blank, try using a string or integer value rather then a boolean. I'm not 100% sure if those steps will work or even help. That's just the first ones I would take.
×
×
  • 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.