Jump to content

lugos

Members
  • Posts

    61
  • Joined

  • Last visited

Posts posted by lugos

  1. Hello,Is it possible to set the locale for the Javascript Date utility? We have offices in the far east, but we need to make sure that the date that is sent to our servers, which reside on the east coast of the U.S., is the date here in the U.S., not the date over there.Thanks in advance for the assistance.

  2. Hello,I would like to create a very small and simple PHP app to conduct an anonymous survey. The survey would be about 10 questions max, and there would be 4 or 5 possible answers for each. I would also like to store the results in a table. What would be the best way to set up the table? Should I have a row for each question and then 4 or 5 integer columns that are only updated if the user has selected that specific answer to that question? For instance if the user answers option 2 for question number one, then I would update row one, option_2_column_name. Any thoughts/ideas?Thanks in advance.lugos

  3. Ok, I ran your script and didnt get a Failed to send message, but I do see some things wrong that you dont need.Try to change the:$headers = "From: " . $_POST['emailAddress'] ."\n";To:$headers = "From: $_POST['emailAddress']";The varible will still be called with a $_POST that way to.ALso the echo() the () are not required seens it is not a function like if () so you can write it as:echo "<p>Message sent</p>";But the way you had it it still ran fine for me.
    I'm trying to run it locally using Apache on Win XP . Is there anything I have to do to the php.ini file? Do I have to set the SMTP server? I also read somewhere that PHP does not support SMTP authentication. Is that correct?Also, I am hosting my site using a Linux web server that I set up myself. The distribution of Linux is Ubuntu. It fails to send messages on the web server also.Thanks.
  4. Hello,I am fairly new to PHP development and I'm trying to send e-mails using the following code:<?php$to = "myemailaddress@myisp.com";$subject = $_POST['subject'];$body = $_POST['message'];$headers = "From: " . $_POST['emailAddress'] ."\n";if (mail($to,$subject,$body,$headers)) { echo("<p>Message sent</p>");} else { echo("<p>Failed to send message</p>");}?>For some reason it does not work. I keep getting the failure message. I have verified that all of the values are being passed.Any help would be greatly appreciated.Thanks in advance.

  5. hey lugos, long time no see, I take a look at your code :)do this
    <table><tr id="fundingAmount"><td style="padding-bottom: 0; width: 150px;"><div style="float: right; font-size: 12px; margin: 0; display: inline;">$</div><strong>Amount:</strong></td><td style="padding-bottom: 0; width: 150px;"><input type="text" name="amount" maxlength="20" /></td></tr></table>

    The element that is going to be floated should come first when mixed with non-floated elements.

    Simple enough. How easily I forget; I haven't been doing much HTML development lately and put my own website on hold during the school semester. I actually tried going to your website first and saw that it was under construction. I look forward to seeing it once it's done.Thanks for the help.
  6. Hello,Here is the code I am having trouble with:<table><tr id="fundingAmount"> <td style="padding-bottom: 0; width: 150px;"><strong>Amount:</strong><div style="float: right; font-size: 12px; margin: 0; display: inline;">$</div></td> <td style="padding-bottom: 0; width: 150px;"><input type="text" name="amount" maxlength="20" /></td></tr></table>I want the $ sign to be on the right side of the first column, on the same line. However, the code above puts it to the right and on the next line. I hope that's not confusing. If you copy and paste it, you'll see what I mean. I've tried a few things but nothing seems to work.Any help would be greatly appreciated.Thanks,lugos

  7. Hello,I'm relatively new to SQL and databases in general. I am not too familar with the terminology. I want to do a personal website where I can post messages and allow people to respond (similar to a blog). For the database structure/design, I was thinking of having one table for my original message, and in that table including an INT column that the database automatically increments every time a new row is created (it will be a unique field). The number generated by the database will then be used as a key/identifier in another table that contains the responses. That key/identifier will be used to link the responses to my original message. I hope that makes sense.So basically my question is if this sounds like it can work? Also, feedback and/or suggestions will be greatly appreciated. If there is a better way I would gladly consider it.Thanks,lugos

  8. Hello,I am going through the book Dreamweaver 8 with ASP, ColdFusion, and PHP Training from the Source, which by the way I think is an excellent book for beginners who want to learn dynamic web development using Dreamweaver. The book includes a tutorial which is almost like a case study, where each chapter builds upon the previous chapters. So I'm stuck at a point in the book where a certain SQL statement is producing an error. However, I'm not sure if it's the SQL code, the PHP code, or possibly even Dreamweaver that's causing the error. So, if it is not a problem, I will post this question in the SQL forum also.Here is the SQL code:

    SELECT * FROM tbl_tours INNER JOIN tbl_countryON tbl_country.countryID=tbl_tours.countryORDER BY tbl_country.countryName

    Now, the book says that the following SQL code is the same as the above:

    SELECT * FROM tbl_tours, tbl_countryWHERE tbl_country.countryID=tbl_tours.countryORDER BY tbl_country.countryName

    But neither of them work. The PHP code is as follows:

    <?php require_once('Connections/conn_newland.php'); ?><?phpmysql_select_db($database_conn_newland, $conn_newland);$query_rs_tourDetail = "SELECT * FROM tbl_tours INNER JOIN tbl_country ON tbl_country.countryID=tbl_tours.country ORDER BY tbl_country.countryName";$rs_tourDetail = mysql_query($query_rs_tourDetail, $conn_newland) or die(mysql_error());$row_rs_tourDetail = mysql_fetch_assoc($rs_tourDetail);$totalRows_rs_tourDetail = mysql_num_rows($rs_tourDetail);?>

    This PHP code is generated by Dreamweaver. I am very new to the PHP programming language.Any help would be greatly appreciated.Thanks,lugos

  9. Hello,I am going through the book Dreamweaver 8 with ASP, ColdFusion, and PHP Training from the Source, which by the way I think is an excellent book for beginners who want to learn dynamic web development using Dreamweaver. The book includes a tutorial which is almost like a case study, where each chapter builds upon the previous chapters. So I'm stuck at a point in the book where a certain SQL statement is producing an error. However, I'm not sure if it's the SQL code, the PHP code, or possibly even Dreamweaver that's causing the error. So, if it is not a problem, I will post this question in the PHP forum also.Here is the SQL code:

    SELECT * FROM tbl_tours INNER JOIN tbl_countryON tbl_country.countryID=tbl_tours.countryORDER BY tbl_country.countryName

    Now, the book says that the following SQL code is the same as the above:

    SELECT * FROM tbl_tours, tbl_countryWHERE tbl_country.countryID=tbl_tours.countryORDER BY tbl_country.countryName

    But neither of them work. The PHP code is as follows:

    <?php require_once('Connections/conn_newland.php'); ?><?phpmysql_select_db($database_conn_newland, $conn_newland);$query_rs_tourDetail = "SELECT * FROM tbl_tours INNER JOIN tbl_country ON tbl_country.countryID=tbl_tours.country ORDER BY tbl_country.countryName";$rs_tourDetail = mysql_query($query_rs_tourDetail, $conn_newland) or die(mysql_error());$row_rs_tourDetail = mysql_fetch_assoc($rs_tourDetail);$totalRows_rs_tourDetail = mysql_num_rows($rs_tourDetail);?>

    This PHP code is generated by Dreamweaver. I am very new to the PHP programming language.Any help would be greatly appreciated.Thanks,lugos

  10. nvm, i figured it out -- thanks to w3school!!!!its form action=MAILTO yourname@domain.com !!thanks

    yeah, it works but it's not the best solution. using that opens the user's default e-mail application (e.g. microsoft outlook). it's better to use a script that mails the comment to your e-mail address. for instance, you can write code in comment.php to receive the comment and then e-mail it to you.
  11. The next question is touching CSS.I was wondering how do I make a sidebar/menu that appears on every page with links on it to other pages?The navigation bar is the proper term I think, and it's on practically every site....so I want it on mine lol.
    <?xml version="1.0" encoding="ISO-8859-1" ?><!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><style type="text/css">ul{float:left;width:100%;padding:0;margin:0;list-style-type:none;}a{float:left;width:6em;text-decoration:none;color:white;background-color:purple;padding:0 0 0 .6em;border-right:1px solid white;}a:hover {background-color:#ff3300}li {display:list-item;margin-bottom: 2px;}</style></head><body><ul><li><a href="#">Link one</a></li><li><a href="#">Link two</a></li><li><a href="#">Link three</a></li><li><a href="#">Link four</a></li></ul><p>In the example above, we let the ul element and the a element float to the left.The li elements will be displayed as inline elements (no line break before or after the element). This forces the list to be on one line.The ul element has a width of 100% and each hyperlink in the list has a width of 6em (6 times the size of the current font).We add some colors and borders to make it more fancy.</p></body></html>

    This was taken directly from the w3schools.com site with minor alterations. I changed it from a horizontal menu to a vertical. Click here for the original code.

  12. Im using xhtml on my curren tsite and i am interested in adding some java to it. is there a non depracated tag that can do this?

    Do you mean JavaScript, or Java as in Sun's Java programming language? If you are referring to the latter, you will need to make sure that your web hosting company (or your own server) supports Java Server Pages (JSPs). Then you rename your pages to be of type jsp (ie index.jsp). Then you enclose your Java code in <% %> tags.lugos
  13. I don't understant what you just said and I tried to put padding in but it didn't work. how in HTML terms to I add another column. One to go on the left (the contents), one to go to the right (pictures) and one (text)to go in the middle?is there a more simpler way to do it?

    Here is aspnetguy's code slightly modified to get the left, center, and right divs that you are looking for. You can change the width, add background color, add padding, add margins, etc. in the styles. If you're not too sure how to do it, the tutorials at w3schools.com are good for learning (google is also an excellent resource). Also, play around with margins and padding to get the look you desire.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>Your Title Here</title><style type="text/css">#wrapper{width: 780px;margin: auto; /*centers site...remove if you do not want it centered*/}.paneLeft{width: 140px;float: left;}.paneCenter{width: 500px;float: left;}.paneRight{width: 140px;float: left;}.clearer{clear: left; /*needed for FireFox so both columns will stay in the wrapper*/}</style></head><body><div id="wrapper"><div class="paneLeft">...place menu here...</div><div class="paneCenter">...place content here...</div><div class="paneRight">...place pictures here...</div><br class="clearer"/></div></body></html>

    aspnetguy has got mad skillz! That layout code is simple yet bangin!lugos

  14. Hi Newbman,I have just tried to validate www.toplanaholiday.com and have got a lot of errors. The errors are mainly the stuff I copied from the Net. The validator complaint about this line:<meta name="description" content="my contents" /> until I changed it to <meta name="description" content="my content"> but most websites have it the incorrect way !!The DOCTYPE is "HTML 4.01 Transitional", should I be using anything else ? I am quite confused about what it all means and how important that isSome lines flagged as error are inserted by the server (SSI include). How should one get rid of this types of errors ?

    The reason why you're meta tag generated an error is because you are using DOCTYPE HTML 4.01 Transitional. You probably want to be using <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> instead.
  15. Ditto Skemcin. Whenever you notice a difference between how IE renders your page and how Firefox renders your page, more likely than not IE is the browser that is cutting you some slack. I personally use Firefox as the standard, although I also make sure my pages look fine in IE since it is the browser that is used by most people.As sbrownii pointed out, it's best to use css. The border around your vertical navigation bar on the left is defined in the style attribute in the div tag, and both IE and Firefox display it fine. You can do the same for your table borders. Try using the style attribute in your table and td tags.

  16. Hello,I'm having a problem with layout in IE. If you look at the website here, you'll see that at the bottom of the page I have four images going across the bottom of the webpage. In IE, the last image is placed on a newline, but firefox and safari display it as it should be displayed (why does IE have to be so difficult!). Does anyone know why that could be? Any help would be greatly appreciated.Here is are the styles:

    body {	border-collapse: collapse;	font-family: verdana, arial, sans-serif;	font-size: 11px;	font-variant: small-caps;}img {	border: 0;	margin: 0;}#container {	width: 100%;	height: 700px;	text-align: center;}#centered {	width: 700px;	text-align: left;	margin: 10px auto 0 auto;}.banner {	height: 140px;	background-color: black;	margin: 0;}.navigation {	height: 20px;	width: 500px;	margin: 0;	background-color: green;	float: left;}.pageBody {	height: 360px;	width: 500px;	margin: 0;	background-color: white;	float: left;}.newsDevDiv {	width: 200px;	height: 380px;	margin: 0;	background-color: yellow;	float: right;}.footer {	width: 700px;	height: 125px;	margin: 0;	padding: 0;	background-color: black;	border-top: 1px solid white;	float: right;	text-align: center;}.footer p {	width: 100%;	margin: 0;	border-bottom: 1px solid red;}.footer img {	vertical-align: middle;}.footer a {	margin: 0;}.newsDiv {	width: 95%;	background-color: white;	margin: 1% auto 0 auto;	height: 175px;	overflow: auto;}.devDiv {	width: 95%;	background-color: white;	margin: 1% auto 0 auto;	height: 175px;	overflow: auto;}.divTitle {	margin: 0;	padding: 5px 0 5px 0;	width: 100%;	text-align: center;	vertical-align: middle;	background-color: rgb(81, 139, 168);	color: white;}/* Navigation */.navContainer {	width: 480px;	margin: 0 auto 0 auto;	background-color: transparent;	padding: 0;}.menulist li {	float: left;	position: relative;	width: 120px;	height: 18px;	font-size: 11px;	background-color: transparent;}.menulist {	margin: 0;	padding: 0;	list-style: none;}.menulist ul {	border-collapse: collapse;	display: none;	position: absolute;	top: 18px;	left: 0px;	width: 150px;	background-color: rgb(33, 69, 99);	padding: 0;	list-style: none;	margin: 0;	z-index: 1;}.menulist ul li {	float: none;	margin-right: 0;	position: relative;	text-align: left;}.menulist a {	display: block;	padding: 2px 0 2px 0;	background-color: rgb(33, 69, 99);	width: 118px;	color: white;	text-align: center;	text-decoration: none;	font-variant: small-caps;}a.submenuLink {	text-decoration: none;	background-color: transparent;	width: 142px;	padding: 0;	border: 1px solid rgb(81, 139, 168);	color: white;	font-variant: small-caps;	margin: 2px 2px 2px 2px;	padding-left: 2px;	text-align: left;}a.submenuLink:hover {	background-color: rgb(81, 139, 168);}

    Thanks,lugos

  17. Hello,I am trying to layout my webpage using divs instead of tables. The way I have it layed out now displays just like I want it to in Firefox, but does not display the same in IE. The only way I can get the boxes to display in their proper positions for IE is to shorten the width of either the pageBody or the newsDev div, or increasing the width of the centered div. But then that creates some space between the pageBody div and the newsDev div, which is not what I want. Am I missing a position or clear property? I've pasted my html and css code. Any help getting it to display in IE correctly would be greatly appreciated.html:

    <!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" xml:lang="en" lang="en"><head><title></title><link rel="stylesheet" href="div_layout_styles.css" type="text/css" /><script type="text/javascript"><!-- HIDE FROM INCOMPATIBLE BROWSERS// STOP HIDING FROM INCOMPATIBLE BROWSERS --></script><style type="text/css"></style></head><body><div id="container">  <div id="centered">    <div class="banner">         </div>    <div class="newsDev">         </div>    <div class="navigation">	     </div>    <div class="pageBody">         </div>    <div class="footer">         </div>  </div></div></body></html>

    css:

    body {	border-collapse: collapse;	font-family: verdana, arial, sans-serif;	font-size: 11px;	font-variant: small-caps;}#container {	width: 100%;	height: 700px;	text-align: center;}#centered {	width: 700px;	text-align: left;	margin: 10px auto 0 auto;}.banner {	height: 140px;	background-color: red;	margin: 0;}.navigation {	height: 20px;	width: 500px;	margin: 0;	background-color: green;}.pageBody {	height: 360px;	width: 500px;	margin: 0;	background-color: blue;}.newsDev {	width: 200px;	height: 380px;	margin: 0;	background-color: yellow;	float: right;}.footer {	width: 700px;	height: 125px;	margin: 0;	background-color: black;	border-top: 1px solid white;}

    Thanks,lugos

  18. It appears that you have a forward slash inside the closing div tag that should not go there. That could be the problem. The closing parenthesis is also missing. Unless I don't see it because the screen shot didn't pick it up.Also, just as a suggestion, use double quotes to enclose what you want to print out when using document.write(), and use single quotes to assign values to your attributes. For instance:document.write("<div id='fixedtipdiv' style='visibility:hidden;width:" + tipwidth + ";background-color:" + tipbgcolor + "'></div>");Hope this helps.lugos

  19. Well, i am trying to make a form and when u submit it, it saves to a txt file that i can view later. Can someone help me with this?

    You'll probably need server-side scripting to accomplish that. Something like PHP, ASP, Pearl, etc. You can also e-mail yourself the text, which will also require server-side scripting.
  20. i create one text field with name.id,value also get in PHP variables in databasehow can i check the validation of that text field in javascript <input type="text" name=" <? $row[0] ?>" id ="<? row[0]" />in js functiondocument.form.<? $row[0] ?> .value is working or nothow i can get value

    Hello,The Form object has an elements[] array that contains Input objects. So, I guess if you know the number of the element you want to access, you can try using something like
    document.forms[1].elements[2].value = 'value'

    If not, looping through the elements will probably be your best bet; as hacknsack suggested.lugos

×
×
  • Create New...