Jump to content

EricgTP313

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

EricgTP313's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So I have several scripts to upload images, they all worked. Now I'm moving all my sites to a dedicated server with CentOS, Apache 2.0.52, and PHP 4.3.9. I've set all the permissions I can think of to the directories being uploaded to, I've chown'd them for apache:apache, and also nobody. I have no idea why I'm having this problem... Script (real basic one i wrote just to make sure i hadnt broke something in my old scripts) <? if($_SERVER['REQUEST_METHOD'] == "POST") { $theDir = "/images/"; $theNewFile = $_FILES[theFile][name]; echo $_FILES[theFile][name]; echo "<br>"; echo $_FILES[theFile][tmp_name]; move_uploaded_file($_FILES[theFile][tmp_name],$theDir.$theNewFile); die(); } ?> the output: akita-eric.jpg /tmp/php0bvwGa Warning: move_uploaded_file(/images/akita-eric.jpg): failed to open stream: No such file or directory in /var/www/websites/<username>/testme.php on line 16 Warning: move_uploaded_file(): Unable to move '/tmp/php0bvwGa' to '/images/akita-eric.jpg' in /var/www/websites/<username>/testme.php on line 16 Somebody please help, this is driving me nuts, and is a pretty integral part of many of my websites, the ability to upload via http.... Thanks in advance!
  2. [quote author=shoz link=topic=99897.msg393711#msg393711 date=1152391726] Change the column type for price so that it will be sorted correctly. [code] ALTER TABLE products CHANGE price price DECIMAL [/code] If you're storing the "$" symbol in the column you should stop doing so. [/quote] awesome, that worked great, thanks! and no, I'm not storing the $ in the column :)
  3. Hello, I've written a very basic shopping cart script in php/mysql for a friend, and I want to be able to sort by price ascending and descending, but if there is a price that is, say $123, it is being sorted as less than, say, $99, because the 1 obviously IS less than the 9. How would I go about making the script know that a 1 in a 3 digit string actually is greater than a 9 in a 2 digit string, and so on? Heres my code: [code] <?php $sort = $_GET['sort']; $by = $_GET['by']; if(!$sort){ $sort = title; } if(!$by){ $by = ASC; } $query2 = mysql_query("SELECT * FROM products WHERE type = 'sfx' ORDER BY $sort $by") or die(mysql_error()); ?><div align="right"> <form name="form1" id="form1">Sort Items By:   <select name="menu1" onchange="MM_jumpMenu('parent',this,0)">   <option value="#">[Select One]</option>     <option value="index.php?p=sfx&sort=price&by=DESC">Price (High - Low)</option> <option value="index.php?p=sfx&sort=price&by=ASC">Price (Low - High)</option> <option value="index.php?p=sfx&sort=title&by=ASC">Title (A - Z)</option> <option value="index.php?p=sfx&sort=title&by=DESC">Title (Z - A)</option> <option value="index.php?p=sfx&sort=type&by=ASC">Type (A - Z)</option> <option value="index.php?p=sfx&sort=type&by=DESC">Type (Z - A)</option>   </select> </form> </div> [/code]
×
×
  • 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.