Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. The connect is nothing. It's the query that you have to verify so you know whether you made a mistake in it.
  2. ooops! I mis-read the error message earlier. IT means that you didn't check the results of you query run before trying to fetch a record. If you had (or if you had error checking turned on!) you would have read a message and aborted. Turn on error checking. And add a check on whether the queryresults var is false or not. False is bad - show the error message from MySQL_error (?)
  3. It means that all of the MySQL_* functions are being removed from php in the near (very?) future. It's listed in the manual for every function and many, many forum posts make the suggestion to newbies to move away from MySQL_query and the like. The way to go is PDO or mysqlI if you have to. Heed the warning and learn a new set of functions.
  4. Yes you can! Just thought you might not be up for it yet. just type: where price >= $minprice and price <= $maxprice at the end.
  5. you need a where clause at the end to compare price to the min & max prices values you have. Do a search on sql joins.
  6. Program much? Cause you have some pretty bad logic errors here. You initialize your friends array every iteration of your while loop. Therefore you will never get a hit in your check for dupes. You really should combine your second query with the first one (which you didn't show us) and avoid this coding completely.
  7. IMHO - you don't understand css at all. Twelve Hundred Lines? Are you f.... kidding me?
  8. Since there isn't even an h1 tag in this code, you haven't helped us out much. Nor did you show us much css. good luck.
  9. uhhhhhhhh..... bad code perhaps? Of course we have no code to look at, so how many guesses do we get?
  10. Why do you have code to create a database but then try to insert a record in a non-existent table? Why do you stripslashes on your input values? Why do you expect slashes in the input?
  11. Way too much code to look at. How about just showing us the part where the clicked link runs the INSERT code? And then where the show link does the select query and builds the output?
  12. my code comes thru badly on this editor as well.
  13. Perhaps this google result is what you want: http://stackoverflow.com/questions/9559032/how-to-download-a-file-from-server-with-a-button-click
  14. 1 - USE CODE TAGS per the forum's rules. 2 - learn how to use css and stop using it wildly and needlessly. 3 - then show us the PHP code that you are using since that is where your question really lies, not in the html. BTW - here is a cleaned up version of your html from above. Had to do it. It was horrible. sign-up form (?) <html> <head> <style type="text/css"> body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } .style5 { font-size: 16px; font-weight: bold; } </style> </head> <body> <form name="form1" method="post" action="email-activation-script.php"> <div> <center> <p class="style5"> Form Registration </p> <table width="35%" border="0"> <tr> <td class='style7'>Username</td> <td class="style7">:</td> <td class="style7"> <input name="username" type="text"> </td> </tr> <tr> <td class="style7">Email</td> <td class="style7">:</td> <td class="style7"> <input name="email" type="text"> </td> </tr> <tr> <td class="style7">Password</td> <td class="style7">:</td> <td class="style7"> <input name="password" type="password"> </td> </tr> <tr> <td> </td> <td> </td> <td class="style7"> <input type="submit" name="Submit" value="Register"> <input type="reset" name="Submit2" value="Cancel"> </td> </tr> </table> </center> </div> </form> activation form(?): <form name="form1" method="post" action="check-activation-script.php"> <div> <center> <table width="35%" border="0"> <tr> <td>Username</td> <td>:</td> <td> <input name="username" type="text"> </td> </tr> <tr> <td>Activation Code </td> <td>:</td> <td><input name="activation_code" type="text"></td> </tr> <tr> <td> </td> <td> </td> <td> <input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Cancel"> </td> </tr> </table> </center> </div> </form> Took out the extra span tags and the un-used label tags. Cleaned up your css and re-defined some of it. Now let's get to your php code - hopefully it is in better shape than you html/css is
  15. I don't get your script. First you call your function to dump all the files in the specified directory and sub-directories of it. Then you open a different directory and dump the filenames and dirnames in that ONE folder. And - is this a sample of your upload process or is that a completely separate process that doesn't need mentioning here? (Plus - you have a typo in this code that s/b giving you an error, if you have error checking turned on properly.) As for your question - I am assuming that you have a user logged in who has a session var that indicates such and you want to tie that user to a group of files so you can only show him 'his files'. If so - you have to do something to make that connection during the upload. How are you envisioning that? Does your upload process only allow them to put files in one place, based on their login value? Does your upload process create an entry in a db table to record what files each user uploads? To answer your question - I would say yes you can do this but it's not done by magic - you have to create something to make it possible.
  16. HTH! Glad you understand what I did - it is good to keep the logic away from the presentation as much as possible. PS - I hope you are doing an error check on the connection in that included code and not doing it as you did in your last posted sample. Check that the connection worked when you do the connect, and check that the query works when you do the query.
  17. oops. Change the line $options to: <? echo $options; ?> NOTE: just added a semi to the line above!
  18. I'm confused. Is my code working now ? (with the change as suggested to a .php filename)
  19. you have four fields in your selection, but only 3 in your list(). I realize that list will work like that but it's still poor practice and should be giving you a notice error
  20. OK - try this. It's your code with some error checking and some re-arrangement to make it more readable. <?php error_reporting(E_ALL | E_STRICT | E_NOTICE); ini_set('display_errors', '1'); //MySQL Database Connect include 'sqlconnect.php'; $sql = mysqli_query($con,"SELECT title FROM aktiviteter"); // check query did not return an error if(!$sql) { trigger_error('DB Error: ' . mysql_error(), E_USER_ERROR); exit(); } $options = "<select name='aktivitet' id='aktivitet'>"; while ($row = mysqli_fetch_array($sql)) { // NOTE - ALL OF YOUR OPTIONS WILL HAVE THE EXACT SAME VALUE CLAUSE - N.G.!! $options .= "<option value='owner1'>" . $row['title'] . "</option>"; } $options .= "</select>"; // NOW begin sending 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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> </head> <body> $options </body> </html>
  21. What doesn't work? Besides the select tag?
  22. Perhaps it is the fact that you begin your class with a line of code instead of a method?
  23. Your code is hard to follow. But - if you turn on error checking you should get some help in finding your errors. ALWAYS TURN ON ERROR CHECKING DURING DEVELOPMENT. The first rule of developing in PHP.
  24. looks like you found your solution. good bye
×
×
  • 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.