Hello all,

It seems I'm on a wild goose chase, either that or this is going to be a lot harder than I imagined, and I imagined it being pretty difficult.

I posted in other forums here asking for help on this issue, it was suggested that PHP may make this job easier. I've no experience with PHP but am willing to learn it if it will in fact help us complete the needed tasks. Here is my previous post, any comments or suggestions would be greatly appreciated:

I'm a bit newer and looking for some direction. We would like to create a new website and have that do some dynamic things based on login id. First all we would like to send you do a different home page based on this information, it might be one of several companies. This may also be tied to what URL you clicked but not necessarily. The second thing we would like to do is display only the products that you are eligible for based on your login information. We would like to use images as a link here and if you can sell one product you get one image or maybe bypass and go directly to that section, but if you can sell two or more then those images as links show up as available. The final thing we want to do is to populate the top 3 or so items you perform on the site as quick links.

After all that, are there tools or items I should study to help us accomplish this task? I'm not sure if I need to mix in some sort of third party analytical tool with the asp.net site or what.

Any help or guidance would be greatly appreciated, even if it's only "hey check out X it might help you with some of your work"

(I know I know, what we need is a real web developer who has experience. Aside from that though lol)

yea you would kinda need to get a pretty good understanding of php and a database to do what you are trying to do

I've got a pretty good understanding of databases, I use them all the time. I also use C# on a regular basis and the bulk of the backend will be in C#.net with a ton of datbase interaction. I work as a programmer, thus I'm not a complete newb. :) I'm just trying to shorten the learning cycle by finding the technology that will help me accomplish what I want to do first. No reason to spend a month on JavaScript if I need PHP..... make sense?

I'll grab a few things on PHP since you seem confident that I can do what I need to with it, would you have any suggestions about what specific areas I'll look into once I start looking?

Thanks

If you can code in C# then why are you looking at php? Can't you make a webiste in C#.net? It's roughly the same in syntax as PHP. You'll just be doing the same thing as you would in C# as PHP isn't a client side scripting language. Either way if you are going to use fancy stuff client side you'd use javascript whatever back end language you are going to use.

If the bulk of the backend is going to be C# then you don't need PHP. Just deliver the page based on the C# statements. If you don't want to have page refreshes all the time and want fancy ajax stuff then look at using the JQuery library or something similar, it will help you with javascript stuff.

Thanks for the post,

You see, I can code it in C# server side - but it will require a very large amount of pages for what I want to do. It's not practical. (yes I know I didn't describe exactly what I want to do where this would be evident)

I posted it in the Ajax thread because that's what I believe that I need to use to do what I want to with it, however they told me Ajax wasn't the best way that PHP was, so I posted it up here. Then get warned by a moderator because it's in multiple threads and now you're telling me to go back to Ajax.

It's sort of funny in a way, I had hoped for someone to just give me an idea of where to look but apparently nobody has a clue how to do what I want to do so I'll give up.

I think you're onto something with Ajax, I got a little of it to work and think I can use it but it's going to take some additional study to be sure.

With all the different browsers out there I really suggest looking at JQuery as it will help you with your ajax functions. PHP is a server side scripting language so what people are telling you sounds like they are suggesting using AJAX with PHP. What I'm trying to say is, that whatever you do with AJAX it will need to send parameters to a back-end page (either C# or PHP) If you are already familiar with C# then I see no need for you to learn PHP. You just need to brush up on how AJAX works.

For instance if you have your aspx page

private int id;
public void page_load(byval sender as object){
       id =  request("id");
renderPage();
}
private void renderPage(){
      if(id == 1){
      //show x
      }elseif(id == 2){
       //show y
      }
}

apologies if the syntax is wrong above but I keep jumping from php,vb,c#,js.

Honestly I think the best thing for you to do is look up using JQuery for your javascript to pass parameters and do AJAX stuff with c# aspx pages to handle what data to actually load

I appreciate the help, I had considered that as well but my problem is that with what I want to do it was going to require over 100 different cases or nested if's - basically what I wanted to do was have only the products available to the person show up on their page - but we have so many combinations that it looks like a horrible way to code and even worse way to maintain. I thought if I could dynamically pull the combinations and fill certain criteria based on what was selected for them or their id then I wouldn't have to go that route.

For the second portion I want to pull all the rates available but only display certain parts based on their desires and filter criteria that they can change and hope to avoid page reloads out the yang. It's going to require a bit of reading and I'll keep up with Ajax and see where it leads me, it does appear it will do what I want so I'll mark this as solved.

Thanks again

If you look at each of the things you want to do, none of them seem to be very difficult:

1. Send the user to a different web site
The login will have to pull in info from the (MySQL?) database for this user and probably save them as session variables. Something in the DB will identify the type of user and that is probably the determinant for where to redirect to (php header command).

2. Only display certain products
This is similar to the first point in that some information in the user's record is going to determine this. You have already re-directed to a specific web site so if that isn't specific enough, then you check the user info and decide what should be displayed. You could have this be unique to each user but I would guess that for simplicity you will probably have a limited number of categories that the user could fall into.

3. Images as links ...
I'm not really clear on what you want to do from the explanation but regardless, it doesn't sound too complex.

4. Quicklinks
In this case you need to store the history and then do some real-time analysis. To keep it managable you probably need to give every significant page an identifier and then store that into a history file under the user's id (as you hit each page). Alternately, you could store the info in a table in a Session variable and write it all when they logout (but if they lose the session for some reason, you will lose the info). You'd be better off not storing the direct link in case you make changes to pages or navigation. You'd be better off having a table of codes and associated links. When the user logs in you would read all of the history for that user in order by page identifier, calculate how many times each page was visited and then determine the top three.

You will need a registration and login system. If you don't already have one in place, you'll have to buy one or build one. As I mentioned in another post recently, I went looking for a free / open source PHP login system and I didn't find too much. I eventually used one that was freeware and made a lot of changes to make it work the way I wanted it to. That wasn't trivial and would be a pretty significant first project if you are just starting with PHP. The other stuff listed above isn't really difficult if you know what you're doing in PHP. If you are going to do the whole thing as a first project, it will take a while to get through it. If you are already working in C#.net maybe it would be more consistent to do it in ASP.net instead of PHP (as much as I like PHP).

I was writing this as other replies were coming in so if Ajax works for you, go for it. Jquery is a great package.

Thanks,

I assume that you were in the middle of posting this when I typed my last statement?

I already have a login and registration system in place, I don't need free we're using SQL Server 2005 and a custom system built in-house. My problem turns up with the amount of different combinations, thus I can't build individual pages. I know I can use google analytics and may go that route to help with the frequently used items but wondered if there was a better way.

I can't do a limited number of categories and that's my biggest hurdle at this point. I can make it work with hard code that is similar to what Tommy posted, but as the number grows it doesn't seem like a good method. It appears I'm going to have to build a user interface for the business side and allow them to select what they want displayed and pull the information that way. I had hoped to just use criteria in our current profile but it needs a complete overhaul to do what I want.

Anyway - thanks for the ideas

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.