Jump to content

BeerOclock

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

BeerOclock's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ive recently been discovering the power of jQuery in my javascript projects, and I'm wondering if there is a similar framework/library for PHP. I keep hearing about Zend but I'm not 100% sure if its what I think it is. What I like about jQuery is that its a simple file you put on your server and it gets downloaded and executed on the client. Is the Zend framework like that? Or is it something that needs to be installed on the server. In other words you need to find a host that officially supports the zend framework. Because that would suck. Assuming thats the case, are there any other PHP frameworks that are basically just libraries that you can stick on your host without them having to actually install or officially support ?
  2. I'm pretty sure those two things are one in the same... Therefore you have confused me. I'm reading up on all this crap, to make sure I use the best method.
  3. Thanks for the reply. Even if I used PHP's built-in session support, I would still have the problem of how best to pass around the sessionID. If I'm not mistaken, I would still have to either put the sessionID on the URL or store it in a cookie. So really, the fact that Im writing my own session code is irrelevant. In fact, lets say that I will switch over and use PHP's session code. What are my options for passing around the sessionID from page to page? I really dont want it on the URL. I'm not sure if its bad practice to have it on the URL, but regardless I dont want it there if I can help it. Whats the only other alterntive? Cookies? Im really not a fan of cookies either First of all what if the user doesnt have them enabled... Is there a third alternative? Thanks for your patience, I'm sure this type of thing has been asked before...
  4. Hi guys, love the forum, I think I will be here to stay. I have sort of a high-level question about how to make PHP work for my coding style. First of all, Ive decided to write my own custom sessions because that is what I am used to doing in other languages and it just feels cleaner. Everything related to the user's session is stored in the mySQL database, and the only thing needed to retrieve it is the sessionID. My question is about how to keep my PHP files relatively short and sweet, and how to navigate from page to page. Heres an example of where I am stuck: I have login.HTML which has username and password input box, and a submit button. the form gets submitted to login.PHP. In login.PHP, what I want to do is simple: test the username and password against the database to see if the user is valid, and if so, create a session. If the user is an administrator, redirect them to admin.PHP, and if they are a regular user, redirect them to main.PHP, and if their password was wrong, redirect them back to login.HTML. Thats it. I'm finding this simple task to be impossible with PHP. I dont want the sessionID to be passed around visibly on the URL, I want it to be a hidden form variable on each page. But apparently PHP cant pass FORM data unless you are actually submitting a FORM. In other words when you redirect in PHP, you HAVE to put your data in the url as GET data. Thats no good. So where does that leave me? As far as I know, the next best solution would be to use include(). In my login.PHP, instead of redirecting to main.PHP, admin.PHP, etc, I just include() those files in the appropriate places. But this goes against most of what Ive learned as a programmer. Instead of having a bunch of small modularized PHP files, its more like I'm going to have one giant wholeDamnSite.PHP file. To me, main.PHP and admin.PHP are 2 very separate things, and they should stay that way. They shouldnt be included into the same PHP file on opposite ends of an if statement. I hope people understand what I've said! I hope someone has some high level advice on how to organize all these files, and minimize coupling. 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.