Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Are you all set with this question? I can't tell from the posts so far. If not, I have questions. Like - are you uploading images or not? Kinda sounds like you are not which means how do you expect to display them? AFAIK you can't keep them on your pc and display them on your webpage. The pic files need to be stored on your server and then your script creates html tags that point to the folder holding your images and looks up any data about the pics in your db, using the filename as the lookup value.
  2. Are you kidding me/us? You submit 9 files and tell us some vague problem exists and expect US to do your problem solving???? And what are we supposed to do with your 50 points??
  3. That's programming!! A never-ending educational experience.
  4. Don't know what you last post is about, but the test you did for me tells us that the var doesn't exist when you try to output that line containing it. Now - figure out why it doesn't exist. Also - you really don't need to keep using <? ?> tags throughout your code. Your can write html like this: $code =<<<heredocs <td>$myvar</td> <td>$morevars</td> <td>$anothervar</td> blah blah blahhtml heredocs; echo $code; will output all your html and vars without going into and out of php mode. read up on heredocs in the manual. Note that the closing tag (heredocs;) MUST be in column one.
  5. Yes - what is your problem? I don't know what you mean about printing the page, since I see no code related to printing a page. But - fyi - printing with php is best done by creating a pdf and then letting the user trigger the print action with their browser. Very difficult to simply print a web page since you don't know how it appears to the user on his screen and may not fit on the page. With a pdf, you can create a well-defined image and be sure that it will be a nice-looking report. Read up on the fpdf class. It will take a little experimenting but it is easy to pick up.
  6. In front of that last line "print ...." do exactly this instead: echo "to is:$to:"; exit(); Tell me what that echo line gives you. BTW - you can use alternating double and single quotes to make your life easier. Try: print " <td style='width:70%'><input type='text' name='to' maxlength='50' style='width:200px' value='...............................' /></td>"; Much easier to type and to read, no?
  7. That kind of message says : a - the database name doesn't exist or b - you didn't connect to the sql server, as in the 'connect' statement above that select didn't work. Perhaps the permissions have changed on the sql server, or the credentials in the connect statement got changed somehow. Be sure that you are doing an error check on that connect statement. (as one should on every statement!)
  8. I don't look at "full code". I look at sections that are clearly related to your problem. Did you look at your code to see if $to was defined before using it at line 146? Put an echo in your code right before line 146 and see what you see onscreen (ie echo $to; exit(); )
  9. You're probably running in a prod environment, You need to work in a devl environment and turn on error checking and then take the info that you get from that to isolate the php line that is causing the problem. The error you describe is not a normal error, ie I've never seen that exact wording in a message. So - when you find the line and read up on that you may have your answer, otherwise you can at least show us the line.
  10. A lot of meaningless code as it applies to this problem. The previous poster tried to tell you something. Heed it and then get back to us with the pertinent code sample if necessary.
  11. Did you check the manual? This function expects a source file from a specific source. You seem to be simply assigning a name and attempting to move that.
  12. Line 146 looks like the part of your script that builds the page for the user, hence the following portion is irrelevant here. What's important is - does the variable $to exist prior to line 146?
  13. Besides - the <input type='file' tag will be pointing you at a folder on your client machine, not the server, so you don't want that path. And the prev post was correct. You never want to store the path in the table UNLESS your table will be hosting files from all over your website. Usually photos are stored in one folder tree and you can do as the post said - store the root path to that folder and then append any subfolder name to the filename as in: main folder name: "photos" sub folder names: "Jim", "Fred", "Linda" Stored in the table would be: "Jim/pic1.jpg", "Jim/pic2.jpg","Fred/hispic.jpg","Linda/herpic.jpg" and so on. If the photos have to be moved, the assumption would be that all the subfolders would just be moved to another parent folder and you just modify the main folder name stored in your script or in a specific record on your table. Remember - that code you showed us is to browse for files on the client. If you want to give the user something to browse the files on the server (ie, in your db), you need to do something else.
  14. One thing I suggest is: learn the usage of CSS. You can save an awful lot of code with css. Consider your <td> tags with the alignments you are doing for EVERY element of your table (much of which is deprecated BTW). <head> <style type='text/css'> td { padding:4px; text-align:left; vertical-align:middle; } </style> </head> This will do all your alignments for every table cell. Should you need to make some cells different, simply create a class and reference it in the <td> tags that you want to be different, as in: (in your css section as above) .td_bottom { vertical-align:bottom; } will create a different alignment for those td cells that have 'class="td_bottom"' in them.
  15. I've learned something new. So - the user should use one of the suggested functions instead of the MySQL one - everything else is I've described stays the same. ps - what the heck is the "authentication system in MySQL"? I've seen so many examples of its usage, I never knew it was not a preferred method.
  16. I dont' understand why you need a plain text password, nor why encryption is not possible. Your app reads the data (password) and uses it to validate the user's input value - it never goes anywhere else. So why can you not encrypt it for your usage? Nobody/no one will ever access this value - if they are then you have a serious design problem, since by simply letting another application access your secured data is a security breach itself.
  17. Sorry - I don't wade thru other people's giant blocks of code. Show me the isolated part that does what I suggested previously. PS - I may be alone in my practice, but I design my scripts to put all the html in one function and I place php vars that contain all the dynamic parts of the page. Makes reading and debugging SOOO much easier and also makes following the php easier since it isn't intermingled with that html code. Think about it. Generally I have one <? tag per script.
  18. Well, that's true, but at least a good security method for 'other' sensitive data can prevent the damage from progressing beyond.
  19. This is not the answer you seek, since security is not one of my strong points. Simply - you do not store the password in plain text. You store it in your chosen hash/encryption/etc. scheme. Then when a user presents a password your hash that entry and use it to find a matching (already-hashed) password in the database. $q = select * from mysignons where username=$user and password = PASSWORD($pass) where PASSWORD is the standard MySQL hashing function. If you choose to use some other hash method, you simply apply that to the $pass var and use the result in your where clause. The thought you have is probably triggered by the desire to be able to recover the password should the user forget it, but that is not what one does. Once forgotten, the user is given an entirely new password, never the old one.
  20. You actually have a field in your html form named "query"?
  21. I"m thinking you need an "as xxx" clause after the DATE_FORMAT in order to give it a simple name. Did you dump a record to see what fields you did get from this query?
  22. Well, then you have some reading/learning to do if you've gone from "ok in PHP, Jquery and SQL" to a "beginner". As for the effects - it's not necessarily a jquery effect - js does things like that to - using opacity and timers. What you want to achieve is very easy with these tools. But you have to teach yourself some stuff. You'll have to crawl before you walk and spend some time on this before you're done. 1 - uploading images - rather than writing a page to do the uploads, why not use an ftp client to upload them all to a staging folder on your server and then write a php/sql script to take their names and put them in a table with identifying attributes for the user to search by? I would store the filename, an id, the location (the staging folder) unless they will always be in one folder in which case you can just hardcode it in your scripts later, a description of the image to show on the search page or when the user hovers over it, any other pertinent info about the image. 2 - Create the 'search' page for the user to select an image or to show thumbnails (uploaded manually also) and let the user pick an id for the image they want to view. 3 - Create the display script to show the user's chosen image by accepting his input and reading the table entry for the selected id and get all the data about it
  23. Tada!! So only create the array when you load the page for the first time. if (!isset($_SESSION['numbers'])) $_SESSION['numbers'] = array(); Then each time you process your $_POST and add an entry, do: if (count($_SESSION['numbers']) < 6) { (redisplay your page and exit) }
  24. I quote from your orig post: "How do I decode/extract that and submit to Tumblr a newly provided HTML?" Sounded to me like you wanted to upload HTML to Tumblr. And where am I spamming 10+ forums? Post count? Who needs that?
×
×
  • 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.