Jump to content

Don E

Members
  • Posts

    996
  • Joined

  • Last visited

Everything posted by Don E

  1. Don E

    Echo?

    If you search I'm sure you can find some decent translators.
  2. See this link and see if it's possible for you, or would try doing: http://w3schools.invisionzone.com/index.php?showtopic=43105&view=findpost&p=237745
  3. Don E

    Echo?

    Hey Eduard,Since your native language is Dutch, have you ever thought about taking what people say here in English and using a translator to translate everything for you in Dutch? Maybe by doing that, you can understand better in your native language what people are trying to teach you in English. Here is a good site to translate from English to Dutch: http://translation.babylon.com/english/to-dutch/The above translated to Dutch for example:Hoi Eduard, aangezien uw moedertaal is Nederlands, heb je ooit al eens nagedacht over wat de mensen zeggen hier in het Engels en met behulp van een vertaler te vertalen alles voor u in het Nederlands? Misschien door dat te doen, kunt u beter inzicht in uw eigen taal wat men wil leren je in het Engels. Hier is een goede site te vertalen van Engels naar Nederlands: http://translation.babylon.com/english/to-dutch/Just a suggestion!
  4. Don E

    Echo?

    http://www.php.net/m...nction.echo.php It prints to the page whatever you want it to: Example:echo "Hello Eduard, how's Argentina been so far for you? I heard it's really nice there!"; The above prints/outputs to the page: Hello Eduard, how's Argentina been so far for you? I heard it's really nice there! $num = 5; echo $num; //this prints 5 echo "I have $num fingers in one hand."; // prints I have 5 fingers in one hand. This works because of using double quotes. If you would of used single quotes instead, it would of printed: I have $num fingers in one hand. If you're going to use single quotes, suggest like this then: echo 'I have ' . $num . ' fingers in one hand.'; // prints I have 5 fingers in one hand. The period(.) is the concatenation operator. I'm sure you get the idea.
  5. Don E

    Next step?

    Eduard, is that all on one page? Or is html page itself and the insert.php itself? If they are on the same page, try making them separate. Make sure the html page and insert.php file is in the same directory(folder) and then see if you still get the undefined index errors.
  6. Don E

    Next step?

    Also... <form action="insert.php" method="POST"><label for="s_name">Site Name:</label><input type="text" id="s_name" name="Site_Name"/><label for="s_url">Site URL:</label><input type="text" id="s_url" name="Site_URL"/><label for="description">Description:</label><input type="text" id="description" name="description"/><input type="submit" value="Add Link"/></form>doesn't match with... $s_name = $_POST['s_name'];$s_url = $_POST['s_url']; .. why it says undefined index. I am not sure why you got 'description' too since it matches with the name attribute as I just tested the above exactly as you have it and I only got undefined index for the above. (That's if the error is referring to this line: $description = $_POST['description']; line 5)
  7. It may be because of here: $email = $_REQUEST['email'] ; $eventname = $_REQUEST['eventname'] ; $startdate = $_REQUEST['startdate'] ; $enddate = $_REQUEST['enddate'] ; $location = $_REQUEST['location'] ; $details = $_REQUEST['details'] ; mail("someone@example.com", "Event Name: $eventname", $details, "From: $email" ); echo "Thank you for submitting your event"; Try changing $_REQUEST to $_POST for the above since the form above is using method="post". $_REQUEST usually contains the contents of $_GET, $_POST and $_COOKIE in one global array($_REQUEST). Usually $_POST helps narrowing it down.Make sure 'someone@example.com' is an actual working email address. Are you using WAMP or XAMP or are you doing this from the Social program? I suggest you get yourself a nice editing program like Notepad++, or netbeans, etc(both free, when you're on a faster connection). Dreamweaver is nice if you have that kind of money but I highly suggest only working in the 'code view' side(there's a trial version). When debugging, what scientist meant by testing part of your code, you test a single part of your code making sure everything works for that specific part, then move on to the next part, etc.. This is referred to 'unit testing'.
  8. Problem same as before when hitting the submit button nothing happens or ?
  9. Don E

    Next step?

    Eduard, I showed you that example to get an idea as to how to insert data in your database table first, then once you understand that, you can take the 'comments' from the database and display them on your site thus 'showing how a database works using mysql queries'. (I think this is what you mean by that)
  10. Give the submit button a name: <input type='submit' name="submit" /> Then here, for the if (isset($_REQUEST['email'])) , you can do this: if (isset($_POST['submit'])) If you want to make it 'easier', instead of the way you have the form being echoed, you can do this: else { //if "email" is not filled out, display the form?> <form method="post" action="mailform.php"> Email: <input name="email" type="text" /><br /> Event Name: <input name="eventname" type="text" /><br /> Start Date: <input name="startdate" type="text" /><br /> End Date: <input name="enddate" type="text" /><br /> Location: <input name="location" type="text" /><br /> Details:<br /> <textarea name="details" rows="15" cols="40"> </textarea><br /> <input type="submit" name="submit" /> </form><?php}?>
  11. Speaking of Flash, sorry if this off topic but I read somewhere that maybe one day it will be obsolete? With the advancement of CSS, JavaScript, JS libraries, etc. I also heard that the only real reason why it's still 'popular' is because of its video playing capabilities. Some big name sites/companies won't even mention flash on their services/products like Apple for instance.
  12. Don E

    Next step?

    In your portfolio page, you create the form as follows: (This is just a example because I don't know you want as input fields.) Lets say you want people to comment on your website or comment on anything regarding you and your work.. the form can look like this: HTML page: <form method="post" action="comment.php" ><label for="fName">First Name:</label><input type="text" id="fName" name="firstName" /><br/><label for="lName">Last Name:</label><input type="text" id="lName" name="lastName" /><br/><label for="comment">Comment:</label><textarea id="comment" name="comments"></textarea><br/><input type="submit" value="Submit Comments" /></form> comment.php can look something like this: <?php$firstName = $_POST['firstName'];$lastName = $_POST['lastName'];$comments = $_POST['comments']; $con = mysql_connect("your host here","your username here","your pass here"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $sql = "INSERT INTO comments (FirstName, LastName, Comments) VALUES ('$firstName','$lastName','$comments')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }mysql_close($con);?> Make sure in your database(in the example above, its called 'my_db') that you make a table called comments with columns: FirstName, LastName, Comments. Then once people fill in the form and comment, you can use phpmyadmin to view what people are commenting.
  13. Don E

    Next step?

    Correct me if I'm wrong, but 'index' means index in an array. Since $_POST, $_GET are basically global arrays in PHP, and arrays consist of 'indexes' or 'keys' or 'elements' but I believe the most common term for it is 'index'.A typical array may look like this: arrayExample[0] = 'Hello'; In this case, index 0 holds/has the value 'Hello'; ArrayExample[1] = 'world'; here index 1 has/holds the value 'world'; etc etc. Arrays always start from 0, not 1. For the $_POST global array, this is known as a 'associative array', meaning, instead of the index being a number, it will have a label/name to it. For example: $_POST['myName'], in this case, the index here is 'myName' but instead of being a number like 0, it has a label/name to it called 'myName' and it has/holds a value of someone's name when someone enters their name into the input field in the form: <input type="text" name="myName" />. You can then do this: $firstName = $_POST['myName']; The value in $_POST['myName'] will be set to/stored into $firstName. In your HTML form, make sure to name the 'name' attribute for the input field. Example: <input type="text" name="myName" /> Highlighted in red is the 'name' attribute. When you process the form with PHP, in other to receive the value in $_POST that came from the form's input field with the name attribute of "myName", you have to make sure the name attribute matches with the index of the $_POST array. Remember that $_POST is an associative array, so in this case it will be $_POST['myName']; If they don't match, for example <input type="text" name="fname" /> and in PHP you have this: $_POST['myName']; you'll get the 'undefined index' error message. "fname" and 'myName' don't match. Whatever the user types into here: <input type="text" name="myName" />You retrieve the value in PHP like this: $firstName = $_POST['myName']; Hope this helped.
  14. That there is called a Internal Style Sheet. You can do that. Basically three ways to add CSS: Inline Style, Internal Style Sheet, and External Style Sheet(Recommended). External: <head><link rel="stylesheet" type="text/css" href="mystyle.css" /></head> Internal(like what you pasted): <head><style type="text/css">hr {color:sienna;}p {margin-left:20px;}body {background-image:url("images/back40.gif");}</style></head> Inline: <p style="color:sienna;margin-left:20px">This is a paragraph.</p> That is a HTML document. Maybe you're use to seeing this: <!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="mystyle.css" /></head><body><h1>CSS example!</h1><p>This is a paragraph.</p></body></html> The mystyle.css would have all your styling for that page(s). mystyle.css (just an example): body (background-color: lightblue;} p { color: grey; text-indent: 50px;} h1 {background-color: yellow;}
  15. Check out these links: http://w3schools.com/css/default.asp http://w3schools.com/css/css_howto.asp
  16. Noticed it's your birthday.. Happy Birthday Fox!

  17. Just thought I'd write and say thanks for your input/help whenever I have a question. It's always appreciated.

  18. Just thought I'd say thanks for your input. You really know your stuff! I appreciate it.

  19. Are you referring to something like this: <!doctype html><html><head><title>TD</title><script type="application/javascript">window.onload = function init(){var td = document.getElementsByTagName("td");for(var i=0; i<td.length; i++){ if(td[i].id == "productID") { alert(td[i].innerHTML); }}} </script></head><body><table><tr><td id="productID">260871544234</td></tr><tr><td>Hello world!</td></tr></table></body></html> If so, you just make it more simple by just using document.getElementById;
×
×
  • Create New...