Jump to content

pixeltrace

Members
  • Posts

    577
  • Joined

  • Last visited

    Never

Everything posted by pixeltrace

  1. i need help on my mysql statement. i want to have an output similar to the portfolio updates on this page http://mango.resonance.com.sg/ILEC/home.php wherein the property items is displayed in 3 columns. i actually have the code for the displaying in 3 columns already but my problem is i dont know how to code the sql statement for this. what i wanted to achieve is to only display the latest 3 updates for the 3 property name (macao, raffles, zayed) something like this select propety_name, property_desc from property where property name = raffles, macao, zayed order by date_created limit 1(per property_name) hope you could help me with this. thanks!
  2. hi, just want to ask if there is any tool or code that can convert md5 password to the normal password? thanks!
  3. Hi, I have a newsroom section in one of my projects and some of the news title are so long. now, my boss wants to limit the number of characters to be displayed in the lists of news room title to 50 characters only. my problem is, i dont know how to do it. below is my current code for the listing of news title. function getTop3() { $sql = "SELECT * FROM ilec_news WHERE published = 1 ORDER BY news_date DESC LIMIT 0, 3;"; $dbConn = new DBConn(); $con = $dbConn->connect(); $result = mysql_query($sql); $records = array(); while($row = mysql_fetch_array($result)) { $news = new News(); $news->id = $row['news_id']; $news->title = $row['news_title']; $news->content = $row['news_content']; $news->pdf_link = $row['news_pdflink']; $news->date = $row['news_date']; $news->created = $row['news_date_created']; $news->published = $row['published']; $records[] = $news; } mysql_close($con); return $records; } echo '<table width="100%">'; foreach ($records as $row) { echo '<tr><td style="padding-left:5px"><span class="text2"><strong>' . date('d F, Y', $row->date) . '</strong><br>' . $row->title . '</span></td></tr><tr><td><hr class="a" align="left" width="130"></td></tr>'; } echo '</table>'; } hope you could help me with this. thanks!
  4. Hi, i need help. i need an effect in 1 of the page of my site wherein i will need to change the background image of the page on a given delay time. i tried this document.getElementById("LINK1").style.backgroundImage="image.gif"; but i need a delay on how the background image will load i tried using the onLoad=Display('id', {delay:10.0}) inside the <body> tag but its still not working hope you could help me with this. thanks!
  5. please ignore. i was able to fix it already. i just change line 117 with if (($cname != "$category_name")||($p != "$parent")){ thanks!
  6. hi, i need help. i have an edit form which as a validation code to check if the new parent category/subcategory is not yet existing in the database. apparently only my parent validation code is working, but my validation code for the subcategory is not working. below is my current code <? session_start(); if (session_is_registered("username")){ $username = $_SESSION['username']; $cid = $_GET['cid']; include 'db_connect.php'; $query = mysql_query("SELECT parent, category_name, cid FROM engsoon_categories WHERE cid= '$cid'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $category_name = $row["category_name"]; $parent = $row["parent"]; ?> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="6" align="left"><img src="../images/spacer.gif" width="6" height="10" /></td> <td width="100%"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"> <form name="fileup" method="post" enctype="multipart/form-data" action="<? echo $PHP_SELF; ?>"> <table width="515" border="0" cellspacing="2" cellpadding="3"> <tr> <td colspan="4" valign="top"><img src="images/spacer.gif" width="10" height="1" /></td> </tr> <tr> <td colspan="4" bgcolor="#999999" class="text2">EDIT PRODUCT CATEGORY</td> </tr> <tr> <td colspan="4" valign="top"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <tr> <td width="148" align="right" valign="top" class="text6"><? if ($parent == '0'){ echo "parent category :"; }else{ echo "category name :"; } ?> </td> <td> </td> <td width="332" colspan="2" class="text7"><input name="category_name" type="text" size="40" value="<? echo "$category_name"; ?>" class="textfield"></td> </tr> <? if ($parent ==0) {echo "";}else { ?> <tr> <td align="right" valign="top" class="text6">parent category : </td> <td width="1"> </td> <td colspan="2"><select name="parent" class="textfield"> <option value="">-- select parent category --</option> <? $_SESSION['fu'] = $parent; $uSql = "SELECT category_name, cid FROM engsoon_categories WHERE parent =0"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[1]?>" <?php if(($uRow[1] == $_SESSION['fu']))print 'selected';?>> <?= $uRow[0]?> </option> <? } } ?> </select></td> </tr> <tr> <td align="right" valign="top" class="text6"> </td> <td width="1"> </td> <td colspan="2" class="text7">* select a parent category only for sub category items </td> </tr> <? } ?> <tr> <td> </td> <td> </td> <td colspan="2"><input type="submit" value="submit" name="submit"> <input type="hidden" name="username" value="<? echo "$username"; ?>"> <input type=hidden value=http://www. name=redirect> <input type="hidden" value="<? echo "$cid"; ?>" name="cid" /> <input type="hidden" value="<? echo "$category_name"; ?>" name="cname" /> <input type="hidden" value="<? echo "$parent"; ?>" name="p" /> </td> </tr> <tr> <td> </td> <td> </td> <td colspan="2"> </td> </tr> </table> </form> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td width="6" align="right"><img src="../images/spacer.gif" width="6" height="10" /></td> </tr> </table> <? //see if we have submited and that the files array has been set if(($_POST["submit"]=="submit")){ $category_name = $_POST['category_name']; $parent = $_POST['parent']; $cname = $_POST['cname']; $p = $_POST['p']; //$category_name_cn = $_POST['category_name_cn']; //$parent_cn = $_POST['parent_cn']; $cid = $_POST['cid']; if (($cname != "$category_name")&&($p != "$parent")){ //parent category verification english $sql_parent_check = mysql_query("SELECT category_name FROM engsoon_categories WHERE parent = 0 AND category_name='$category_name'"); $parent_check = mysql_num_rows($sql_parent_check); if($parent_check > 0){ echo '<script language=javascript> alert("parent category already exist!");top.location = "categorymngr.php?id=3&cid='.$cid.'";</script>'; unset($parent); exit(); } //subcategory verification english $sql_subcat_check = mysql_query("SELECT category_name FROM engsoon_categories WHERE parent = '$parent' AND category_name='$category_name'"); $subcat_check = mysql_num_rows($sql_subcat_check); if($subcat_check > 0){ echo '<script language=javascript> alert("subcategory item for this parent category already exist!");top.location = "categorymngr.php?id=3&cid='.$cid.'";</script>'; unset($parent); exit(); } } $sql="UPDATE engsoon_categories SET category_name ='$category_name', parent='$parent' WHERE cid='$cid'"; mysql_query($sql) or die("error:".mysql_error()); echo '<script language=javascript> alert("category item has been updated!");top.location = "categorymngr.php?id=2";</script>'; } }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } ?> and the code for my validation is starts at line 117. is this code the simpliest way or is there a better way to validate it? also, i dont know what is wrong with my code. been checking this for 5 days already. hope you could help me with this. thanks!
  7. hi, this may not be a php question but im just trying my luck if someone here can help me http://mango.resonance.com.sg/ILEC/portfolio/raffles/gallery.php this is the page that i am working on and if you notice, when you click on the thumbnails my right sidebar is getting messed. my question is, how can i set the height of that table regardless what is the size of my current large thumbnail image? i tried using style="height:auto" is didnt work hope you could help me with this thanks!
  8. hi, i tried this one <? for ($a = 1; $a <= "17"; $a++){ /* add $thumbsxxx depedening on how many your image thumbnails */ $thumbs.$a = "images/".$a.".gif"; /* add $thumbsxxx end */ /*add $image_thumbs[""] = ""; depending on how many your large images */ $image_thumbs["'"."$thumbs".$a."'"] = "images/".$a.".jpg"; /*add $image_thumbs[""] = ""; end */ /*add $text_thumbs[""] = ""; depending on how many your large images */ $text_thumbs["'"."$thumbs".$a."'"] = "images/t".$a.".gif"; /*add $text_thumbs[""] = ""; end */ } ?> but i am getting this error Notice: Undefined variable: thumbs in /var/www/html/ILEC/portfolio/raffles/gallery.php on line 4 Notice: Undefined variable: thumbs in /var/www/html/ILEC/portfolio/raffles/gallery.php on line 7 Notice: Undefined variable: thumbs in /var/www/html/ILEC/portfolio/raffles/gallery.php on line 11 hope you could help me with this. thanks!
  9. hi, i need help, i have a code here wherein i will keep on adding whenever i need to add a new image for the gallery of the website. <? /* add $thumbsxxx depedening on how many your image thumbnails */ $thumbs1 = "images/1.gif"; $thumbs2 = "images/2.gif"; $thumbs3 = "images/3.gif"; $thumbs4 = "images/4.gif"; $thumbs5 = "images/5.gif"; $thumbs6 = "images/6.gif"; /* add $thumbsxxx end */ /*add $image_thumbs[""] = ""; depending on how many your large images */ $image_thumbs["$thumbs1"] = "images/1.jpg"; $image_thumbs["$thumbs2"] = "images/2.jpg"; $image_thumbs["$thumbs3"] = "images/3.jpg"; $image_thumbs["$thumbs4"] = "images/4.jpg"; $image_thumbs["$thumbs5"] = "images/5.jpg"; $image_thumbs["$thumbs6"] = "images/6.jpg"; /*add $image_thumbs[""] = ""; end */ /*add $text_thumbs[""] = ""; depending on how many your large images */ $text_thumbs["$thumbs1"] = "images/t1.gif"; $text_thumbs["$thumbs2"] = "images/t2.gif"; $text_thumbs["$thumbs3"] = "images/t3.gif"; $text_thumbs["$thumbs4"] = "images/t4.gif"; $text_thumbs["$thumbs5"] = "images/t5.gif"; $text_thumbs["$thumbs6"] = "images/t6.gif"; /*add $text_thumbs[""] = ""; end */ ?> is there a way to make this simplier and shorter? so that i dont need to add line of codes each time i add a new image? the naming convention of the filename and variables are base on how many the total image files are. i know what logic to use already but i dont know how to code it it something like this $total number of images = xx; /* add $thumbsxxx depedening on how many your image thumbnails */ $thumbsxx = "images/xx.gif"; /* add $thumbsxxx end */ /*add $image_thumbs[""] = ""; depending on how many your large images */ $image_thumbs["$thumbsxx"] = "images/xx.jpg"; /*add $image_thumbs[""] = ""; end */ /*add $text_thumbs[""] = ""; depending on how many your large images */ $text_thumbs["$thumbsxx"] = "images/txx.gif"; /*add $text_thumbs[""] = ""; end */ is there a way to get a code in such i way that i will just replace the xx from $total number of images so that i wont need to add 1 line for each and the output will be something like an array or something? hope you could help me with this. thanks!
  10. hi. thanks for all the help, really appreciate it. i was able to come out with a solution and it worked. UPDATE my_table SET `my_field` = replace(`my_field`, "old_text", "new_text") i runned this in mysql from the server. thanks!
  11. hi, i need help. currently i dump some data into our database from another database. now, i found some wierd characters  at the end of each of those items. and there are like 500 items in my database table which has those. is there a way that i can remove it using mysql query to be run in mysql or phpmyadmin something like update * from table where field name item has  and replace it with just blank? hope you could help me with this thanks!
  12. hi, i have a form and it saves all logs into the enquiry.csv everything is working fine except that for the message text area, when i type something with spaces example test1 test2 test2 the output in my csv is being moved into other cells below is my current code <? /* code for the sending of mail and saving to csv start */ if (isset($_POST['Submit'])) { $salutation = $_POST['salutation']; $name = $_POST['name'] ; $email = $_POST['email'] ; $phone = $_POST['phone'] ; $organization = $_POST['organization'] ; $designation = $_POST['designation'] ; $enquiry = $_POST['message'] ; $msg = "A General Enquiry was sent from Capitaland ILEC website \n" ."Name: ".$name."\n" ."Email Address: ".$email."\n" ."Contact No: ".$phone."\n" ."Organization: ".$organization."\n" ."Designation: ".$designation."\n" ."Enquiry: ".$enquiry; //mail the above data // to send HTML mail, the Content-type header must be set //$to ='redha.eepsooni@resonance.com.sg'; $to ='raymund.evangelista@resonance.com.sg'; $subject = 'CapitaLand ILEC - General Enquiry'; $message = $msg; $headers = 'From: ' .$email. "\r\n"; $headers .= 'Bcc: erica.sim@resonance.com.sg' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); $cr = "\n"; $date=date('Y-M-d G:i:s'); //write data to csv $data = $name . ',' . $email . ',' . $phone . ',' . $organization . ',' . $designation . ',' . $enquiry . ',' . $date . $cr; $filename = 'logs/enquirylog.csv'; $fp = fopen($filename,"a"); // $fp is now the file pointer to file $filename if($fp){ fwrite($fp,$data); // Write information to the file fclose($fp); // Close the file } } /* code for the sending of mail and saving to csv end */ ?> hope you could help me with this. thanks!
  13. thanks! it worked!
  14. hi, i need help, i got an inquiry page and i am having a problem on my if condition on line 203 Notice: Undefined index: Submit in /var/www/html/ILEC/contact.php on line 203 below is my current code <? if (isset($_POST['Submit'])) { $salutation = $_POST['salutation']; $name = $_POST['name'] ; $email = $_POST['email'] ; $phone = $_POST['phone'] ; $organization = $_POST['organization'] ; $designation = $_POST['designation'] ; $message = $_POST['message'] ; $msg = "A General Enquiry was sent from testwebsite \n" ."Name: ".$name."\n" ."Email Address: ".$email."\n" ."Contact No: ".$phone."\n" ."Organization: ".$organization."\n" ."Designation: ".$designation."\n" ."Enquiry: ".$message; //mail the above data // to send HTML mail, the Content-type header must be set $to ='email@email.com'; $subject = 'test - General Enquiry'; $message = $msg; $headers = 'From: ' .$email. "\r\n"; $headers .= 'Bcc: bcc@email.com' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); $cr = "\n"; $date=date('Y-M-d G:i:s'); //write data to csv $data = $name . ',' . $email . ',' . $phone . ',' . $organization . ',' . $designation . ',' . $message . ',' . $date . $cr; $filename = 'logs/enquirylog.csv'; $fp = fopen($filename,"a"); // $fp is now the file pointer to file $filename if($fp){ fwrite($fp,$data); // Write information to the file fclose($fp); // Close the file } } ?> <html> <head> <?php include("model/class/DBConn.php"); include("model/class/SEO.php"); include("model/SEOManager.php"); $seoManager = new SEOManager(); $seo = $seoManager->get(5); ?> <title><?php echo $seo->title; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Keywords" content="<?php echo $seo->keywords; ?>"> <meta name="Description" content="<?php echo $seo->description; ?>"> <link href="includes/style.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <!-- scripts for the sidebar start--> <link href="includes/js/base.css" rel="stylesheet" type="text/css"> <link href="includes/js/index.css" rel="stylesheet" type="text/css"> <script src="includes/js/prototype.js" type="text/javascript" charset="utf-8"></script> <script src="includes/js/scriptaculous.js" type="text/javascript" charset="utf-8"></script> <script src="includes/js/browserdetect.js" type="text/javascript" charset="utf-8"></script> <script src="includes/js/drawers.js" type="text/javascript" charset="utf-8"></script> <!-- scripts for the sidebar end --> <script src="includes/js/tabs.js" type="text/javascript" charset="utf-8"></script> <style type="text/css"> <!-- .style1 {color: #FFFFFF} --> </style> </head> <body class="iphone" id="index"> <table width="882" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="16" align="left" background="images/leftbg.gif"><img src="images/leftbg.gif" width="16" height="5"></td> <td width="850"><table width="850" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="850"> <!-- header table start--> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="412" rowspan="3" valign="top"><img src="images/logo.gif" width="403" height="114"></td> <td width="438"></td> </tr> <tr> <td><!-- top navi start--> <? include ('includes/topnav.php'); ?> <script>change5();</script> <!-- top navi end --></td> </tr> <tr> <td align="right" valign="bottom"><!-- search bar start --> <? include ('includes/searchbar.php'); ?> <!-- search bar end --> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table> <!-- header table end--> </td> </tr> <tr> <td><table width="850" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="205" valign="top" style="padding-left:15px"><?php include("includes/sidebar.php"); ?> <!-- welcome start --> <!-- welcome end --></td> <td width="645" rowspan="2" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#003466" height="8"><img src="images/blank.png" width="1" height="8"></td> </tr> <tr> <td style="padding-bottom:20px; padding-top:10px "><span class="title2">Contact Us</span></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2" class="title3" style="padding-bottom:10px "> CapitaLand ILEC Pte. Ltd.<br> A Member of CapitaLand<br> 8 Shenton Way #49-01 <br> Singapore 068811 </td> </tr> <tr> <td width="10%" class="text1"><b>Tel no. </b></td> <td width="90%"> <span class="title3"> (65) 6622 6000</span> </td> </tr> <tr> <td class="text1"><b>Fax no. </b></td> <td width="90%" class="title3"> (65) 6822 6038 </td> </tr> <tr> <td class="text1"><b>Reg no. </b></td> <td width="90%" class="title3"> 199701358Z </td> </tr> </table> </td> </tr> <tr> <td> </td> </tr> <tr> <td><hr class="e"></td> </tr> <tr> <td><span class="title">General Inquiry</span> <span class="text1">(</span><span class="text4"><b> *</b></span><span class="text1"> compulsory fields) </span></td> </tr> <tr> <td> </td> </tr> <tr> <td><!-- script for the form validation start--> <script language="Javascript"> function validate(f) { var email = f.email.value; var r = new RegExp("^[\\w\\.\\-]+@\\w+[\\w\\.\\-]*?\\.\\w{1,4}$"); // do field validation if (f.name.value == "") { alert( "Please enter your Name." ); return false; } else if (f.email.value == "") { alert( "Please enter your Email Address." ); return false; } else if (f.message.value == "") { alert( "Please enter your Message." ); return false; } else form.submit(); } </script> <!-- script for the form validation end --> <? if ($_POST['Submit'] == ''){ ?> <!-- enquiry form code start --> <form method="post" action="" name="form1" onSubmit="return validate(this);"> <table width="630" border="0" align="center" cellpadding="0" cellspacing="3"> <tr> <td width="144" align="right" class="text3"><b>Salutation : </b></td> <td width="477"><select name="salutation" class="field1"> <option value="Mr.">Mr.</option> <option value="Ms.">Ms.</option> <option value="Mrs.">Mrs.</option> </select> </td> </tr> <tr> <td align="right" class="text3"><b><span class="text4">*</span>Name : </b><span class="text4"> </span></td> <td><input name="name" type="text" class="field1" size="40"> </td> </tr> <tr> <td align="right" class="text3"><b><span class="text4">*</span>Email Address : </b> <span class="text4"> </span></td> <td><input name="email" type="text" class="field1" size="40"> </td> </tr> <tr> <td align="right" class="text3"><b>Contact Number : </b></td> <td><input name="phone" type="text" class="field1" size="40"></td> </tr> <tr> <td align="right" class="text3"><b>Organization : </b></td> <td><input name="organization" type="text" class="field1" size="40"></td> </tr> <tr> <td align="right" class="text3"><b>Designation : </b></td> <td><input name="designation" type="text" class="field1" size="40"></td> </tr> <tr> <td align="right" valign="top" class="text3"><b><span class="text4">*</span>Message : </b><span class="text4"> </span></td> <td><textarea name="message" cols="45" rows="5" class="field2"></textarea> </td> </tr> <tr> <td> </td> <td><input name="Submit" type="submit" class="button1" value="Submit"></td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </form> <!-- enquiry form code end --> <? }else{ ?> <table width="100%" border="0" cellspacing="5" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td align="center"><font class="title" style="font-size:18px; line-height:22px">Thank you for your enquiry.<br> We will contact you shortly.</font></td> </tr> </table> <? } ?> </td> </tr> </table> </td> </tr> </table></td> </tr> <tr> <td><!-- footer table start --> <?php include('includes/footer.php'); ?> <!-- footer table end --> </td> </tr> </table></td> <td width="16" align="right" background="images/rightbg.gif"><img src="images/rightbg.gif" width="16" height="5"></td> </tr> </table> </body> </html> hope you could help me with this. thanks!
  15. thanks! i didnt thought of that. its working now.
  16. hi, i have a code here $employeeAges; $employeeAges["Lisa"] = "28"; $employeeAges["Jack"] = "16"; $employeeAges["Ryan"] = "35"; $employeeAges["Rachel"] = "46"; $employeeAges["Grace"] = "34"; foreach( $employeeAges as $key => $value){ echo "Name: $key, Age: $value <br />"; } is there a way where in my foreach function i can omit 1 value of $employeeAges? example in my echo output i just wanted to have this Name: Jack, Age: 16 Name: Ryan, Age: 35 Name: Rachel, Age: 46 Name: Grace, Age: 34 is this possible? if not hope you could help me find other methods. thanks!
  17. thanks! ill try that
  18. Hi, I will be creating a php script that will update our ms sql database from csv i havent tried this before, but will php be possible to update our ms sql database? my php will be in linux but my ms sql will be in windows plattform hope you could help me with this. thanks!
  19. Hi, sorry about that. its working now. i just needed to change the password to md5 // create random password $random_password=md5(uniqid(rand())); $new_password=substr($random_password, 0, ; $db_password = md5($new_password); $id = $rows['appid']; $sql="UPDATE applicant SET password ='$db_password' WHERE appid='$id'"; mysql_query($sql) or die("error:".mysql_error()); FYI for the others who needs this kind of function. thanks!
  20. hi, i found a better one, and the sending of new password is working. my problem now, its not updating the item in my table. hope you could help me with this. below is my current code for the password sending page <? include '../admean/db_connect.php'; // value sent from form $email_to=$_POST['email_to']; // table name $tbl_name=applicant; // retrieve password from table where e-mail = $email_to(mark@phpeasystep.com) $sql="SELECT appid FROM $tbl_name WHERE email='$email_to'"; $result=mysql_query($sql); // if found this e-mail address, row must be 1 row // keep value in variable name "$count" $count=mysql_num_rows($result); // compare if $count =1 row if($count==1){ $rows=mysql_fetch_array($result); // create random password $random_password=md5(uniqid(rand())); $new_password=substr($random_password, 0, ; $id = $rows['appid']; $sql="UPDATE applicant SET password ='$new_password' WHERE appid='$id'"; mysql_query($sql) or die("error:".mysql_error()); // ---------------- SEND MAIL FORM ---------------- // send e-mail to ... $to=$email_to; // Your subject $subject="JobHiRings: Your Acount Password Request"; // From $header="From: JobHiRings Administrator <administrator@jobhirings.com>"; // Your message $messages= "Your have requested for a new password \r\n"; $messages.="Your password is $new_password \r\n"; $messages.="You can now login to access your account using your email adress \r\n"; $messages.="and your new password. \r\n"; $messages.="Dont forgot to change your password for security reasons. \r\n"; $messages.="Thank You! \r\n"; // send email $sentmail = mail($to,$subject,$messages,$header); } // else if $count not equal 1 else { echo "Not found your email in our database"; } // if your email succesfully sent if($sentmail){ echo "Your Password Has Been Sent To Your Email Address."; } else { echo "Cannot send password to your e-mail address"; } ?> thanks!
  21. hi, i need help, i have a forgotpassword page and i am getting some errors which i can figure out how to solve. below is my current code <table width="778" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" background="images/headerbg.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="226" align="left"><img src="images/header.gif" width="226" height="148"></td> <td> </td> </tr> </table></td> <td background="images/headerbg.gif"><img src="images/headeright.gif" width="16" height="148"></td> </tr> <tr> <td width="16" rowspan="2" align="left" valign="top" background="images/left.gif"><img src="images/left.gif" width="16" height="14"></td> <td width="745" align="center" valign="top"><table width="739" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="739"> </td> </tr> <tr> <td align="center"><h1 class="text4">Forgot Password</h1> <span class="text8">A new password will be generated for you and send to the email address<br> associated with your account, all you have to do is enter your email address below.</span><br> <br> <?php session_start(); include 'db_connect.php'; $query="SELECT email, password FROM admin_user where email='$email'"; $result=mysql_query($query); while($rec=mysql_fetch_assoc($result)){ $mail=$_SESSION['email']=$rec['email']; } if(mysql_num_rows($result)==1){ $password2 = $password; $password1=md5($password); if($_GET['cmd']=="update"){ $query2="UPDATE admin_user set `password`='$password1' where `email` = '$email' "; $result=mysql_query($query2)or die(mysql_error()); $Message = ""; $Message .= "This is a password change request\n"; $Message .= "that you requested from JobHiRings\n"; $Message .= "\n\n"; $Message .= "please keep this new password in a safe place\n"; $Message .="Your new password is:" .$password2."\n"; $Message .= "\n\n"; $Header = "webadministrator@jobhirings.com"; $To = "$email"; $Subject = "Your New Password"; mail($To,$Subject,$Message,"From: $Header"); echo " <div align='center'><b class='text3'>Thank you password changed!<br> We have sent a copy to your email address!<div></b><br><br><a href='index.php' class='link2'>Please Login Now</a><br> </td> </tr><tr><td> </td></tr></table></td> <td width='16' rowspan='2' align='right' valign='top' background='images/right.gif'><img src='images/spacer.gif' width='1' height='1'><img src='images/right.gif' width='16' height='14'></td> </tr><tr><td valign='top'><img src='images/spacer.gif' width='746' height='10'></td> </tr><tr><td background='images/footerbg.gif'><img src='images/footerleft.gif' width='16' height='43'></td> <td background='images/footerbg.gif'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'> <tr><td height='10' colspan='2' align='left'><img src='images/spacer.gif' width='12' height='10'></td> </tr><tr><td width='746' align='center' valign='top' class='footer'>Copyright © 2007 www.website.com. All Rights Reserved</td> </tr></table></td><td background='images/footerbg.gif'><img src='images/footeright.gif' width='16' height='43'></td> </tr></table></body></html>"; exit; } if($_GET['cmd']=="pro"){ echo"<div><form action='forgotpass.php?cmd=update ' method='POST'> <b class='text3'>Please provide a new password</b><br><br> <input type='password' name='password' maxlength='30'> <br> <br> <input type='submit' value='New Password'> </form></td> </tr><tr><td> </td></tr></table></td> <td width='16' rowspan='2' align='right' valign='top' background='images/right.gif'><img src='images/spacer.gif' width='1' height='1'><img src='images/right.gif' width='16' height='14'></td> </tr><tr><td valign='top'><img src='images/spacer.gif' width='746' height='10'></td> </tr><tr><td background='images/footerbg.gif'><img src='images/footerleft.gif' width='16' height='43'></td> <td background='images/footerbg.gif'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'> <tr><td height='10' colspan='2' align='left'><img src='images/spacer.gif' width='12' height='10'></td> </tr><tr><td width='746' align='center' valign='top' class='footer'>Copyright © 2007 www.website.com. All Rights Reserved</td> </tr></table></td><td background='images/footerbg.gif'><img src='images/footeright.gif' width='16' height='43'></td> </tr></table></body></html>"; exit; } } ?> <form action="forgotpass.php?cmd=pro" method="POST"> <b class="text3">Email Address:</b> <input type="text" name="email" maxlength="30"> <input type="submit" value="Get New Password"> </form></td> </tr> <tr> <td> </td> </tr> </table></td> <td width="16" rowspan="2" align="right" valign="top" background="images/right.gif"><img src="images/spacer.gif" width="1" height="1"><img src="images/right.gif" width="16" height="14"></td> </tr> <tr> <td valign="top"><img src="images/spacer.gif" width="746" height="10"></td> </tr> <tr> <td background="images/footerbg.gif"><img src="images/footerleft.gif" width="16" height="43"></td> <td background="images/footerbg.gif"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="10" colspan="2" align="left"><img src="images/spacer.gif" width="12" height="10"></td> </tr> <tr> <td width="746" align="center" valign="top" class="footer">Copyright © 2007 www.website.com. All Rights Reserved</td> </tr> </table></td> <td background="images/footerbg.gif"><img src="images/footeright.gif" width="16" height="43"></td> </tr> </table> this is the error that i am getting Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/jobhi4/public_html/admean/forgotpass.php:6) in /home/jobhi4/public_html/admean/forgotpass.php on line 42 hope you could help me with this.
  22. but so far, how can i integrate it with smf? is it as easy as adding the index.php into the forum? or i still need some settings to do? thanks!
  23. Hi, anyone here have tried using x7chat? currently i am using smf forum in one of my sites also and i found in x7chat website that there chat software can be integrated in smf forum. i just wanted to know how. if ever you have other better chatsoftware that you can recommend, i will highly appreciate it. thanks!
  24. hi, i have a test page and you can access it here http://www.sinagtala.net/test.html i will be using this to input names and emails in my database which will be used for the newsletter sending. my problem now is, i dont know how to create the insert sql query for this function like how to do it in an array depending on how many items i will be adding. example, i input 10 items how will i code my sql insert query to automatically insert 10 items in my DB table below is my current code for the form <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function createForm(number) { data = ""; inter = "'"; if (number < 16 && number > -1) { for (i=1; i <= number; i++) { if (i < 10) spaces=" "; else spaces=" "; data = data + "Name " + i + " :" + spaces + "<input type='text' size=10 name=" + inter + "name" + i + inter + "'> " + "Email " + i + " :" + spaces + "<input type='text' size=10 name=" + inter + "email" + i + inter + "'><br>"; } if (document.layers) { document.layers.cust.document.write(data); document.layers.cust.document.close(); } else { if (document.all) { cust.innerHTML = data; } } } else { window.alert("Please select up to 15 entries."); } } // End --> </script> </head> <body> <center> <form name=counter> Number of items to enter: <input type=text name=number size=5> <input type=button value="Update" onClick="createForm(counter.number.value);"> </form> <br> <form name="webform"> <table border=0> <tr><td colspan=2> <!-- Placeholder for dynamic form contents --> <span id=cust style="position:relative;"></span> </td> </tr> <tr> <td></td> <td><input type=submit value="Send"></td> </tr> </table> </form> </center> <p><center> </center><p> </body> </html> hope you could help me with this. thanks!
  25. sorry my bad its working now, i just sent the if condition with isset thanks!
×
×
  • 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.