Jump to content

dannyb785

Members
  • Posts

    544
  • Joined

  • Last visited

Everything posted by dannyb785

  1. Tried what already? If your table's name is HOSTA, you have to say "SELECT * FROM HOSTA" it can't be anything FROM hostajess... hostajess doesn't exist(as afar as I know)
  2. Your response doesn't make any sense. A tag starts with a < and if there is no > to end it, how can a browser know when to end it? Referring to a < doesn't apply since the entire question is when would a browser know where to insert the >
  3. then you'd get the posted item into a variable.. say $file $temp = explode(".", $file); $size = sizeof($temp); $type = $temp[$size-1]; if($type == "3gp" || $type == "mp4") { error message; } else { upload file; }
  4. lol thats the error message you typed yourself. The way you have it setup is to display the error if the uploaded image isn't transferred successfully. It could be a ton of different things. I'm telling you, it's probably bc your folder's permissions aren't set to be written into
  5. wtf? the script I gave will do what you need perfectly. You don't have to manually do them all
  6. Ok well obviously you don't know what I'm talking about... Download a program FileZilla... then you have to connect to the site. You should have a username and password to login to your admin environment. Usually your domain will be ftp.yourdomain.com then username and password. Login. Find your 'uservideos' folder and right-click view properties. Then tell us the 3-digit value you see
  7. check that your folder permissions are set to write. Though I'd highly suggest resetting them to 711 or lower after the upload. If you don't know what I mean by that, use an ftp client to connect to your site, find the "uservideos" folder, right click and view properties. You should see some sort of 3 digit value somewhere(possibly starting with a 6 or 7). Tell us what it sas
  8. I just came across some code on php.net that works perfectly as I need it to. Here it is.. <?php // Max height and width $max_width = 100; $max_height = 100; // Path to your jpeg $upfile '/path/to/file.jpg'; Header("Content-type: image/jpeg"); $size = GetImageSize($upfile); // Read the size $width = $size[0]; $height = $size[1]; // Proportionally resize the image to the // max sizes specified above $x_ratio = $max_width / $width; $y_ratio = $max_height / $height; if( ($width <= $max_width) && ($height <= $max_height) ) { $tn_width = $width; $tn_height = $height; } elseif (($x_ratio * $height) < $max_height) { $tn_height = ceil($x_ratio * $height); $tn_width = $max_width; } else { $tn_width = ceil($y_ratio * $width); $tn_height = $max_height; } // Increase memory limit to support larger files ini_set('memory_limit', '32M'); // Create the new image! $src = ImageCreateFromJpeg($upfile); $dst = ImageCreateTrueColor($tn_width, $tn_height); ImageCopyResized($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width, $height); ImageJpeg($dst); // Destroy the images ImageDestroy($src); ImageDestroy($dst); ?> mail at soylentgreens dot com 30-Mar-2005 06:37 How about this for cropping images... <?php $imgfile = "img.jpg"; $cropStartX = 300; $cropStartY = 250; $cropW = 200; $cropH = 200; // Create two images $origimg = imagecreatefromjpeg($imgfile); $cropimg = imagecreatetruecolor($cropW,$cropH); // Get the original size list($width, $height) = getimagesize($imgfile); // Crop imagecopyresized($cropimg, $origimg, 0, 0, $cropStartX, $cropStartY, $width, $height, $width, $height); // TODO: write code to save new image // or, just display it like this: header("Content-type: image/jpeg"); imagejpeg($cropimg); // destroy the images imagedestroy($cropimg); imagedestroy($origimg); ?> You'd just need to modify some of the values to do what you need to do. It works perfectly for me
  9. Check the lines above and below line 26 for any colons. Sometimes I accidently type a colon instead of a semicolon at the end of a line.
  10. This is correct, except I believe it should be $found < 1 || $username != $friendname I'd also suggest making it $found == 1, not that it needs to be, it's just better for visualizing what's going on "If we aren't friends and this user isn't me, then display the link"
  11. but how does it know where to end the tag? Like what if he wanted the cell to display 'style="whatever"', it would probably interpret that as still being in the tag, right?
  12. When you create a table, you have to have a "user" to access it. My hosting provider makes me create a user before creating a table. You have to create one and assign it permissions on the table(select, alter, etc) and what are you naming the table? if it says 'devilon-1913195.4images_categories' doesnt exist then you are doing some query trying to access a table with that name. If your table has a different name(which it likely does, if it exists at all), search your php code for any/every instance of 'devilon-1913195.4images_categories' and replace it with your table's name.
  13. Well, each time a form is submitted, you should truncate($_SESSION .= value) the items. So at checkout, you dont care about the forms, everything should have already been stored
  14. holy crap, I like this design. The logo is perfect. Simple, identifiable, yet distinct enough to recognize easily. I'd just say, like someone above my post, to shrink the height of the header. It just takes up too much space. Other than that, beautiful site.
  15. just wondering id nl2br is functionally better than str_replace. Often times there are many ways to do the same thing, but one is more efficient.
  16. login details? as in, username and password? not a good idea. Does your provider have phpmyadmin? It's pretty simple to create and edit tables with it. Obviously you havent created a table with that [horrid] name. Remember, table names are case-sensitive
  17. your query is selecting from a table "hostajess" but you've created a table named "HOSTA".
  18. ^ and ^^ ditto. Tinyint is what i do.or maybe varchar with length 1(but I dont do that, I dunno which takes up more space)
  19. The way I'd do it is: firstly, start a session in every page, so that as they browse, if a session variable is created, it wont go away if they view a page that doesnt have a session(or changes the current session). I'd make a list of values of the items that were ordered separated by something. One way you can do it is when an item is add to the cart, you do $_SESSION['in_cart'] = $_SESSION['in_cart']."$item_id|"; Then when you're going to the "checkout", you'd explode the session variable separating the |'s like.. $var = explode("|", $_SESSION['in_cart']) so that the number of items is sizeof($var)-1 (since the last value will be blank, due to the right side of the last | being counted in the array).
  20. So is my way just wrong? Is there a reason my advice was ignored?
  21. Yea, by saying thin, you are opening it to be the size that the browser interprets "thin" to be. Not a good idea.
  22. You can say that it's not what you would do, but if you're gonna call someone out and say they're flat out wrong, you need to have a good reason.
  23. Ok, I know what you're trying to do. It's better to just insert the data as is(text filtered of course) and then when the data is being viewed you just do a quick $var = str_replace("\n", "<br>", $original) and then echo $var. This is your best bet bc if the user is allowed to edit that text later on, they will be editing the text with <br> tags unless you reverse the tags before showing the text again to edit($var = str_replace("<br>", "\n", $original)) but save yourself from having to do that by doing what i said before. Insert text unchanged in the database and then convert the newline characters "\n" into <br>'s just before echo-ing it. Hope that helped
  24. checkboxes gave me trouble when i first used them bc I didnt realize that something that wasnt checked never was stored into the $_POST variable. So if you have 10 checkboxes but only 2 were checked, you'll only have 2 $_POST variables. Since you have no idea which ones were checked, doing a query of all ads displayed wont do anything for you. Instead, the only solution i know of is to step through the $_POST variable. If you want to(a good way to visualize it) is setup the form action page to do "print_r($_POST)" that way you can see what variables were created based on what items were checked.
  25. I'm not sure if it matters, but have the "From: whatever" at the beginning of the $headers variable instead of the end. See if that works
×
×
  • 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.