Jump to content


Photo

Questions in PHP


  • Please log in to reply
2 replies to this topic

#1 freddykhalid

freddykhalid
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 13 April 2006 - 05:41 PM

Hi everyone, I'm new to the PHP language but I love it and it's becoming quite an addiction to me. I'm supposed to build a website with many features with some that I haven't understood. So help is required please.

The features I don't know how to create are the following:

1)Display a stopwatch time counter for the time elapsed since the visitor accessed the site.

2) Switch the visitor automatically to the relevant version of the Web site according to his browser type (IE or Mozilla)

3) Display how many visitors are currently on the website

4) Display the visit number for recurring visitors

5) Notify the webmaster via Email or SMS everytime someone accesses the secure area of the website using authentication

6)Show a simple log of the user surfing habits.
The log should include the pages visited by this user and the duration of his stay on each page


I am using Wamp web server currently until moving this onto the server.
Help required ASAP.

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 13 April 2006 - 07:01 PM

Umm... so do you have any ideas? Have you tried anything yet, or do you expect us to sit here and just spit code back at you?

I'm not going to write code for you, but I can tell you how to do it:

1) PHP can't display a timer live on the page, but you can log the time they showed up on the site in a database and everytime they access another page, do a simple subtraction.

2) You can get some browser information from the headers, and send them to specific portions of the site depending on the browser, but you should really be able to develop a website that works across all browsers, except for maybe a few features that might use something like ActiveX, which would require IE.

3) Everytime someone access a page, update a record with their IP with a timestamp. Then you just run a query that grabs everyone that has been active in the past 15 minutes.

4) When someone logs on, update your table that contains the IP, but check to make sure that they haven't been active within X amount of time.

5) Use the mail() function for email, I'm not sure how to do SMS.

6) Track pages used by each IP in another table. Showing how long they were on the site is tricky, since it will have to be based off of their last action, unless you fire off an AJAX event in the background that will run as long as the user has the browser open.

You sound like you're in over your head. You might want to get a book on MySQL and PHP.

Info: PHP Manual


#3 freddykhalid

freddykhalid
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 13 April 2006 - 07:21 PM

[!--quoteo(post=364521:date=Apr 13 2006, 11:01 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Apr 13 2006, 11:01 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Umm... so do you have any ideas? Have you tried anything yet, or do you expect us to sit here and just spit code back at you?

I'm not going to write code for you, but I can tell you how to do it:

1) PHP can't display a timer live on the page, but you can log the time they showed up on the site in a database and everytime they access another page, do a simple subtraction.

2) You can get some browser information from the headers, and send them to specific portions of the site depending on the browser, but you should really be able to develop a website that works across all browsers, except for maybe a few features that might use something like ActiveX, which would require IE.

3) Everytime someone access a page, update a record with their IP with a timestamp. Then you just run a query that grabs everyone that has been active in the past 15 minutes.

4) When someone logs on, update your table that contains the IP, but check to make sure that they haven't been active within X amount of time.

5) Use the mail() function for email, I'm not sure how to do SMS.

6) Track pages used by each IP in another table. Showing how long they were on the site is tricky, since it will have to be based off of their last action, unless you fire off an AJAX event in the background that will run as long as the user has the browser open.

You sound like you're in over your head. You might want to get a book on MySQL and PHP.
[/quote]

I really thank you for your reply. I'm sorry if I offended but you can't imagine the huge amount of work that I have, that's why I'm asking over the internet which is the first time. I am currently developing a php website so I do know what I'm doing. The things I mentioned are the issues I don't know how to do only. In other words, this is a small part of a very big website my friend so I am trying my best.

About the mail function, do you have a URL where I can configure this function? Because it doesn't seem to be working for me.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users