Jump to content

lional

Members
  • Posts

    271
  • Joined

  • Last visited

Everything posted by lional

  1. $query = "SELECT * from availability"; $result = mysql_query($query, $conn); while ($row = mysql_fetch_array($result)){ $booking_date_out = $row[booking_date]; }
  2. Hi All I am trying to runa query where I have multiple records each containing a date. I want to use these dates to change the background of my table using php at a later stage. My problem is that each date that is pulled overwrites the previous date, whch means that the end of the queryonly the last date is shown. Is there a way to run a query so that all the dates are stored and that they can all be referenced. Thanks Lional
  3. I am actually looking for a very simple version of a calendar. Very much like Barend sugested with his crossed. each view must only show the current month with previous and next links to navigate between the months. The main criteria is that it must pull the dates from a tabe, the same structure that barend suggested and make the background red for the days that are booked, and green for the days that are not booked. I think the calandar that redarrow showed is a bit advanced for my knowledge of php at the moment, and also overkill for what I need. Can anybody please help Thanks Lional
  4. How will I pull the info from the database. I only know the basics of php so I am struggling a bit with the calendar. Where do I insert the code you mentioned Appreciate any help Thanks Lional
  5. Thanks for your help- barend, I am getting there. I am just stuch at my last hurdle. The dates are writing perfectly to my dataase but what I would like to do, and I just can't seem toget right is to make the background red if the date is in the bookings database, and green if it is not ie the day is available. I am trying to use the calendar that redarrow posted Could you just point me in the right direction please Thanks Lional
  6. Thanks to everyone that helped me with my calendar, I am making progress. I would just like to know how one would write consecutive dates to a database. I want to have a from date and a to date. When the booking is made it must show up on my calendar. What is the best way to write consecutive dates to a database so that my calendar can read it for eg if somebody books for 5 consecutive days, then my calendar must be able to show that particular room booked for those 5 days. Could somebody please expalin to me how this is done Regards Lional
  7. Hi All I am trying to write a site for a guesthouse. What I would like to do is have a calender that will show when a particular room is booked. Ideally I would like to use PHP and mysql. When somebody books for a room it must update the database table. The calendar must then get this info and update itself. The guesthouse has four rooms so I think the best would be to have a calander for each room, which will show the day in red when it is booked and in green in availalble. Is this the best way of doing this or does anyone else have any suggestions. I have never tried this before so it is all very new to me. Any help would be appreciated Thanks Lional
  8. Goodday I am trying to create form validation where the submit button will be disabled until all the input fileds and the textarea have been filled in, then it will be active Is this possible Any help will be appreciated Regards Lional
  9. Hi All I need to write something and I would like to know if it is possible to set the smtp server settings in the script itself rather than the php.ini Any help will be apprediated Thanks Lional
  10. I am trying to format the date from a variable. I have created a variable called $date wich is populated from a form. I want to make sure that the format will be correct because this is dependent on how the user inputs it. I want to format it dd/mm/yyyy. I know how to do it with the date function but does that not take the current date and not the date stored in the variable. Any help will be appreciated
  11. lional

    Forums

    I am trying to wrtite a forum for a intranet. I have never done a forum before so I am not sure where to start. All I need is for each user to log on so that they can be identified, have a section for the subject and then the message. I have no categories as it is just for people to communicate with each other. I then want the messages to be deleted automatically after 2 weeks. I looked at the php scripts on this site but none seems to be able to help me. Any assistance will be appreciated Thanks Keep up the good work
  12. I would like to have a script where I can pull email addresses from a mysql table, and then either select all of the email addresses or selected email addresses and send a message to them all simultaneously Any idea where I can get info on such a script Regards Lional
  13. I am busy writing a mail script. What I would like to do is give a confirmation message if the mail was sent successfully, or a generic message if it was unsuccessful. Here is what my script looks like: <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head> <title>Easy Security</title> </head> <body> <?php $firstname = $_POST['firstname']; $surname = $_POST['surname']; $telephone = $_POST['telephone']; $cell = $_POST['cell']; $email = $_POST['mail']; $subject = $_POST['subject']; $message = $_POST['message']; ?> <? include 'includes/conn_db.php'; $query1 = "INSERT INTO clients (firstname, surname, telephone, cell, mail) VALUES ('$firstname', '$surname', '$telephone', '$cell', '$email')"; $result1 = @mysql_query ($query1); $query_count = "SELECT * from bulkmail WHERE mail = '$email'"; $result_count = mysql_query($query_count); $num_records = @mysql_num_rows($result_count); if ($num_records == 0) { $query2 = "INSERT INTO bulkmail (firstname, surname, telephone, cell, mail) VALUES ('$firstname', '$surname', '$telephone', '$cell', '$email')"; $result2 = @mysql_query ($query2); } ?> <? $adminmail = "info@it-people.co.za"; ?> <? // Recipients. You can send it to more than 1 person! $to = "$adminmail" ; // note the comma ?> <? // This is the email subject $my_subject = "$subject"; ?> <? // Message $my_message = <<<MESSAGE First Name: $firstname<br>Surname: $surname<br>Telephone: $telephone<br>Cellphone: $cell<p>$message MESSAGE; ?> <? $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: $email"; ?> <? // And now mail it! mail($to, $my_subject, $my_message, $headers); ?> </body> </html> Any help will be appreciated Thanks Lional
  14. Hi I hope someone can please help me. I have been trying to use HV Menu from www.dynamicdrive.com. This works fine except for one small thing. I would like the submenu's to be pulled from a mysql database so that when menu items are added or deleted it will dynamically reflect on the page. There will be a connection between the top level menu item and its subcategories. Is this possible and if so what is the best way to accomplish this Appreciate any help Thanks Lional
  15. I have a mysql table with a integer data type for one of my fields. I would like to only select the highest numeric value from that field, so that I can use it for manipulation in my php code. Is it possible to retrieve just that highest value. Appreciate any assistance Thanls Lional
×
×
  • 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.