Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. And we are assuming that despite your input field containing multiple data items that you are NOT storing that way in your db table. You should have a hashtag table that has a user id field and a hashtag field and your table will then have multiple records for a user as in: user tag john #tag1 john #tag2 john #tag3 john #tag4 Mary #tag1 Mary #tag2
  2. Then he should get a solution from the teacher or from the other students so that he gets something appropriate for the context of his course.
  3. Hopefully you have realized that good database organization is how you properly manage any and all data. By having it well designed you are then able to write queries to answer any question at any time without having to do things like you proposed in your post. No need to move data to another table, no need to remove data when it 'expires'. You simply store your data and query it and format the output to answer any question that is asked. Yes - you eventually may remove data that is beyond use, but I suggest that you develop a process to archive the old data so that you can analyze it over long periods of time if that is the nature of your activity/business.
  4. You skipped a class, a test no less, and you want someone here to write your answer for you. SHAME ON YOU AND SHAME ON ANYONE HERE WHO GIVES YOU WHAT YOU ASK FOR.
  5. What do you want US to do about it? You didn't even show us the line that is giving you the error.
  6. You began with the premise that you have a db2 table and you have a php application. What IS that php application? Or did you mis-speak? I would also add - if you have a task to do and you don't know how to use php, then why don't you use something that you DO know?
  7. I have no problem with it if you follow my instructions as well as everyone else who adds their $.02. Inside, outside, any side - Don't Create Stupid Code!
  8. You want to be sure that the name you create doesn't wipe out another file. I think 'name integrity' is an apt term. Dont' you? Your concern is about the possibility of two instances of your script creating the same random name at the same time. Even tho I don't quite follow your convoluted logic (and wasted logic) I dont' think that's going to happen.
  9. Are you opening up your own image museum? What are you worried about? What is "working out" supposed to mean? Basically what I see in your posts is : 1 - accept an image that you allowed someone to upload thru your form. 2 - rename that image and store it someplace To be safe you have asked how to ensure name integrity. You have been offered the quite simple solution of checking if that filename exists in your images folder before saving the new file there. Case closed?
  10. In case you don't realize what gristol is telling you - YOU ARE DOING SOMETHING VERY STUPID HERE. 1 - separate your code (php) from your html - makes no sense to mix them all together. 2 - Read the manual for any one of the MySQL_* functions. NOTICE THE BIG RED BOX SAYING NOT TO USE IT!!! 3 - Do not in any way allow the user to write your query for you. What?! Are you that stupid that you would let someone actually write a malicious query that could delete your entire database - not just a table - your entire database? 4 - Check your work before posting it for others to work with. You have an input tag that you "attempt" to close with a </textarea> tag. What the h. is this? 5 - Where ever you got this code - return it and don't use anything from that source again. You have no idea what mistake you are attempting to make. Lastly - what you are trying to do is called AJAX. It allows you to have a page that contains JS code that will call a php script and get a response from it and post that result back to the page without doing a refresh. Depending upon the speed of your connection and your server it can be quite instantaneous. I think that is what you want. You should read up on THAT too.
  11. Maybe post this in the CMS section if you want to reach the joomla experts.
  12. Try googling how to use js to open a window and you will see how you can generate a window of the size you want as well as trigger a php script to take over that window. I think that is what you want.
  13. Why not post in the wordpress section? The functions you are using mean nothing to those who don't use it.
  14. Same silly code again. When are you going to stop using it? As for ensuring no duplicates, how about just using a file system function to check if it already exists?
  15. Basically you want to write some code like this: if $_POST['id'] is not set, output a form that has one text field for the id and one submit that calls back to this script using POST, not GET when it is submitted and exit and wait for the input. if $_POST['id'] is set, then grab it, validate it, and use it in a prepared query to get the data you want to display. Using those query results ($pdo->fetch(PDO::FETCH_ASSOC) ) build some html to display these fields in whatever order you want. You can use an html table, or some div tags to arrange it on screen. Be sure to place some submit buttons on it to handle what ever you want to do next. Then exit and wait. This is a very simple solution. You need to be safe and secure in handling the user input and writing the query.
  16. Try echoing out the value of $piccurr to be sure it is what you think it is. As a matter of practice one should always wrap indices in quotes when specifying them literally. For ex. you s/b using $nt2['Picture01'] And what exactly does this 'diddly squat' look like? A blank page? An error message? Anything?.
  17. Your English is not clear enough to me. Quote: 'script in JS would then create/open windows with php code' makes no sense. One can't have php code inside a js script. What are you trying to describe here? Again - you use js to open the window and pass control to the script named as one of the parms of the JS open command. You simply have to port all of your curren tphp code from the calling script to the JS-called script.
  18. The easy way is to crate the page in a php script and then use js to open the window and pass control to that script. You can easily find many examples of this on google.
  19. What do you want to do when they select two or more checkboxes. Make a string like "example.com.net.org"?
  20. So - you really want an introduction to simple and basic php syntax. May we suggest reading the first few chapters of the manual? You'll learn a lot - especially how to concatenate strings.
  21. Looking at this code I see no setting of a 'thumbnail' field. But I do see some horribly bad usage of the @ sign to suppress errors. WHY WOULD YOU EVER WANT TO HIDE ERRORS????? Dont' to it.
  22. Show us how the form is created.
  23. $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = strtolower( end($temp) ); // ADD CHECK FOR VALID FILE if (!in_array($extension,$allowedExts)) { echo ("Error - bad file uploaded"); exit(); // or do whatever else you want here } $length = 20; $newfilename = $_SESSION['user_id'].$_FILES["file"]["name"]; // $thumbnail = $newfilename; // DON'T NEED THIS . "." . $extension; // move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $thumbnail); // $sql = "INSERT INTO videos ( filename ) VALUES( '$thumbnail' )"; // ADDED QUOTES ON $THUMBNAIL // mysql_query($sql); $file_location = '<a href="http://www.--.com/upload/' . $thumbnail . '">' . $thumbnail . '</a>'; $description = $description . " \n " . $newfilename;
  24. Why do you do your connect after you run your query???
  25. leave out the part that grabs $extension and remove it from the later ref.
×
×
  • 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.