Jump to content

gudfry

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gudfry's Achievements

Member

Member (2/5)

0

Reputation

  1. <?php switch($select) { case "city": { if ($select!=all) { $city=$select; $select="city"; } else $city=$select; $heading="Hotels for \"".city::getDisplayName($city)."\""; $hotelsToShow=hotel::getForCity($city); break; } case "region": { if ($select!=all) { $region=$select; $select="region"; } else $region=$select; break; $heading="Hotels for \"".city::getDisplayName($region)."\""; $hotelsToShow=hotel::getForRegion($region); break; } case "province": { if ($select!=all) { $province=$select; $select="province"; } else $province=$select; break; $heading="Hotels for \"".city::getDisplayName($select)."\""; $hotelsToShow=hotel::getForProvince($select); break; } case "all": { $heading=""; $hotelsToShow=hotel::getAll(); break; } } ?> <script type="text/javascript"> <!-- function formS() { var form1; form1=document.getElementById("myForm"); form1.submit(); } function myRegion() { var form1; form1=document.getElementById("myRegion"); form1.submit(); } function myProvince() { var form1; form1=document.getElementById("myProvince"); form1.submit(); } // --> </script> <h2> Overview of hotels in Mindanao</h2> Please send additional information or corrections to <a href="mailto:info@mindanao-hotels.com">Mindanao Hotels</a> <p> </p> <form id="myRegion" method="get" action="index.php"> <p> <select name="select" style="width:200px" onchange="myRegion()"> <option value="all">Region</option> <?php $ForRegion=region::getAllRegion(); if (!isError($ForRegion)){ foreach ($ForRegion as $element => $value) { echo '<option value="'.$value->Region_id.'"'; if ($value->Region_id==@$region) echo ' selected="selected"'; echo '>'.$value->displayName.'</option>'; } } ?> </select> <input type="hidden" name="menu" value="region"></input> </p> </form> <form id="myProvince" method="get" action="index.php"> <p> <select name="select" style="width:200px" onchange="myProvince()"> <option value="all">Province</option> <?php $ForProvince=province::getProvinceById($region); if (!isError($ForProvince)){ foreach ($ForProvince as $element => $value) { echo '<option value="'.$value->Province_id.'"'; if ($value->Province_id==@$province) echo ' selected="selected"'; echo '>'.$value->displayName.'</option>'; } } ?> </select> <input type="hidden" name="menu" value="province"></input> </p> </form> <form id="myForm" method="get" action="index.php"> <p> <select name="select" style="width:200px" onchange="formS()"> <option value="all">All cities</option> <?php $cities=city::getCitiesById($region); if (!isError($cities)){ foreach ($cities as $element => $value) { echo '<option value="'.$value->City_id.'"'; if ($value->City_id==@$city) echo ' selected="selected"'; echo '>'.$value->displayName.'</option>'; } } ?> </select> <input type="hidden" name="menu" value="city"></input> </p> </form>
  2. <form id="myProvince" method="get" action="index.php"> <select name="select" style="width:200px" onchange="myProvince()"> <option value="all">Province</option> <?php $ByProvinceToShow=province::getByProvince($select); if (!isError($ByProvinceToShow)) { foreach ($ByProvinceToShow as $element => $value) { $GetbyProvince=province::getForProvince($province); echo '<option value="<ahref="index.php?menu=province&province='.$value->Province_id.'&select='.$value->Province_index.'"></a>'; echo ' selected="selected"'; echo '>'.$value->Province_name.'</option>'; } } ?> </select> <input type="hidden" name="menu" value="province"></input> </form>
  3. hi all; Sory for disturbanced, Im just newbie in PHP really needed your help , basically i have created three dropdown list. but I got a problem to display the value on selected category. here is my problem, I create a three dropdown list which is passing each parameter, when I select the first dropdown list, the second and the third dropdown list is going to change base on the parameter I inputed, and alo it display the value base on get the id, which is i have no problem in my first selection, my problem is, when i select the value on second dropdown list I cannot display the value on for the second selector and desame with the third dropdown list. here is my code.. <p> <select name="select" style="width:200px" onchange="myRegion()"> <option value="all">Region</option> <?php $ForRegion=region::getAllRegion(); if (!isError($ForRegion)){ foreach ($ForRegion as $element => $value) { echo '<option value="'.$value->Region_id.'"'; if ($value->Region_id==@$region) echo ' selected="selected"'; echo '>'.$value->displayName.'</option>'; } } ?> </select> <input type="hidden" name="menu" value="region"></input> </p> </form> <form id="myProvince" method="get" action="index.php"> <p> <select name="select" style="width:200px" onchange="myProvince()"> <option value="all">Province</option> <?php $ForProvince=province::getProvinceById($region); if (!isError($ForProvince)){ foreach ($ForProvince as $element => $value) { echo '<option value="'.$value->Province_id.'"'; if ($value->Province_id==@$province) echo ' selected="selected"'; echo '>'.$value->displayName.'</option>'; } } ?> </select> <input type="hidden" name="menu" value="province"></input> </p> </form> <form id="myForm" method="get" action="index.php"> <p> <select name="select" style="width:200px" onchange="formS()"> <option value="all">All cities</option> <?php $cities=city::getCitiesById($region); if (!isError($cities)){ foreach ($cities as $element => $value) { echo '<option value="'.$value->City_id.'"'; if ($value->City_id==@$city) echo ' selected="selected"'; echo '>'.$value->displayName.'</option>'; } } ?> </select> <input type="hidden" name="menu" value="city"></input> </p> </form> hope anyone can help me. because I lost my power
  4. die("Cannot set encoding to UTF-8 in common<n>.php"); if (!mb_http_output("UTF-8")) die("Cannot set encoding to UTF-8 in common<n>.php");
  5. thank you so much, but yes I'am already put the RCPT email id, but its desame;
  6. hi all suposed to be this question has been solve, perhaps sory if i need to ask again. I found a code of send and email using with php classes; but there is something wrong with it. here is the whole code. var $email; var $senderName; var $senderPhone; var $senderEmail; var $senderSubject; var $senderMessage; var $returnEmail; var $header; var $type = "text/plain"; var $characterSet = "iso-8859-1"; function createHeader() { $from = "From: $this->senderName <$this->senderEmail>\r\n"; $returnEmail = "Reply-To: $this->returnEmail\r\n"; $params = "MIME-Version: 1.0\r\n"; $params .= "Content-type: $this->type; charset=$this->characterSet\r\n"; $this->header = $from.$returnEmail.$params; return $this->header; } function sendEmail(){ $this->createHeader(); @mail($this->email,$this->senderSubject,$this->senderMessage,$this->header); } } $mail->email = $_POST['email']; $mail->senderName = $_POST['senderName']; $mail->senderEmail = $_POST['senderEmail']; $mail->senderPhone = $_POST['senderPhone']; $mail->senderSubject = $_POST['senderSubject']; $mail->senderMessage = $_POST['senderMessage']; if ($mail->sendEmail()) { echo "Thanks for your message!"; } else { echo "Sending email was failed!"; } when i run this code. there is an error on the screen, please help me to fixed this error. regards to all,
  7. hi all; subject : test From : jhon stone [jhone@xxxxxxxxxxx.xxx] to : reciepient message : this is only for testing. class request { var $mail_id; var $email; var $name; var $address1; var $guestEmail; var $guestPhone; var $senderName; var $subject; var $message; function createHeader() { $from = "From : $this->senderName <$this->guestEmail>\r\n"; $input->header = $from; return $input->header; } function send_email($input){ $input->createHeader(); if (@mail($input->to, $input->subject, $input->message, $input->header)){ return true; } else { return false; } }
  8. this is i defined my classes nad call my function; here is the whole code; $name = $_POST['name']; $phone = $_POST['phone']; $email = $_POST['email']; $senderName = $_POST['senderName']; $guestEmail = $_POST['guestEmail']; $guestPhone = $_POST['guestPhone']; $subject = $_POST['subject']; $message = $_POST['message']; require_once('classEmail.php'); include('connect.php'); $input = new request(); $input->setName($name); $input->setEmail($email); $input->setPhone($phone); $input->setsenderName($senderName); $input->setguestPhone($guestPhone); $input->setguestEmail($guestEmail); $input->setsubject($subject); $input->setmessage($message); $stored = new stored(); $stored->storedRecord($input); var $mail_id; // hotel id in emailRecord Auto_increment. var $name; // hotel name in emailRecord. var $email; // hotel email id. var $phone; // hotel contact number in emailRecord. var $senderName; // Guest name. var $guestPhone; // Guest Phone number. var $guestEmail; // Guest email id. var $subject; // Guest title. var $message; // Guest message. function setName($name) { $this->name = $name; } function setEmail($email) { $this->email = $email; } function setPhone($phone) { $this->phone = $phone; } function setsenderName($senderName) { $this->senderName = $senderName; } function setguestPhone($guestPhone) { $this->guestPhone = $guestPhone; } function setguestEmail($guestEmail) { $this->guestEmail = $guestEmail; } function setsubject($subject) { $this->subject = $subject; } function setmessage($message) { $this->message = $message; } } class stored { function storedRecord($data) { $sql = "insert into emailrecord (name, phone, senderName, guestEmail, guestPhone, subject, message) values ('$data->name', '$data->phone', '$data->senderName', '$data->guestEmail', '.$data->guestPhone', '$data->subject', '$data->message')" or die("Query failed : " . mysql_error()); echo $sql; } } hope everybody get the point
  9. yes i ahve, there is no error display,
  10. hi all; I have a class function to perform the insertion of data into database, but this not work. please help. here is my code that I found in the internet. this not working, i try already. require_once('connect.php'); class email { var $mail_id; // hotel id in emailRecord Auto_increment. var $name; // hotel name in emailRecord. var $email; // hotel email id. var $phone; // hotel contact number in emailRecord. var $senderName; // Guest name. var $guestPhone; // Guest Phone number. var $guestEmail; // Guest email id. var $subject; // Guest title. var $message; // Guest message. function setName($name) { $this->name = $name; } function setEmail($email) { $this->email = $email; } function setPhone($phone) { $this->phone = $phone; } function setsenderName($senderName) { $this->senderName = $senderName; } function setguestPhone($guestPhone) { $this->guestPhone = $guestPhone; } function setguestEmail($guestEmail) { $this->guestEmail = $guestEmail; } function setsubject($subject) { $this->subject = $subject; } function setmessage($message) { $this->message = $message; } } class stored { function storedRecord($data) { $sql = "insert into emailrecord (name, phone, senderName, guestEmail, guestPhone, subject, message) values ($data->name, $data->phone, $data->senderName, $data->guestEmail, $data->guestPhone, $data->subject, $data->message)"; echo $sql; } } ?> Thanks to all
  11. hi all; i have found a code that would generate a time and date, this works fine, my main goal is i want to change the date and time format. here is the code that i found, mysql_query("INSERT INTO mailrecord set date=CURDATE(), time=CURTIME()"); this format will output CURTIME() : 14:13:32 CURDATE() : 2008-08-08 hope anyone can tell me where can i find a good source to output this format CURTIME() : 1:13:32pm CURDATE() : friday : 08 : 2008
  12. hi all; can anyone tell me where can i find a good example for this; i have this whole code $name = $_POST['name']; $sender = $_POST['e_mail']; $phone = $_POST['phone']; $subject = $_POST['subject']; $message = $_POST['message']; $email = $_POST['email']; // Insert data into hotelinfo table $sql="INSERT INTO mailRecord(name, sender, phone, subject, fax, message) VALUES('$name', '$sender', '$phone', '$subject', '$message')"; $result=mysql_query($sql); mysql_close(); $to = ''.$email.'' . ', '; // note the comma $to .= 'frankcris@xxxxx.xxx'; $subject = "$subject"; $body = "Guest message.\n\n $message\n\n"; mail ($to , $subject, $body, 'From: '.$sender.''); ?> <script type="text/javascript"> alert("Thank you for sending a message!") window.history.back(1); </script> I cant inseert the data into database. pleas hlp me thank for advance
×
×
  • 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.