3 Replies - 864 Views - Last Post: 07 April 2012 - 06:43 AM Rate Topic: -----

#1 JerseyDevil101  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 58
  • Joined: 27-January 11

PHP calendar question

Posted 06 April 2012 - 09:48 PM

Hey guys,
I have a question about using PHP in order to create a calendar on a website. I'm working on a website for a friend and he basically is wanting an event calendar where he can list his available times. I was wondering how would I go about making a calendar where it would show the times and then if you click on that particular event it will take you to a page where you can sign up and pay for it online. I guess for example one time slot has 15 openings and when you click on the particular time slot it takes you to a page where you can look at the event description and how many openings are currently available. If the user decides this event is good he can add the event and pay for it with a credit card.

If I create a php calendar and populate it with events from MySQL database, how would I create a separate webpage when you click on the event so the user can sign up and pay for that specific event? If someone could tell me the basic approach to achieve this that would be great.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: PHP calendar question

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4319
  • View blog
  • Posts: 12,101
  • Joined: 18-April 07

Re: PHP calendar question

Posted 06 April 2012 - 10:30 PM

So you have a calendar with time slots. When a user clicks one, it is just like clicking a hyperlink. It takes them to a second page. The only difference here is that you pass the date/time as parameters to the page. For instance if I click on a date/time for tomorrow April 7th at 1:15pm I could pass the date and time along to a second PHP page....

http://www.somesite.com/calendar/schedule.php?day=2012/04/07&time=13:15



So your second page might be called "schedule.php" and it will take in the two parameters, the day and time. If the user wants it, then they would fill out the form and when they hit submit, it passes the info to the database and sets up the record for that. It then would redirect the user to some payment page (a custom page or something like paypal). Once they pay you have paypal or your payment page tell the database to confirm the date by selecting the record you inserted and setting a field like "confirmed" to true.

This is one way you can approach it. :)
Was This Post Helpful? 0
  • +
  • -

#3 JerseyDevil101  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 58
  • Joined: 27-January 11

Re: PHP calendar question

Posted 07 April 2012 - 01:25 AM

Awesome thanks. Right now I'm just working on my DB and the php code for the actual calendar. I really appreciate pointing me in the right direction!
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2896
  • View blog
  • Posts: 10,032
  • Joined: 08-August 08

Re: PHP calendar question

Posted 07 April 2012 - 06:43 AM

I would use Ajax to send a request to the server so that PHP would only provide information about event(s) for dates. Leaving the calendar to Javascript will take load off the server.

Your friend's site may not be very busy but it might be on a shared server so speed could still be important.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1