Jump to content

Letterbomb05

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Everything posted by Letterbomb05

  1. Hi, I'm looking to write a script that would limit access to certain computers or such using an IP whitelist or access list, or at least something along those lines. However, I am aware that IP addresses for most people are always changing, which would be a bit of a problem. Has anyone written one of these before or have knowledge on how this can be achieved? I'm not asking anyone to write one for me, just guidance on how to go about creating it Cheers.
  2. Hi, Before I start, this isn't strictly about the code itself so if this thread is in the wrong place, I'd be much appreciative if a moderator could move it. I've just been thinking about what would be more server-efficient (use less bandwidth etc) for use in a website when it comes to systems that I would usually use PHP to retrieve the info from a database, for example a news system. Usually I would have the users view the page and each time the page loads the information would be retrieved from the database... Now I'm not entirely clued up on how server intensive it would be to have these sort of systems where the information is constantly being retrieved from the database over and over for thousands of users, but I was thinking about if an XML system would work better for server-efficiency. Let's take the news system idea for example, I'd have an XML file looking something like this... <title>This is my news title!</title> <body>The main news!</body> <poster>This is who posted the news!</poster> Okay so you get the idea, PHP retrieves info from the file rather than the DB... I'm not sure if this would actually be worth it, hence why I'm doing the research Thanks for any replies, much appreciated! - Aaron.
  3. Hi, I'm having some trouble creating this list navigation that I want. I was just creating the main frame for the menu with ugly background colours etc. I'd rather not use tables, not sure if this will work though. <ul> <li class="MainHeader">Main</li> <li> <ul> <li class="link"><a href="">Link 1</a></li> <li class="link"><a href="">Link 2</a></li> </ul> </li> </ul> <br /> <ul> <li class="MainHeader">Main Header</li> <li> <ul> <li class="link"><a href="">Link 1</a></li> <li class="link"><a href="">Link 2</a></li> <li class="link"><a href="">Link 3</a></li> <li class="link"><a href="">Link 4</a></li> </ul> </li> </ul> <ul> <li class="MainHeader">Main Header</li> <li> <ul> <li class="link"><a href="">Link 1</a></li> <li class="link"><a href="">Link 2</a></li> <li class="link"><a href="">Link 3</a></li> <li class="link"><a href="">Link 4</a></li> </ul> </li> </ul> The problem is clear when seen in the Demo (Full CSS is found there). I'm working in XHTML Strict. I need to get the lists appearing below each other so I have the Header, the links below, then the 2nd header with the other links below that, no gaps. Feel free to ask questions if I havn't been clear enough, thanks in advance for any help! ~Letterbomb05.
  4. Thanks, I wouldn't use absolute positioning anyway; I've been there and done that along time ago. I'll use your advice and try and get things working, thanks for the help! ~Letterbomb05
  5. What your looking to do is to parse the news from http://www.runescape.com to display it on your website. For this you need PHP; not HTML. I assume you at least know the basics of PHP since your on PHPFreaks.com already.
  6. I am trying to achieve this sort of layout:
  7. Hi, I'm wondering if anyone has a solution to using divs like tables. Of course, I HAVE Googled this before posting, and the most popular result isn't really cross browser compatible; if I used the technique of display:table and display:table-row etc, my design would be screwed in even slightly older browsers. Thanks in advance for any help. ~Letterbomb05.
  8. Hi, I'm currently messing around with using PHP to use dynamic sigs for forums and such, however I've come across a bit of a problem using one of my images. <?php header('Content-type: image/png'); class sig { public function sig() { $image = imagecreatefrompng("sigs/blue_proto.png");; imagepng($image); imagedestroy($image); } } new sig; ?> Here is the image I am trying to use: And here is what happens when I use it in PHP: As you can see, for some reason the left size of my image gets cut off, and the transparency at the bottom seems to fail. This is my first time working with images in PHP, sorry if there is an obvious solution Thanks, Letterbomb05.
  9. Thanks alot, makes sense now I read it
  10. inline CSS was temporary, yeah tables was only method I had >_<
  11. Hi, I'm trying to find a decent way of creating a banner that will stretch, for compatibility with different screen resolutions. I have come up with the following HTML, however it doesn't work in IE, the middle repeating image tries to repeat on the y-axis aswell as x-axis, and therefore looks pretty bad. You can pretty much see what I'm trying to do from the source. <table style="width:100%;padding:0;border-collapse:collapse;margin:0;text-align:left;"> <tr> <td style="width:18px;height:170px;background:url('graphics/head_left.png') no-repeat;padding:0;border-collapse:collapse;margin:0;"></td> <td style="height:170px;background:url('graphics/head_center.png');"> </td> <td style="height:170px;width:13px;background:url('graphics/head_right.png') no-repeat;"></td> </tr> </table> If anyone has any ideas on how to fix this, or has a much better method, please share! Thanks.
  12. Hi, I'm currently trying to make this menu work the way I want it. It's a DHTML goodies menu, I'm just trying to get it to work in a way I want . The menu is made up of HTML, CSS and JavaScript. www.team-recoil.com/testing/menu.htm If you take a look at the page (all source code is there) I have the menu, which slides nicely, but the div that is to the right is below it, and moves with the menu. All I want is for that div to be at the same level as the menu, and not move when the menu is used. Basically I'd just like to have the menu work on its own without effecting anything else. Thanks in advance.
  13. Hi, I'm having trouble getting Margin:auto; to work. I'm testing it in IE8, it's working in everything else except for Internet Explorer. The problem is simple, it just doesn't work! I just need my elements centered, and margin:auto; seems to work in every other browser. If anyone has a fix to this, please let me know! Thanks.
  14. Hi, heres my problem, I have an array like this: $switchboard['call'][$from] = $to; Array ( [call] => Array ( [#chan2] => #chan1 ) ) simple enough, now I can check to see if #chan1 to if is in the array simply by using this: array_search('#chan1',$array) now this is all fine and dandy, but how do I then check to see if #chan2 is present? now, that isn't all of it, if I then find out that #Chan2 is present, how do I then find out that it is asociated with #chan1, and if i find out #chan1 is present, how do i find out that it is asociated with #chan2? Thanks in advance for any help
  15. yes but how should I put all the headers in, should i use the method I first used like so: headers .= 'blabla'; headers .= 'blabla';
  16. sorry I was playing xbox lol i'l test that, give me a few mins and then i'll edit this post EDIT: The email sends and the header works.
  17. Hi, $to = $_POST['email']; $subject = "You have registered"; $body = " <html> <head> <title>Account Activation</title> </head> <body> <p>email here <br /> <br /> -----------------------------<br /> This is an automated email, please don't try and reply.' </body> </html>"; $headers = 'MIME-Version: 1.0' . "\r\n\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n\n"; $headers .= 'To: '.$username.' <'.$to.'>' . "\r\n"; $headers .= 'From: website.com <noreply@website.com>' . "\r\n\n"; $headers .= 'Cc: noreply@website.com' . "\r\n\n"; $headers .= 'noreply@website.com' . "\r\n\n"; mail($to, $subject, $body, $headers); My problem here is with the headers. I've followed the manual to using mail() on php.net it just doesn't seem to work! Notice I have '\n\n' on the end of each header, if i only use one \n, the email doesn't send atall, however with the two, the email DOES send but with issues. The problem is that when I recieve the email, the headers are simply displayed at the top of the email, they arn't actually put into use :X Thanks in advance for any help
  18. Hi, I'm having a specific problem with some forum foundations I've made. The viewtopic file SHOULD look like this: http://browsershots.org/screenshots/9de7bdd5b1e8988032b43d4734982534/ ^ and most of the time, it does. HOWEVER, on SOME of my users computers, there is a strange problem, and here is what they are seeing: http://browsershots.org/screenshots/ce44ac46c023d3f738ca7232b0ff2056/ As you can see the main problem that I'm concerned about here is why the username of the poster, and their information (rank and forum posts) are not being displayed. I have been up to my friends house were he is having the problem, and he is running a normal Dell PC with windows XP and the problem persists in IE7, Firefox 2.0 and Firefox 3.0 :S here is SOME of the viewtopic.php file where the problem is happening: //get topic id from url $topic_id = $_GET['topic_id']; //query db to retrieve the topic info $query = "SELECT * FROM topics WHERE topic_id='".$topic_id."'"; $result = mysql_query($query)or die(mysql_error()); $row = mysql_fetch_assoc($result); $topic_contents = stripslashes($row['contents']); //get current users username if(isset($_SESSION['registered'])){ $user = $_SESSION['registered']; } if(isset($_SESSION['member'])){ $user = $_SESSION['member']; } if(isset($_SESSION['moderator'])){ $user = $_SESSION['moderator']; } if(isset($_SESSION['admin'])){ $user = $_SESSION['admin']; } //make sure that only people with the correct rank can access the topic $accesslvl = $row['forum_id']; if(isset($_SESSION['registered'])){ if($accesslvl > 3333){ echo "Access Denied"; die(); } } if(isset($_SESSION['member'])){ if($accesslvl > 6666){ echo "Access Denied"; die(); } } //query db for the name of the forum that the thread is under $query90 = "SELECT * FROM forums WHERE forumid='".$row['forum_id']."'"; $result90 = mysql_query($query90)or die(mysql_error()); $row90 = mysql_fetch_assoc($result90); $topic_poster = $row['topic_poster']; ?> <!--container--> <div style="float:left;color:#FFFFFF;font-family:trebuchet MS;"> <a href="index.php">Forums</a> -> <a href="viewforum.php?forumid=<?php echo $row90['forumid']; ?>"><?php echo $row90['name']; ?></a> -> <strong><?php echo $row['subject']; ?></strong><br /> </div> <br /> <div style="margin-top:5%;display:block;margin-bottom:1%;"> <!--topic--> <table style="display:block;float:left;font-family:sans-serif;color:#C0C0C0;text-align:left;margin-top:1%;"> <tr> <td width="200px" style="background:#252525;"> <table margin="0px" cellpadding="0" cellspacing="0" style="margin-top:-10%;width:100%;"> <tr> <td style="text-align:center;font-size:10pt;width:100%;font-family:trebuchet MS;"><strong><?php echo $topic_poster; ?></strong></td><br /> </tr> <?php //get information about the reply poster $queryposter2 = "SELECT * FROM users WHERE username='".$topic_poster."'"; $poster_result2 = mysql_query($queryposter2)or die(mysql_error()); $poster_row2 = mysql_fetch_assoc($poster_result2); $posts = $poster_row2['forum_posts']; if($poster_row2['rank'] == 1){ $topic_poster_rank = "Registered User"; } if($poster_row2['rank'] == 2){ $topic_poster_rank = "TR Member"; } if($poster_row2['rank'] == 3){ $topic_poster_rank = "Moderator"; } if($poster_row2['rank'] == 4){ $topic_poster_rank = "Administrator"; } ?> <tr> <td style="font-size:10pt;font-family:trebuchet MS;text-align:center;"><?php echo $topic_poster_rank; ?></td> </tr><tr> <td style="font-size:10pt;font-family:trebuchet MS;text-align:center;">Posts: <?php echo $posts; ?></td> </tr> </table></td> <td width="1000px" style="background:#252525;font-size:10pt;font-size:sans-serif;"><?php echo nl2br($topic_contents); ?></td> </tr> </table> <br /> <?php //get replies $query2 = "SELECT * FROM topic_replys WHERE topic_id='".$topic_id."' ORDER BY reply_datetime ASC"; $result2 = mysql_query($query2)or die(mysql_error()); while($row2 = mysql_fetch_assoc($result2)){ $reply_contents = stripslashes($row2['reply_contents']); ?> <br /> <br /> <table style="display:block;float:left;font-family:sans-serif;color:#C0C0C0;text-align:left;"> <tr> <td width="200px" style="background:#252525;"> <table margin="0px" cellpadding="0" cellspacing="0" style="margin-top:-10%;width:100%;"> <tr> <td style="text-align:center;font-size:10pt;width:100%;font-family:trebuchet MS;"><strong><?php echo $row2['reply_poster']; ?></strong></td><br /> </tr> <?php //get information about the reply poster $queryposter = "SELECT * FROM users WHERE username='".$row2['reply_poster']."'"; $poster_result = mysql_query($queryposter)or die(mysql_error()); $poster_row = mysql_fetch_assoc($poster_result); $forum_posts = $poster_row['forum_posts']; if($poster_row['rank'] == 1){ $rank = "Registered User"; } if($poster_row['rank'] == 2){ $rank = "TR Member"; } if($poster_row['rank'] == 3){ $rank = "Moderator"; } if($poster_row['rank'] == 4){ $rank = "Administrator"; } ?> <tr> <td style="font-size:10pt;font-family:trebuchet MS;text-align:center;"><?php echo $rank; ?></td> </tr><tr> <td style="font-size:10pt;font-family:trebuchet MS;text-align:center;">Posts: <?php echo $forum_posts; ?></td> </tr> </table></td> The second problem, is on this users computer, in firefox only, when they login in on the main site, then click on the forums link, it says they are not logged in, when they are :S Any help or suggestions as to why any of these problems are happening and any possible solutions are much appreciated! (Sorry for the very bad coding, I havn't been doing PHP all that long, and this is the first time i've done anything big >_<)
  19. I'm trying to use Photoshop CS3 to make some buttons for my site, Paint Shop Pro cannot deliver the same quality, although I have one problem. I have researched on the web on how to make a transparent background, but after numerous attempts it doesn't work when I upload to my site >_< If anyone can help, it's much appreciated!
×
×
  • 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.