Jump to content

eduard

Members
  • Posts

    2,375
  • Joined

  • Last visited

Everything posted by eduard

  1. eduard

    Next step?

    Got it!: <?php$Site_Name = $_POST['site_name'];$Site_URL = $_POST['site_url'];$Description = $_POST['Description'];$con = mysql_connect("localhost","root","usbw") or die(mysql_error());mysql_select_db("website", $con);$sql="INSERT INTO links (Site_Name, Site_URL, Description)VALUES ('$_POST[site_name]','$_POST[site_url]','$_POST[Description]')";if (!mysql_query($sql,$con)){ die('Error: ' . mysql_error());}echo "1 record added";mysql_close($con);?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang='en' xml:lang='en' xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>database</title></head><body><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></body></html>
  2. eduard

    Next step?

    GIVE IT UP! FORGET IT!Unfortunately, you haven´t read all my posts!Again a very simple reply of someone full of prejudiges! (and therefore with a very small mind. Php he knows and probably some other computer lenguages. What else? Not much I suppose!Us? This post is written by DSONEUK!
  3. eduard

    Echo?

    Thanks very much!The php page I find too complicated (too many ´technical´ terms)!Concatenation operator I could search for it! Easier for me would be the explanation of ´concatenation´ aswell as ´operator´. (I´m Dutch)
  4. eduard

    Echo?

    The echo always is a variable not a value?
  5. eduard

    Next step?

    I´m going to do it as follows!Because I don´t understand good what an array or attribute is and neither understand much of your ´technical´ lenguage, I start learning php from the beginning (not with W3Schools!).And as I´m in a hurry, I´ve to do that in some days! (I now start!)
  6. eduard

    Next step?

    They are separated!
  7. eduard

    Next step?

    <?php $Site_Name = $_POST['Site_Name']; $Site_URL = $_POST['Site_URL']; $Description = $_POST['Description'];$con = mysql_connect("localhost","root","usbw") or die(mysql_error());mysql_select_db("website", $con);$sql="INSERT INTO links (Site_Name, Site_URL, Description)VALUES (['Site_Name'], ['Site_URL'], ['Description'])";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con);?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang='en' xml:lang='en' xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>database</title></head><body><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></body></html> As far as I can see, they are exactly the same, but still this error: Notice: Undefined index: Site_Name in E:\USBWebserver v8_en\root\insert.php on line 3Notice: Undefined index: Site_URL in E:\USBWebserver v8_en\root\insert.php on line 4Notice: Undefined index: Description in E:\USBWebserver v8_en\root\insert.php on line 5Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '['Site_Name'], ['Site_URL'], ['Description'])' at line 2
  8. eduard

    Next step?

    Very clear! But how could I know that the name (could nobody explain to me the meaning of ´name´?) in my html form must be the same as in my php script?
  9. eduard

    Next step?

    In this html form I use 3 different ways to write e. g. ´Site Name´:1 s_name for label2 Site Name3 Site_NameWhich one has to be the same as in my php script??? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang='en' xml:lang='en' xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>database</title></head><body><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></body></html>
  10. eduard

    Next step?

    Still the same error (after modification!): Notice: Undefined index: s_name in E:\USBWebserver v8_en\root\insert.php on line 3Notice: Undefined index: s_url in E:\USBWebserver v8_en\root\insert.php on line 4Notice: Undefined index: description in E:\USBWebserver v8_en\root\insert.php on line 5Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '['s_name'], ['s_url'], ['description'])' at line 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang='en' xml:lang='en' xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>database</title></head><body><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></body></html> <?php $s_name = $_POST['s_name']; $s_url = $_POST['s_url']; $description = $_POST['description'];$con = mysql_connect("localhost","root","usbw") or die(mysql_error());mysql_select_db("website", $con);$sql="INSERT INTO links (Site_Name, Site_URL, Description)VALUES (['s_name'], ['s_url'], ['description'])";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con);?>
  11. eduard

    Next step?

    I see 2 different html forms!<html><body><form action="insert.php" method="post">Firstname: <input type="text" name="firstname" />Lastname: <input type="text" name="lastname" />Age: <input type="text" name="age" /><input type="submit" /></form></body></html> <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>Which one is the right one?
  12. eduard

    Next step?

    I apreciate that, but your example and the example of the tutorial insert.php don´t make me understand the error I make!
  13. eduard

    Next step?

    Thanks! Good explanation!
  14. eduard

    Next step?

    You are too early! I still have to study the examples!
  15. eduard

    Next step?

    How to set a form like this? Like any other form?
  16. eduard

    Next step?

    Thanks very much! However, this isn´t what I want! I want to show how a database works using msql queries!
  17. eduard

    Next step?

    Ok, but how can I put this form (in my portfolio?) on my website so that it´s attractive for potential customers?
  18. eduard

    Next step?

    Sure it does! Thanks very much!
  19. eduard

    Next step?

    I have (nearly: undefined index I don´t understand well - although it´s already explained to me - undefined is obvious, but ´index´ (?)), but I have the select, where, update and delete php files working!So, still my question: How does such a html form look like and where do I find an example of it?
  20. eduard

    Next step?

    I understand your reply! But how do I make such a html form?
  21. eduard

    Next step?

    The goal was and is to show a php application (database) on my website! I´ve an insert -, select -, where -, delete php etc. and I´ve 2 forns html!So, what´s next?I assume 1 html form with several MYSQL queries!Where can I read how to do that?
  22. Thank you very much! Can you be more specific about the HTML table please?
  23. Can you say:a website for a client must be finished, your own never will be?
  24. But that I can find out (easily)! My question however was:: ¨something TOTALLY NEW!´
  25. What do I´ve to learn now? I know I´ve still to learn a lot in HTML and CSS! But what´s relly new to me as I want to improve my skills as a web designer? I´ll have a look now at the tutorials! CSS3? HTML5? of course! But I´d like something totally different!
×
×
  • Create New...