Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. 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.
  2. What do you want to do when they select two or more checkboxes. Make a string like "example.com.net.org"?
  3. 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.
  4. 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.
  5. $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;
  6. Why do you do your connect after you run your query???
  7. leave out the part that grabs $extension and remove it from the later ref.
  8. You didn't tell me how you were getting the data. I just told you how to handle the data you showed me. It's up to you to parse the input file and get it into the format you presented first. Or figure out your own method.
  9. A little knowledge could be bad. Do you not understand php code yet? Assuming the answer is yes, then why do you want to know? The code, with an obvious flaw in it, attempts to take an uploaded user file and append a userid to the front and then save the uploaded file to a new place with that new name. Problem is that it appends an extra extension to it. Does this help?
  10. If what you are saying (and this is a guess since you aren't very clear) is that the 4 lines above represent key=value pairs, simply explode each line on the = sign and then add the 2 array elements to an array as in : list($k,$v) = explode("=",$line); $arr[$k] = $v; Of course this will have to go into some kind of loop to collect all the data (4 lines). Now you can simply interrogate the array for the value you want: $val = $arr['PCODE[p45]'];
  11. If you want something added but separate, why not just add a function call that passes the necessary args to the function? Then design the function anyway you want.
  12. I fail to see why one would need to consider "script design" changes just because one switches from procedural to oo. If one is already managing to keep business logic physically separated from the presentation logic, how does the change in tools affect this?
  13. Still practicing deceit in your posts because you make mistakes constantly. You'll never be a true programmer that way.
  14. By the time your process reaches 'page load' the server is out of the picture. And if this is all about sending un-suspecting users to an ad with your links instead of where they think they are going - Shame!
  15. Do you get the thank you for feedback message? Turn on php error checking - might have an error. What is the anchor tag with the onclick event supposed to do for you that a simple submit button doesn't do?
  16. If you gave us the scripts that you actually run we would still be willing to help. You just can't mislead us. You have to realize we are trying to help but we are blind here if we can't see your code - good or bad. Help us to help you by providing the MEANINGFUL code that RELATES to your problem next time.
  17. Sure sounds like you want someone to write this for you. If you are attempting to learn php or even learn how to program, you have to do the learning yourself. There is a certain amount of intelligence that has to be used to do this kind of work, and that use begins in the beginning. Good luck. You may get some well-meaning reader here who will jump right in and solve this problem for you, but I feel that would be a serious injustice to your learning process. Besides - why are even attempting this exercise? Did you dream this up? If so, why did you start with such a tricky project? Try something simpler to get comfortable with writing simple php and solving simple problems. Or is this actually 'homework'?
  18. Are you just saying that you want the user to be able to filter what data shows up on the page? For ex. you do a query and show him 10 records. Then he clicks on a couple of rows on the screen because he didn't want them and you have to re-build the page leaving those two off? Simply do as Frank said - change your query to exclude those two records by their key value and re-run the query.
  19. Is this link on the page at all times? Meaning - when they click the link and it goes to url 1, does the link still show up on wherever url1 is? Or do they end up somewhere else and you want to remember where they went so that if and when they use this starting page again, you can direct them to url2 the second time?
  20. And just to be the demagogue in the group - there are no php tables. They are html tables. Semantics count in programming.
  21. Excuse me? You re-posted the same broken code DELIBERATELY when I asked you for specific code to help you out? Good by. Not wasting my time on you.
  22. Seems like I've seen this code somewhere before. If this is THE ACTUAL CODE YOU RAN you should be getting an error because you misspelled your description. I don't think this is the code you ran
  23. In one spot you do a query that selects only 'emailaddr' from your table. Then later you try and reference a field named 'id'. How can that happen?
×
×
  • 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.