Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Zane

  1. I don't think "--$targetID" is even legal. I search php.net and haven't seen anything remotely looking like it

    You didn't search hard enough

    http://php.net/manua...

    Simply incrementing or decrementing your pid variable isnt safe. For instance, what if you delete a product, then that id no longer exists in a perfectly normalized database table.

     

    If you want the previous and next id you will have to select them and limit your results to 3

     

    SELECT * FROM products WHERE
    id='$thisID' OR
    id<'$thisID' OR
    id>'$thisID' LIMIT 3

     

    To keep the other products' info from disrupting your current while loop, you will have to check whether $row['id'] == $thisID.

  2. You should use mysql_fetch_assoc if you want the column names for the key

     

    Typically, when people write code to retrieve mysql results they loop through their result with a while loop, such as this

    while($row = mysql_fetch_array($result1)) {
    echo $row['columnName'];
    }
    

  3. Assuming this script is working already, all you need is an else if

     

    if ($row_rsReleaseQue['duedate'] < date('d-m-Y',$now)) {
    	echo '<tr class="tableBody3">';
    } else if($row_rsReleaseQue['duedate'] == date('d-m-Y',$now)) {
    	echo '<tr....';
    } else {
    	echo '<tr class="tableBody1">';
    }
    
    

  4. Since this is indeed in the root directory, you need to prefix the path with a /. That slash symbolizes the root directory.

     

    Othrewise it is going to look within the current directory for a directory called home

  5. I have never done anything like this before, but I am going to try to explain the logic I would use if I were in your situation.

     

    Assuming you already have payment notifications set up so you can code around a successful transaction, I would have all of your files stored in a private directory outside of public_html and out of the webs reach. I would also have another private folder to which you would store copies of these files.

     

    Once a user pays, the file should be copied to the other folder and given an md5 encrypted filename for a bit of obscurity. But like all the good books tell you, Obscurity is not security. So you will indeed need a database for this to keep up with the timestamps as well as the number of times it is downloaded .. and the user who is downloading it. You can do all this using a php download.php script to fetch the file from the other folder without the user ever knowing its whereabouts.

     

    Also, it doesnt hurt to Google a bit ;D

    http://stackoverflow.com/questions/10834196/secure-files-for-download

  6. I am looking to implement a private image hosting setup without having to write it from scratch. I know there has to be some kind of Gallery API that is out there that I do not know about. I am looking for some kind of minimalistic tinyimg type thing. Does anyone have a clue of something like that exists? I have googled but all I can find is image hosting servers. I already have the server, I just need to find a simple interface....either open source or pay, doesnt matter to me at this point.

  7. The number one thing I miss about my home is the water. I live in a very rural city in the Appalachian mountains of North Carolina so drinking from the tap is no different that bottled water. Additionally, we have springs and wells all around the area. I can literally hike up into the woods, find a spring and drink directly from the puddle it creates..which converts into a creek later on down the mountain.

     

    Sorry, just realized that has nothing to do with workspace.

  8. When are you back to the states?

    December 6th. Then I will at least have a 20" monitor and a desktop computer. Still, the space is minimal and my room lacks extra outlets so I pretty much have a power strip attached to a powerstrip. I hope to clean things up when I get back, but it wont be long until I am back in a dormroom.. .. Someday I will get my cool workspace. Until then, I´m just having a good time and coding when I get the chance to make a buck or so.

  9. Sweet setup Philip, very minimalistic, I like.

     

    I don´t exactly have a setup at the moment. My setup gnerally consists of whatever computer I just so happen to be using and usually it is very uncomfortable. I have somewhat of a sloppy personality so my goals for a clean and admirable workspace are usually diminished within a day or two.

     

    As of right now, in Mexico, I have a 10.1" HP netbook with Spanish Win7 Starter because I spilled water on my Lenovo G570 that I had for almost a year. Since it is so small I am using the box it came in to raise up higher. I have a retractable mouse with very minmal space to use it. The desk I am using is very wobbly with hardly any legroom. I am sitting uncomfortably in a fold out chair with cushions. Thank God it at least has cushions! To my left is my twin size bed with no box spring, just a wooden plank. To my right I have a vertical shelf with 5 open compartments and behind me is my bathroom. The room is about 15ft wide give or take. Including the bathroom... the room is 30 ft long give or take.

     

    Someday I hope to have a setup like yours, I am full of jealousy.

  10. You have to use PHP´s isset function to check whether or not the variable exists or not... That is why you get an undefined index...you haven´t hit the submit button therefore POST is empty.

     

    $Number = isset($_POST['Fnumber']) ? $_POST['Fnumber'] : null;

×
×
  • 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.