-
Posts
4,362 -
Joined
-
Last visited
-
Days Won
11
Posts posted by Zane
-
-
Whoa, gotta check this out.
-
Hmm.. I wondered whether that would work or not. I should have mentioned that it was not a guaranteed successful query. But for certain, the IDs will have to be specifically selected.
-
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
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.
-
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']; }
-
5 GB is 5120 MB, so with that part out of the way,
Multiply 5120 by 12000, then divide by 2.5
(5120 * 12000) / 2.5 = 24,576,000 rows.
-
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">'; }
-
Usisng FTP you should have no problem uploadng to root assuming you have the write permissions. How are you uploading them now?
-
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
-
http://www.devshed.com/c/a/PHP/Simple-and-Secure-PHP-Download-Script-with-Limits-Tutorial/
There is another helpful link.
-
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
http://stackoverflow.com/questions/10834196/secure-files-for-download
-
This may (or may not) help you. I thought I should at least show it to you
http://rickosborne.o...-grouped-query/
Here is another source that should help you
http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/
-
I suppose I will just have the person use Dropbox until I have the time to create something. At least it will pay more.
-
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.
-
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.
-
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.
-
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.
-
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;
-
You only gave us 15 lines, how are we supposed to know which line is 82?
Additionally, associative arrays are called like this
$k=$rec['keyword'];
with single quotes.
Lastly, please use our code tags for code.
-
What err?
You should have mentioned that to begin with
-
This is not a question,
-
Everything was wrong with it. Try taking it apart and then ask us.
-
You best bet is to use Regex for this..so I´m moving this to that forum.
-
Awesome work Philip!
-
Just a suggestion, but would it not be easier to make this changes on blur rather than while the user types. If you insist on doing it as the user types, you should have this text mirrored in another div so people can fix their typos and such as jesi mentioned.
Split String At <Img> Tag And Place In New Varaible
in PHP Coding Help
Posted · Edited by Zane
PHP´s strip_tags function should do the trick
http://php.net/strip-tags
I suppose you could do the same for your second varialbe, but you will have to come up with something to get rid of blank P tags.