Jump to content

dan_t

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by dan_t

  1. But it's just a connection, a connection is never an object is it?
  2. What exactly does it mean when you get this error when trying to insert data into a database? "Notice: Trying to get property of non-object" This was the line with the error. if($con->error)
  3. I suppose in a very big way, that's a dumb question. They have to know to approve entry or whatever, but here's the question - how do you do it? if(md5$password == md5$password); Maybe?
  4. When you use an md5 or sha1 hash, is there a way to have the user enter it twice to be sure they made their correct password or does the hash make them impossible to compare? Basically, are the hashes random numbers that wouldn't match twice?
  5. Yes that's fine, I looked it up, googled making forms sticky
  6. I had heard the word "sticky" used and wasn't sure what it meant.
  7. I'm horrible at explaining things, but I'll try. You have a person come onto your site. You want them to fill out a form so they can have their own page with the information they filled out, like in comments. Each person uses the same form, the form I thing has to go to the same file I guess? action="whatever". You can't get that information to their own page without information going into a database can you? There would be no way to store it, correct?
  8. I know this is probably a "no" answer, but -- is there a way to take data from a form and append it to a page ( like entering it yourself to a web page) without having to store the data on a database?
  9. dan_t

    IP address

    Fantastic! Thanks for the fast reply. Dan
  10. Is there a way through php to display your IP address. I know each person "so to speak" has there own IP address, and I have no desire to know anyone else's, but I am curious of what mine would be. Thanks Dan
  11. dan_t

    connection

    I thought so, I just wanted to be sure. Thanks
  12. Hi guys, When your messing around with a database on your localhost I know it's no big deal, but when you actually put it online the line of code you use to connect to the database like "localhost", "password" can't be seen by anyone else can it? I know php is a server-side language, but obviously people get to things they are not supposed to, and I was just wondering about that one due to putting in your password.
  13. Well the Clean_code function, I'm trying to make a function that can be used on every input item off the form. I am currently writing this code individually for every entry on the form. Like $firstName = $_POST['firstName']; $firstName = strip_tags($firstName); $firstName = stripslashes($firstName); $firstName = htmlspecialchars($firstName); $firstName = trim($firstName); $lastName = $_POST['lastName']; $lastName = strip_tags($lastName); $lastName = stripslashes($lastName); $lastName = htmlspecialchars($lastName); $lastName = trim($lastName); $password = $_POST['password']; $password1 = $_POST['password1']; $password = strip_tags($password); $password = stripslashes($password); $password = htmlspecialchars($password); $password = trim($password); I would like one function to cover each one , or is the the correct way. It seems long winded. I'm really only focusing on the function itself.
  14. So I'm not exactly sure how this works, but is it the one size fits all? I know I tried several different ways but could only get one part to go in due to the 'user_name' or where it said $string = $_POST['user_name']; I can't figure how to make 'user_name' generic. or a useable variable.
  15. yeah your right, I got the redeclare when i tried using the full function, but only changing $string to $string1.
  16. I wasn't using an array. Is that necessary in this case, being so basic?
  17. Hi was just messing around, and can't figure out how to use this on more than one variable. $string = $_POST['user_name']; $string = $_POST['user_id']; function Clean_input($string) { $string = $_POST['user_id']; $string = strip_tags($string); $string = stripslashes($string); $string = htmlspecialchars($string); $string = trim($string); return$string; } echo <<<EOF <form action="my_first_function.php" name="form" method="POST"> <input type="text" name="user_name"> <input type="text" name="user_id"> <input type="submit" name="submit" value="send"> </form> EOF; echo Clean_input($string); I can get it to print out one, but not two without it saying I can't redeclare the function. I got it to print them both out once, but thatcounldn't have been the correct way.
  18. Ok, I don't have any pages made, I'm just trying to understand this whole thing. Perhaps I need to create some fake pages, but how does the zipcode attach an individuals personal page to it? Meaning when you do a search and it pulls up and displays these zipcodes how is their personal pages linked to each page? Through variables some how? Or is it much more complicated.
  19. My question is, when you extract information from a database, lets say userName for instance, better yet when you have a search for something like zip codes, how do you put a link to each persons page from their zip?
  20. dan_t

    Flash question

    If I wanted to have pictures show, one by one, in the middle of a page with links to the pictures web pages, would Flash be the best program to use? Or would something like JavaScript be more suitable? Thanks
  21. using System; using System.Collections.Generic; using System.Text; namespace lab3a { class Program { static void Main(string[] args) { Console.Write("Please input your name: "); string employeeName = Console.ReadLine(); Console.Write("Please input your salary: "); string inputSalary = Console.ReadLine(); double salary = int.Parse(inputSalary); double balance5Percent = 0.0; double balance10Percent = 0.0; double balance15Percent = 0.0; Console.WriteLine(); Console.WriteLine("{0} at your current salary of {1:C} these are your expected balances", employeeName, salary); Console.WriteLine(); Console.WriteLine(" 5% 10% 15%"); Console.WriteLine("========================================================="); for (int i = 1; i <= 40; i++) { balance5Percent = (salary * 0.05 + balance5Percent) * 1.08; balance10Percent = (salary * 0.10 + balance10Percent) * 1.08; balance15Percent = (salary * 0.15 + balance15Percent) * 1.08; if ((i % 10) == 0) { Console.WriteLine(" Year {0} {1:C} {2,14:f} {3,14:C}", i, balance5Percent, balance10Percent, balance15Percent); } } Console.WriteLine("========================================================="); Console.ReadLine(); } } } This formats in 5, 10, and 15% across a table, but how do I go 5% for 10, 20, 30 ,40 years across the table(so to speak). I can't figure it out. Any help wold be appreciated. Thank
  22. OK, here's my question, how is this code formatting a table? class Program { static void Main(string[] args) { Console.Write("Please input your name: "); string employeeName = Console.ReadLine(); Console.Write("Please input your salary: "); string inputSalary = Console.ReadLine(); double salary = int.Parse(inputSalary); double balance5Percent = 0.0; double balance10Percent = 0.0; double balance15Percent = 0.0; Console.WriteLine(); Console.WriteLine("{0} at your current salary of {1:C} these are your expected balances", employeeName, salary); Console.WriteLine(); Console.WriteLine(" 5% 10% 15%"); Console.WriteLine("========================================================="); for (int i = 1; i < 40; i++) { balance5Percent = (salary * 0.05 + balance5Percent) * 1.08; balance10Percent = (salary * 0.10 + balance10Percent) * 1.08; balance15Percent = (salary * 0.15 + balance15Percent) * 1.08; if ((i % 10) == 0) { Console.WriteLine(" Year {0} {1:C} {2,14:f} {3,14:C}", i, balance5Percent, balance10Percent, balance15Percent); } } Console.WriteLine("========================================================="); Console.ReadLine(); } } } This is code from a class I am taking, but do not worry, this is not a question from the class. I would just like to know how to restructure it (the table). In order to restructure I have to understand how it is being structured in the first place. I could use the help. Thanks
  23. Thank you I appreciate the help.
  24. while ($hex != ' ') should have been while($hex != '') otherwise after it checks the last digit there is nothing left of the string but the loop will run until it finds a space.... which it won't thus returning INVALID HEX STRING Man, I wish I understood that. But you guys are amazing. I could have looked for the next ten years and never found that. Thanks alot. I hope to someday understand some of this.
×
×
  • 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.