Jump to content

SharkBait

Members
  • Posts

    845
  • Joined

  • Last visited

    Never

Everything posted by SharkBait

  1. Makes sense enough. If there is a will.. there is a way :)
  2. Alright, I love RSS feeds just because I don't like to spam my mailbox with things. What I would like to see, though not sure how feesable are somewhat custom RSS feeds for the forum. You know when you 'subscribe' to a thread, well instead of being mailed when there has been a reply to a thread, how bout my own little personal RSS feed that my RSS Reader and look up from time to time? Just a thought really.  I would assume that the forum would have to create my very on RSS feed file that I could point the reader to. Now a forum with 20,000 members all using this could make the directories a bit...interesting on the server.  Though being mainly text in a feed, I couldnt see them taking too much space up.  Would also have to write some sort of cronjob to periodically delete old feeds or old information within the feeds. Oh.. someone is probably going to beat me to this in coding it up one day but I thought it would be nice to see if it could be something that PHPFreaks.com could one day impliment :) Thoughts? Flames?  =-)
  3. In the first post example, I think the way I tried making it is using the Rounded Corner shape tool, get it to the size I wanted and then use the pen tool to manipulate the points I've selected. If I were to add more points to it would that help it out?  After I've used the pen tool on a shape I do a feather selection of 0 and then fill in the selection (or cut depending on what I want it to do).  I have just noticed that doing things like this, the selection isnt always as percise as I would like it to be.
  4. Linux = open source :P  Well not all of it, but there are hundreds of (well maybe not hundreds) flavours of Linux in the world. I don't know many places where Unix is still used.  I am sure they are out there but Linux prices (licensing) is FAR more cheaper. I tend to see RedHat in most web hosts I have ever seen.  At work we use RedHat, Mandrake, Slackware, Ubunto, Fedora and whatever else we get our hands on. I would also say because of the costs of obtaining a distribution of linux, most people won't choose Unix as an OS for web hosting etc. Why pay hundreds of dollars for licensing when you can do pretty much the same thing for free?
  5. If you know PHP then why go to ASP?  Of course unless you want to make web applications via a MS IDE.  I know VB.NET, HTML, CSS, PHP, MySQL, MSSQL and others but definately have room to learn more. I asked my employeer if I would benefit from going to school to learn more programming but he said I've already gone past what they would of taught me.  So it would be a waste of money.  I would like to goto school for graphics (ie Illustrator and Photoshop) to me there are far too many tutorials and not enough about basics that I want to learn ;) I use PHPFreaks.com as my classroom for learning PHP.  After I bought 2 books on PHP and MySQL and mastered thoughs I stumbled upon this website and use it every day to learn new things or to tweak things I've already learnt but want to improve on. I learnt VB.net from scratch.  I learnt VB6 too and had to convert my projects to VB.net because of the applications they were used with.  I used google as much as I could as well as www.xtremevbtalk.com to ask questions and look up things. I do wish I went to school though.  Mainly because if I ever leave my current employeer, I have no 'Piece of Paper' to prove to other companies what I know.  Most of them out there require some sort of Certificate or Diplomia.  Nether of which I have except for the High-school stuff and my Electrician's Ticket ;)
  6. I'll have to try that out when I go go back to work on Monday.
  7. How is MD5 not too safe? I do know there are databases out there that link words with MD5 hashes.  As long as people keep their passwords not the same as dictionary words, mix up the case, make it alphanumeric, and then salt the hash, should that not be good enough?
  8. I'd use [code] <?php header("Location: {$filename2}"); exit(); ?> [/code] Not sure why the META refresh isnt working though.
  9. What happens if you [code=php:0] print_f($_SESSION); [/code] After you've tried setting the session? Notice you also have this near the bottom: [code=php:0] if(isset(!$_SESSION['username']))) { //ifthere is nothing in seession // Id change it to this: if (!isset($_SESSION['username'])) { [/code]
  10. And then depending on how you want to sort them it can be either ASC (ascending) or DESC (descending) [code=php:0] $query = "SELECT * FROM gallery ORDER BY name DESC LIMIT $limitvlaue, $limit"; // OR $query ="SELECT * FROM gallery ORDER BY name ASC LIMIT $limitvalue, $limit"; [/code] =-)
  11. This part might be your issue. [code] <?php $sql = "SELECT * FROM staff WHERE username='$username' AND password='$password' AND activated='1')"; mysql_query($sql); $login_check = mysql_num_rows($sql); mysql_close(); if($login_check = 0){ ?> [/code] If I am reading it right.. you continue if $login_check equals 0.  Well if it finds the login name, it will return at least 1 wont it?? Try changing it to [code] <?php if($login_check > 0) { ?> [/code]
  12. Show the code that is giving you trouble? Are you running a web server (like apache) locally on your own machine or is it hosted else where? [code] <?php $_POST['username'] = "SharkBait"  // pretend this was retrieved from a form $PASS = "myPass"; if(isset($_POST['submit'])) {   // Check if user submitted a form   if(!empty($_POST['username'])) {     $username = $_POST['username'];   }   // Check Password   if($_POST['password'] == $PASS) {       // passwords match create sessions       $_SESSION['username'] = $username;     } else {       // Password does not match     } } ?> [/code] Check for a session [code] <?php if(isset($_SESSION['username'])) {   echo "Hi {$_SESSION['username']}"; } else {   echo "Session is not set, I don't know who you are"; } ?> [/code]
  13. Is the like or die(mysql_error()) in the while loop necessary? If it's just stopping then the die() seems to be getting triggered.  Though it might not be display the error message because the function might not be returning the value of it??
  14. Out put your variables. I had to do that when I was working with my pagnation scripts. I found that my $prevpage kept equalling my $page So I changed $prevpage to be set up like [code] <?php $prevpage = $page - 1; ?> [/code] Which is odd cause I thought $page--; would work but it didnt seem to for some reason???
  15. Last I remembered.. search engines do index pages that are generated via databases.  Though I do understand that actual .html files would be easier for it to be crawled. I think it's fwrite() you want to look at if you're wanting to create the actual .html file. Just output the code to variables and then write those to the file. I do know there have been people to do what you want.  I just can't remember where/how they did it, but I know it can be done. You have to parse the URL for the file you wish to serve.  Where mydomain.com/article/ThisThing101/1 usually meant something like mydomain.com/article.php?name=ThisThing101&page=1 Sorry I could not be any more help.
  16. What if you change your query a bit to look like this: [code] SELECT * FROM ads WHERE type = '{$type}' AND start < '{$start_date}' AND (end > '{$end_date} OR end = '') [/code] Adding in the curly braces around the varibles. SQL might be seeing the - as a minus operator in the query.  Which doesn't make sense to me while I type this out but worth a shot. What if you just try to output the info without putting into your class? [code] <?php $qry = "SELECT * Blahblahblah WHERE blah = blah"; $query = mysql_query($qry) or die("Error: ". mysql_error()); while($my_row = mysql_fetch_array($query, MYSQL_ASSOC)) {   echo "{$my_row['ID']} <br />           {$my_row['out_id']}<br />           {$my_row['alt']}</br />           {$my_row['img']}<br />           {$my_row['title']}<br />"; } ?> [/code]
  17. Simplified way of inserting into a database Form [code] <form action="form.php" method="POST"> My Name <input type="text" name="myName" /> <input type="submit" value="Submit" name="submit" /> </form> [/code] Script (in the same form as the form is you wish) [code] <?php if(isset($_POST['submit'])) {   // User submitted the form   if(!empty($_POST['myName'])) {     // Field 'myName' was not left empty     $name = trim($_POST['myName']);   }   // Hopefully database connection has already been made   // Having a string for the query statement is easier for troubleshooting bad data when the query buggers up   $strqry = "INSERT INTO myDatabase (id, name, date_entered) VALUES (NULL, '{$name}', NOW())";   // Execute the query with the string provided   $query = mysql_query($strqry) or die("MySQL Error: <br />{$strqry} <br />".mysql_error());   if(mysql_affected_rows > 0) {     // Item was added successfully     echo "Entry was added into the database";   } else {     // Item was not successful     echo "There was an error when adding to the database.";   } } ?> [/code]
  18. To me sounds like the session is being set empty and not actually getting destroyed. I think I have something like this happen.  Could never figure out why I still have a shopping cart but it showed that it was empty.  I had a check if my shopping cart session was non-existant it would not even show up. Until I added things into my cart it would tell me things like 'Your Shopping Cart has 3 item(s)'.  When i went to remove it it would keep saying 'Your Shopping Cat has 0 item(s)'. So I had to make sure I was unsetting the particular session I was using for the shopping cart and that seemed to of fixed it.
  19. What about a foreach? [code] <?php foreach($invitearray as $loc => $value) {   echo "Loc {$loc} - {$value}<br />"; } ?> [/code] But for a ForLoop [code] <?php $sizearray = count($invitearray); for($j = 0; $J <= $sizearray -1; $j++) {   echo "{$invitearray[$j]} <br />"; } ?> [/code] Notice that in the for look I subtract 1 from the count since arrays are base 0
  20. So when a user click on a link, it sends them to a new location.  So is the page refreshed with the locations new attributes? Or are they being forwared to a new page each time and you want to just make it reload the current page with the new location within it? You can redirect them to the same page with header() so [code] <?php $movetoID = 453;  // SQL id for the location they wish to move to header("Location: {$_SERVER['PHP_SELF']}/location.php?locid={$movetoID}"); exit(); ?> [/code] Though you can see people could just input their own room locations into the URL which is umm a bit of a cheat.  I guess you would do some sort of POST, which would at least stop them from entering where ever they want to go.
  21. So you're looking for what is after the forward slashes? Could try exploding the URL [code] <?php $url = array(); // Can automate it with a $_SERVER['PHP_SELF'] too if you wish // but this example is manually entered $url = explode("/", "blabla.com/username") // 2nd place is the username would be stored $username = $url[1]; ?> [/code]
  22. Is it not seeing the session at all or is the session variables empty? I like to use: [code] <?php if(isset($_SESSION['username'])) {   echo "You're username is: {$_SESSION['username']}\n"; } else {   echo "You are not logged in"; } ?> [/code] You could also try outputting the $_SESSION: [code] <?php print_f($_SESSION); ?> [/code] That way it will show you what is set for the session :)
  23. [quote=PHP.Net] If called without the optional min, max arguments rand()  returns a pseudo-random integer between 0 and RAND_MAX. If you want a random number between 5 and 15 (inclusive), for example, use rand (5, 15). [/quote] Guess you can't use a negative number.  Other than that, you are supplying it with its 2 needed arguments. A start and a max
  24. Ahh I did not know that. Cool thanks :)
×
×
  • 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.