Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. I wish I would get BJ! But unfortunately I did not =\ And I opened the Champagne and almost got blinded =\
  2. @corbin: The worst part about it was nothing was shown!
  3. You can do a shell script on start to auto mount it. Just an fyi
  4. It looks retarded to me, but dont judge a book my its cover. I will wait till it comes out on Redbox DVD and watch it then for $1. Until then I can deal without seeing it as I want to see that new Sherlock holmes movie!
  5. You can generally have any file name in the db, just make sure to mysql_real_escape_data for them. If you want them to be SEO friendly then you tend to want to replace anything but alphanumeric and _ -s. If you do not care about that you should not have a problem. Just make sure when the file is uploaded to rename it to a hash of the name so it does not create invalid files (such as uploading a file with certain charaters can make that file undeleteable). Moving to the regex forum so someone can provide a regex solution to replace all non alphanumeric if you so desire that.
  6. if(isset($_POST['submit'])) { $newname = base64_encode(file_get_contents("../upload/$newname")); //$newname = mysql_real_escape_string($_POST['imgdata']); For the displaying file: <?php include("config.php"); $image = stripslashes($_REQUEST[image]); $result = mysql_query("select * from album where albumid=\"". addslashes($image).".jpg\""); $myrow = mysql_fetch_assoc($result); $imagebytes = $myrow[imgdata]; header("Content-type: image/jpeg"); print base64_decode($imagebytes); ?> Is what he means. Not sure if it will work, but I do remember something like this is the past workings. Worth a shot.
  7. The other option is, since it seems the header is difficult to diagnose for you is use a meta refresh. // header("Location: thankyou.htm"); ?> <meta http-equiv="refresh" content="0;url=thankyou.htm"> Should work to redirect.
  8. It could be how the file is being saved. Try opening a new page in notepad and pasting that code in there making sure there are no extra lines at the beginning and saving the file and see if it works then. As a BOF (beginning of file, at least I think that is what it is called) marker may have been added by your editor.
  9. You would need to escape the double quotes: echo "<img src=\"get_image.php?image={$myrow['imgdata']}\">"; But I doubt that is the issue.
  10. The <?php must be the very first character of the file. <?php Is not valid, that will cause a header message, as will: <?php The correct way is: <?php Notice no extra spaces etc. If it is not done that way correct it and it should work (without the ob_start / flush methods).
  11. Well the text you are getting is the correct text as that is the binary code of the image. Looking at the code the only thing I can think of is there is some reason the content-type is not taking so the browser does not know it is suppose to display it as an image instead of the binary code. Perhaps try not using mysql_real_escape_string on the image when you input it into the database and see if that makes any difference? Other than that I am not sure.
  12. You need a semicolon after the $body section: $body = "Name: $name \nPhone Number: $phone \nEmail: $email \nContact Preference: $pref \nJob Type: $type \nInterested In: $kind \nDescription: $message \n\n"; Should solve that syntax error.
  13. What is the column type of the MySQL column you are uploading it to? Is it blob, if not it should be. This SQL statement is bad: $result = mysql_query("select * from album where albumid=\"". addslashes($image).".jpg\""); It should be: $result = mysql_query("select * from album where albumid='". addslashes($image).".jpg'"); As string values inside of MySQL need to be encapsulated in Single quotes only to be valid syntax.
  14. lol, I think it is totally real. He definitely does not seem all there. I mean just look at his face the whole time. As far as passing out and being in weird places, I was getting drunk at a bar about 2 miles from my house and I do not even remember leaving the bar but ended up at my back porch the next morning at 6 am. No clue how I walked freakin 2 miles drunk (or if I got a ride). But yea, totally possible lol. Gotta have that one more beer I guess. And as far as being drunk at 11am, not un heard of. When I lived in eastern Colorado the bars were always packed at 9-12am with the goose hunters drinking beer from November to January. So yea, I would believe it!
  15. Exactly! I mean seriously! I personally liked the whole trilogy. I just hate the freakin 15 minute orgy scene in the second one, seriously wtf was the point of that? But I love the car scenes, that was pretty sweet on the interstate.
  16. I love the first style, I just think it is a waste of a line to put it on a separate line. Thats me
  17. You do not give very much information or example of your code. If you want to learn how to retrieve data from a MySQL database, mysql_connect, mysql_select_db, mysql_query and mysql_fetch_assoc will be your friends to help you on that track. Also you will want to look into a tutorial on MySQL PHP via google, as that will help as well. Also you will want to look into an AJAX framework for ease of use. I suggest jQuery.
  18. It all depends on the structure of the data, but I think your GROUP BY is flawed, not sure if AND is valid syntax? GROUP BY fund, account, project I think commas need to be used. I am not 100% sure on that but yea. If there is a unique field being returned then the group by will not work. Such as the primary key etc. If the all the items are not unique then it should work and group them.
  19. premiso

    select help

    SELECT * FROM downs WHERE users LIKE '%userid,%' Should get you what you want, however, for this to work the ending user id's will need a comma added to them so you do not get false results from something like, searching for 4 and there is a userid of 40. So IE: 1 file 1,2,4 would need to be changed to 1 file 1,2,4,
  20. $body = "Name: $name \nPhone Number: $phone \nEmail: $email \nContact Preference: $pref \nJob Type: $type \nInterested In: $kind \nDescription: $message \n\n" mail( "laaa4@sss.com", "Contact Request", $body); You were using way too many parameters. Combining them into a variable will show you how it should be done. In function calls commas separate parameters. If you wanted to concatenate them periods should have been used. Hope it helps.
  21. You are using the assignment operator ( = ) instead of the comparison operator ( == ). if ($_COOKIE['ID_staples_clubs'] == 'user') { Would be the correct way to test that variable.
  22. No, after any output is sent to the browser you cannot run any headers, as headers must be before the body of the document. As I suggested, you can have the link open a new window, or open a popup in javascript to dish the file. Other than that I do not know what other ways. But what you are trying to do is not possible, at least as far as I know.
  23. I am not sure what context you are using "regular functions" in, but in OOP, why they would set a data member in them could be to call back on that variable, give it access to other functions or do a "last" run on that variable. It all depends on how it is coded and it's purpose.
  24. Your function for pagination takes a parameter for it: Change this: $pagingLink = getPagingLink($sql, $productsPerPage); to: $pagingLink = getPagingLink($sql, $productsPerPage, "search=" . $_GET['search']); And in the future, we really do not need screen shots for most problems. Thanks!
  25. You do two things wrong. A: you are printing $data, so header will not work after that. B. you exit the script before you get to your redirect. As well, you cannot do a redirect here as far as I know. Your best bet is when a download is called you open it in a new window, this way the user can just close the window and be back to where they were. As given the headers you sent to let the user download that file, you cannot do anytype of a redirect, as far as I know.
×
×
  • 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.