Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. Basically the idea of being "logged in" is for a user to identify himself through stored information in a database or flatfile (usually a name/pw or email/pw combo). You would have an "entry point" somewhere (the login form). This entry point will allow the user to identify himself. You seem to have that already, so that part is done. Next step is to use a system of data persistence to keep that user tagged as "authorized" or "logged in". Common way to do this is with sessions. So, when the user identifies himself through your login, you will want to create a session variable that can be passed form page to page. It could be a unique number or the user's account id or simply a boolean var. So, on every page that you want the user to be "logged in" to, you need to tell php that you are using a session, by having session_start() at the top, and then checking if that session variable exists. If it does, the user is logged in, display the page, do whatever. If it doesn't, then redirect back to the login page or wherever. That's basically what thorpe has as an example in his post: something like that needs to be on every page you want the user to be "logged in" to.
  2. Sorry, but we aren't here to write/alter code for you. We're here to help fix bugs on your own script or point you in the right direction. People get paid for doing what you are asking to get done. Would you go up to a mechanic and tell him you don't know how to fix your car, or please change something...for free? Your options include picking up a book and learning how to do what you want to do, asking for help if you get stuck, or hiring someone to do it for you. Not trying to be mean, just letting you know.
  3. please rephrase your question. The way I read it, you're saying it only shows current page to last page. But the code you provided looks like it just does 1 to last page. You then mention something else altogether..something having to do with displaying 5 links? So what is it you want to show, the current page and the next 4? 2 before current, current, 2 after?
  4. We aren't here to write code for you. We help fix bugs and point you in the right direction. If you would like for something to be done for you, you can go to the freelance forum and make an offer to hire someone.
  5. I see php tags wrapped around the first 2 lines of your code, and no php tags wrapped around the rest. On top of that, try using normal php tags <?php ... ?> instead of shorttags.
  6. yeah, array_rand would accomplish the same task, because it picks a random element from the ones that are actually in the array.
  7. But anyways, if my connection was the determining factor, then why the noticibility between FF and IE? I too will put my chips on Ginger's theory about FF having some kind of advanced page caching.
  8. haha don't be jealous. Actually, I recently downgraded to 10mbps. Still a lot better than 1mbps though
  9. maybe, maybe not. You're inserting/updating with a bunch of vars but you do not show where they are coming from.
  10. Anyways, it's definitely not ajax.
  11. I notice the same thing as GingerRobot. I clicked over and over and over again and saw absolutely no visible flickers other than the actual tabs switching (FF), but full page reloads for IE. Google Chrome will initially load the page from that link, but if I try to click any tabs, it takes me to an error page, claiming the page doesn't exist.
  12. Okey, But if i want it to be in a minimum/maximum length, How do i fix that then? Thanks for help, I Really appreciate it! Regards, Vellor Well you are going to have to add them into your class or wherever, and add it to your form validation. We aren't really here to pick apart some 3rd party code and figure that out for you. I suggest contacting the person who wrote the script, or else picking up a book and starting with the basics. Or like, hiring someone.
  13. But assuming that they were to be found, and assuming that they were marked as public (can be used outside the class), you would use objectname->property. Going back to my example: <?php class something { var $blah; private $awsd; function dosomething () { // works $this->blah = "foobar"; } } // create an instance of the class (object) $someobject = new something(); // will not work because it is outside of the class $this->blah = "foobar"; // this will work, because blah is public $someobject->blah = "foobar"; // will not work, because it's private $someobject->aswd = "laksdjf"; ?>
  14. wildteen beat me to it earlier, but I was also going to tell you that array key=> value assignments is just like a regular variable assignment, with . for concatonations, single/double quote rules, etc... Example: $blah = 'something'; $blah = 'something' . $something; $blah = "something$something"; etc...
  15. Okay I think your problem is this: you are unsetting elements in your array but you are not re-indexing your array, so when you turn around and pick a random element, you could randomly be picking elements that no longer exist. Example: <?php $array = array('a','b','c'); // example array print_r($array); // output: Array ( [0] => a [1] => b [2] => c ) echo "<br/>"; unset($array[1]); // remove random element print_r($array); // output: Array ( [0] => a [2] => c ) echo "<br/>"; // at this point in time, you have 2 elements. If you do this... $x = rand(0,1); echo $array[$x]; // you have 2 possible outputs: 'a' or nothing, because // $array[0] exists, but $array[1] does not // so what you want to do is this: $array = array_values($array); // re-index the array keys print_r($array); // output: Array ( [0] => a [1] => c ) ?>
  16. (others posted while I was typing...hopefully this will further clarify) example: <?php class something { var $blah; function dosomething () { // works $this->blah = "foobar"; } } // will not work $this->blah = "foobar"; "$this->" means assign foobar to the variable "blah" in "this" class (something). if you use it outside the class...you'd be assigning foobar to "this" ...what? In other words, "$this->blah" is an alias for a class name. You can only use it inside a class, because otherwise, it would be ambiguous.
  17. Can you rephrase that?
  18. "You know, sometimes I wish I did a little more with my life instead of hanging out in front of places selling weed and s**t. Like, maybe be an animal doctor. Why not me? I like seals and s**t. Or maybe an astronaut. Yeah. Like, be the first motherf****r to see a new galaxy, or find a new alien lifeform... and f**k it. And people'd be like, "There he goes. Homeboy f****d a Martian once." - Jay, Clerks II
  19. Just remember: all you have to do is disable javascript and then ajax no longer works. So when coding a site with ajax rich features, you are doing double the work, because you have to also code it the traditional way so your site can gracefully fall back to it.
  20. cigarette companies aren't allowed to advertise here. Not on TV, anyways. Though they are allowed to do product placement in movies etc.. alcohol has no restrictions afaik. I've seen beer, wine, hard liquor ads just the same. Some of the alcohol ads will throw in a "and remember drink responsibly" at the end, but nothing like the disclaimers pharmaceutical ads have to make. But anyways, I still wouldn't call that a public service ad promoting a healthy lifestyle. That's simply a company trying to sell you something unhealthy and being forced to throw on a disclaimer about it. And they sure don't do it willingly. They use as few, ambiguous words as possible, hire an auctioneer to talk at like 500 wpm in a very quiet voice, etc... lol.
  21. wait wait wait....there's actual classes for learning how to use a mouse??? I've got 4 kids. Youngest one is almost 2. Even she has figured out she can move it around and zooooom goes the arrow and she can click and double click the button and make all sorts of things pop up.
  22. I'm not rewarded [by my gov] for any of those few example I gave. Public service ads for a healthy lifestyle? where? Can you give an example? I see plenty of ads for a healthy lifestyle, but it's always someone trying to sell me something... I can guarantee you that whether a gay couple is married or unmarried does not affect their 0% chance of reproduction, so why does that matter? Okay we've moved on from that debate. We're now talking about why the government supports marriage, in general. I suppose we could talk about that, if you like...just sayin'...we've already moved on to topic #20 in this thread. Okay I'll address that. Studies show that married people are more inclined to want to raise a family. Traditionally that's done the old fashioned-way (you know, the whole birds and bees talk your dad gave you when you were knee high to a grasshopper). But in this day and age, that includes artificial insemination, adoption (I guess this one has been around for a while, too), willing member of the opposite sex (friend, family, 'family', whatever...) willing to do en-vitro fertilization in a lab (or at home, woohoo!). Point is, "how" the couple expands their circle is not really relevant. I guess I could have put "reproduce" in quotes when I originally posted, and I probably would have, if we were still talking about gay people, so I will formally submit that they be put in quotes now.... In honor of an even more previous discussion about uh, marriage vs. civil union, I went ahead and put 'married' in quotes, as well. Also, I put "children" in quotes, because the context and assumption right now is that they are human. We could be cloning ourselves soon. Or aliens could land and we could adopt or have an inter-racial-breeding frenzy before people really sort out whether they have rights or not.
  23. I just sent myself a PM and replied to it. Everything seemed to be in working order.
  24. What I had in mind was some kind of fault of the OS where something was working unexpectedly. Like a messed up sys call of some kind or something. I see. Just seems to me that most "Windows sucks" posts involve bitching that people's programs lock, crash, etc... and that's somehow the OS's fault. I mean, it could be. But I doubt it. Especially when it comes to people bitching about vista. There's a good possibility they are running 64-bit. 64-bit technology has just hit the mainstream market (relatively) recently. Recent enough that the only companies that have updated their software to be compatible are the ones that charge hundreds of dollars for their products.
  25. Married people are more likely to reproduce. More children == more tax payers and people to buy stuff from the corporations that run this company.
×
×
  • 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.