Jump to content

hoachen

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by hoachen

  1. my problem is i only have one textfield how can i use $_post['state']? for second field.
  2. I am doing a dataabse search on my website, but it seems like the code that i have is not practical. Would someone give me some advice. My goal is when the user type in anything(at least two alpha because they search my state like "MO") and search on the database for every columns that match what ever they want to search especially the city and state the user put in. My question is how to the query know which column to look for if they type in city or state? Are they anyway to do this? <form action="result.php" method="post"> Enter Search:<br> <input name="city" type=text> <br> <input type=submit value="Search"> </form><? $city =$_POST['city'];echo 'this is city'.$city."<br />"; $query="select * from tblinfo where city like \"city\" OR state LIKE \"city\" OR Comments LIKE \"city\" "; $result = mysql_query($query);echo $query."<br /><br />";while ($row = mysql_fetch_assoc($result)) { echo "<b>"."City: "."</b>".stripslashes($row["city"]); echo " "; echo "<b>"."State: "."</b>". stripslashes($row["state"]); echo "<br />"; echo "<b>"."Complaints: "."</b>". "<i>". stripslashes($row["complaints"])."</i>"; echo "<br /><br /><br />"; }?>
  3. Hi guys is me again. This time i really can't figure out how to display the article in details according to the 'id' assigned on database. I have a page that will display all the results with the status of 'approval' and this page only display partial details for each article (this page is working fine). If the user would like to read more about this article they will click on "View More" link and open a new windows that will display the detail according to which article they click on. Right now, on the browser, the id is correctly diplay but it display all the articles include not the id that they select.What wrong on the below code? Your advise is appreciate.$objData = new PReport($db);$id = $_GET['id'];$sWhere = "WHERE id = '$id'";$objDataload(false, false, $sWhere);<?php while ($res = $objData->fetch()) { $app=$res->getStatus(); if($app =='pending' || $app=='cancelled') { echo ''; } else { ?> <tr> <td class="txtRegular" style="border-bottom:#999999 solid 1px"><?php echo " ". $res->getID(); ?></td> <td height="36" class="txtRegular" style="border-bottom:#999999 solid 1px"><?php echo " ". $res->getDate(); ?></td> <td style="border-bottom:#999999 solid 1px" class="txtRegular"><?php echo " ". $res->getCity();?></td> <td style="border-bottom:#999999 solid 1px" class="txtRegular"><?php echo " ". $res->getState();?></td> <td style="border-bottom:#999999 solid 1px" class="txtRegular"><?php echo " ". $res->getDetails();?> </td></tr> <?php } } ?>
  4. i got it!... thanks guys
  5. Hello, guys. I have trouble to find any example that used class to display limited character. They wayI would like to do is the article will pull from database and will show only 50 character and the rest will display on new page when they click on "View More". How can i make this work using class object?Here is what use on my codewhile ($res = $objIData->fetch()) { $app=$res->getStatus(); if($app =='pending' || $app=='cancelled') { echo ''; } else { ?> <tr><td> <?php echo $res->getData();?> <?php echo $res->getDate();?> <?php echo $res->getState(); ?> </td></tr>
  6. Hello, guys. I have trouble to find any example that used class to display limited character. They wayI would like to do is the article will pull from database and will show only 50 character and the rest will display on new page when they click on "View More". Here is what use on my codewhile ($res = $objIData->fetch()) { $app=$res->getStatus(); if($app =='pending' || $app=='cancelled') { echo ''; } else { ?> <?php echo " ". $res->getData();?>
  7. hoachen

    fetch array

    I see, thanks for you sharpe spot. I got it works now. THanks
  8. hoachen

    fetch array

    Hi guys, I need some help with you. I try to echo the data from the database but i have to check one specific column(status). If that column contain 'pending' or 'cancelled' then this rows will not be echo else echo all the data. Here is what i have try but it echo everything outwhile ($mod = $objIncident->fetch()) { $showstat = $data->getStatus(); if ($showstat != "pending" || $showstat != "cancelled" ) { echo $data->getName(); echo $data->getCity(); echo $data->getComplaints(); } else { echo ''; }
  9. hoachen

    time converstion

    I just can't get this to work!!! Please somebody help!I want to get this time convert them from 7:30 pm to 19:30:00 or 7:30 am to 07:30:00 This time is manually type in because it is a time for appointment schedule so i can't use now() $startdt = $_POST['StartDate']." ".$_POST['StartTime']. " " . $_POST['sampm'];
  10. i am working on css background and come across the screen resolution problem. RIght now my css background image have a fix width and height so if 15" screen the background image will display fit into the screen but when a 18"screen monitor, it will have lot of margin at left and right. My question is how can i make it fit into any screen that will depends on the user monitor screen?Please advice and will appreciate your time and precious advice.Cheers,hoachen
  11. Thanks you for you solution, but it does not look good though, the bottom image like stretch. Any other solutions?
  12. Please see the below url of what i post earlier.The background image of the contents is not all the way down to the bottom of the article. The background image is fix 800px X 600px if the contents more than 600px height it will be look like what i have which i don;'t want to be. I want the background is same height with the article.http://www.hoachen.com.websitetestlink.com/test.html
  13. thank you for your advise.The background-position will do the position but not fix the problem i have.
  14. Thank you very much for trying to help me to solve my problem.I tried and it works for the body.But, I have a grey color for my body so it does not work on the belowbody { background-image: url('images/index_17.jpg'); background-repeat: no-repeat; background-attachment: fixed;}I tried to put this gradient background inside the wrapper and it does not work even though i put the background-attachment:fixed. It will scoll the whole page.do you have any suggestion?
  15. I am stuck on working replace a string text. I want to find all the files that contain extension of jpg and jpeg and then replace them without the extension but the filename will remain and echo out the filename without extension.I tried the below but not working!! Please help me to resolve this.$str = /.*\(.gif|jpg|jpeg) //find all the files that have the jpg, jpeg, gif extension on a "image" folder$text = preg_replace(/.$,$str)print_r($text);?>cheerhoachen
  16. I have problem for the height of the background image. I have a 800px X 350px gradient background image, I used css to make the image as a background so i can create text above the background layer. when my text area (inside the table with the background color) is longer then 350px, the gradiented image will only shows of the height of the image. The background image should be same height of the text (table height). THe webpage i create not every page are the same height. If I make it heigth to 800px X 1000px this will make the shorter page background look weired and no gradient background for the shorter page. This make it not nice if i repeat the background. And also, why my css background-image is not work on firefox? My question is how can i to accomplish these two? any advise will be very appreciate.Here is the link to view what i am talking about of my problem.http://www.hoachen.com.websitetestlink.com/<head><style type="text/css">div#img {background-image:url(file:///C|/Documents and Settings/siew/Desktop/test/bg.jpg); background-repeat:no-repeat;width:800px;height:350px;}</style></head><body><div id="img"> <table width="600" bgcolor="#00FF00" align="center"> <tr> <td width="637">Scientists Study Robot-Human Interactions <p>HATFIELD, England, Aug. 30 (UPI) -- British scientists are studying how people interact with robots to determine what future machines should look like and how they should behave.</p> blah blah blah </td> </tr></table></div>
  17. New to php/mysql and hope someone will give me some opinion!I am trying to write a simple query using php/mysql. I am trying to select all the data from the database and echo them out so i can see the result.I know when use the mysql->Select * from tablename then we can see all the result on the table, but now, i am need to list all the field on my database to see the a row result like doing $rs['id'],.$rs['fname'],..... HOw can I not list all the fields to get the entire row data from the database? Please below code.$query = 'SELECT * FROM mailing_user';$result = mysql_query($query) or die('Query failed: ' . mysql_error());while($rs=mysql_fetch_array($result)){echo $rs['id'].$rs['fname'].$rs['lname']".<br/>";}
  18. Well, your code is fine and working!Thank you very much for your kindness to share!cheers!hoachenThis will do what you want it to (I didn't test it, but it should work )... You will need to modify it if you want to add error checking if you want to... I'm working on that part myself right now... <?php $name = $_POST['name']; $phone = $_POST['phone']; $email = $_POST['email']; $to = "youremailaddress@yourserver.com"; $subject = "SUBJECT TO YOURSELF HERE"; $subjecttousr = "SUBJECT TO THE USER HERE"; $message = "<b>Name:</b> " . $name . "<br /><br />"; $message .="<b>Phone Number:</b> " . $phonenumber . " <br /><br />"; $message .="<b>Email Address:</b> " . $email . " <br /><br />"; $messagetousr = "Thank you for filling out the form"; $headers="MIME-Version: 1.0\r\n"; $headers.="Content-type: text/html;"; $headers.=" Charset=iso-8859-1 \r\n"; $headers.="From: $email \r\n"; mail ($to, $subject, $message, $headers); mail ($email, $subjecttousr, $messagetousr, $headers);?> <{POST_SNAPBACK}>
  19. I am looking for php tutorials for confirmation email. I want to create a very simple form that contains name: email: phone: When the user click on submit. This user name, email address, phone number will email to my account and at the sametimes, a confirmation email will send to the email address that they fill out. on this confirmation email will "say thank you for filling out the form"I been looking for quite a while but no luck at all. I hope someone done this before and point me to the right place to learn this.thank you very much to whoever try to help.kenny
  20. i did tried but doesn't work either.
  21. I have a very simple text form to test the text formatting. But, when i get on the email all the html tag is show instead of format them. Like below the <b>testing </b>. I will show the exactly on my email does not format as bold. also the line break <br /> it does the same as the <b></b>. I done this before on different server it works but on this new server. ANyone know what i am missing? Please help me to understand this.<?php$message .= "<b> testing </b>";$message .= "First Name: " . $_POST['name'] . "<br />";$message .= "<b>Email: </b>" . $_POST['email'];echo "thank you for....";mail('hoachen@hotmail.com,$subject,$message);?>
  22. I have trouble align the text with the submenu text beneath it. I followed the example at www.w3schools.com/dhtml/ tryit.asp?filename=trydhtml_menu10. but my is not align beneath the submenu it slightly toward to the right site. If i put in the left: some pixel tag. Then, at different brower will have different position. I want the submenu position will be exact where it is even the user have different screen resolution. The example at above link did that but when add-in the tage: left:300px then the position will change when have different browser. Please give some advice for this. I really need to get this work!Thanks and thank you for reading this question.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><script language="javascript">function showmenu(elmnt){document.getElementById(elmnt).style.visibility="visible"}function hidemenu(elmnt){document.getElementById(elmnt).style.visibility="hidden"}</script><style>table{font-size:80%;background:black}a{color:black;text-decoration:none;font:bold}a:hover{color:#00FF00}td.menu{background:lightblue}table.menu{ font-size:110%; position:absolute; visibility:hidden; text-align:left; display: block; font-family: Arial, Helvetica, sans-serif; text-decoration: none; font: 12px; background-color: #FFFFFF; left: auto; }</style></head><body><table width="914" border="0" align="center" cellpadding="0" cellspacing="0" class="bg"> <!--DWLayoutTable--> <tr> <td width="331" rowspan="2" scope="col"><img src="../images/topbar_name.jpg" width="331" height="135"></td> <td height="46" scope="col"> <table width="100%"border="0" cellpadding="0" cellspacing="0" height="46" align="right"> <tr bgcolor="#FFFFFF" align="center"> <td width="14%" class="nav" onmouseover="showmenu('home')" onmouseout="hidemenu('home')"><a href="/default.asp">HOME</a><br /> <table class="menu" id="home" width="120"> <tr><td class="menu"><a href="/html/default.asp">HTML</a></td></tr> <tr><td class="menu"><a href="/xhtml/default.asp">XHTML</a></td></tr> <tr><td class="menu"><a href="/css/default.asp">CSS</a></td></tr> <tr><td class="menu"><a href="/xml/default.asp">XML</a></td></tr> <tr><td class="menu"><a href="/xsl/default.asp">XSL</a></td></tr> </table> </td> <td width="1%"><img src="images/nav_border.jpg"></td> <td width="14%" class="nav" onmouseover="showmenu('company')" onmouseout="hidemenu('company')"><a href="/default.asp">OUR COMPANY</a><br /> <table class="menu" id="company" width="120"> <tr><td class="menu"><a href="/html/default.asp">HTML</a></td></tr> <tr><td class="menu"><a href="/xhtml/default.asp">XHTML</a></td></tr> <tr><td class="menu"><a href="/css/default.asp">CSS</a></td></tr> <tr><td class="menu"><a href="/xml/default.asp">XML</a></td></tr> <tr><td class="menu"><a href="/xsl/default.asp">XSL</a></td></tr> </table> </td> <td width="1%"><img src="images/nav_border.jpg"></td> <td width="14%" class="nav" onmouseover="showmenu('investor')" onmouseout="hidemenu('investor')"><a href="/default.asp">INVESTOR</a><br /> <table class="menu" id="investor" width="120"> <tr><td class="menu"><a href="/html/default.asp">HTML</a></td></tr> <tr><td class="menu"><a href="/xhtml/default.asp">XHTML</a></td></tr> <tr><td class="menu"><a href="/css/default.asp">CSS</a></td></tr> <tr><td class="menu"><a href="/xml/default.asp">XML</a></td></tr> <tr><td class="menu"><a href="/xsl/default.asp">XSL</a></td></tr> </table> </td> <td width="1%"><img src="images/nav_border.jpg"></td> <td width="14%" class="nav" onmouseover="showmenu('newsroom')" onmouseout="hidemenu('newsroom')"><a href="/default.asp">NEwsroom</a><br /> <table class="menu" id="newsroom" width="120"> <tr><td class="menu"><a href="/html/default.asp">HTML</a></td></tr> <tr><td class="menu"><a href="/xhtml/default.asp">XHTML</a></td></tr> <tr><td class="menu"><a href="/css/default.asp">CSS</a></td></tr> <tr><td class="menu"><a href="/xml/default.asp">XML</a></td></tr> <tr><td class="menu"><a href="/xsl/default.asp">XSL</a></td></tr> </table> </td> <td width="1%"><img src="images/nav_border.jpg"></td> <td width="14%" class="nav" onmouseover="showmenu('property')" onmouseout="hidemenu('property')"><a href="/default.asp">Property</a><br /> <table class="menu" id="property" width="120"> <tr><td class="menu"><a href="/html/default.asp">HTML</a></td></tr> <tr><td class="menu"><a href="/xhtml/default.asp">XHTML</a></td></tr> <tr><td class="menu"><a href="/css/default.asp">CSS</a></td></tr> <tr><td class="menu"><a href="/xml/default.asp">XML</a></td></tr> <tr><td class="menu"><a href="/xsl/default.asp">XSL</a></td></tr> </table> </td> <td width="1%"><img src="images/nav_border.jpg"></td> <td width="14%" class="nav">CONTACT US</td> </tr> </table></td> </tr> <tr> <td height="89" valign="top"><img src="images/topbar_email.jpg" width="583" height="89"></td> </tr> <tr> <td height="19" colspan="2" scope="col">contents</td> </tr> <tr> <td height="19" colspan="2" scope="col"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td scope="col"><img src="../images/bottom.jpg"></td> </tr></table></td> </tr></table></body></html>
  23. But, I don't want the big image show without clicking the small image.
  24. I want to create a two columns table for my webpage.The first column will be contain small image and the second column will be same image as the fisrt one but will become bigger when the user click on the column 1 (small image) Have anybody did this before? Can anyone give me some advice or example? I really help with this. Thanks and cheers,hoachen
  25. hoachen

    show/hide

    I am trying to have my page that can have a list of menu, for exampleBreakfast, Lunch, Dinner. I couldn't find the similiar solution for this. IF anybody willing to help, I would be very very appreciate.when the user click on breakfast menu, the menu will show beneath the breakfast, see below exampleBREAKFAST . Three Eggs Omelet . Corned Beef Hash & Eggs . Eggs Benedict . Fresh Fruit & BerriesLUNCHDINNERwhen the user click again on Breakfast it will hide the menu. if the user does not click on the breakfast, it will show until the user click on it.
×
×
  • Create New...